A memory hog

     This one to known issues. 10000 bars 1 minute loading time until chart is ready and 260 mega bytes of memory occupied. Thats a lot from what I can figure it out and is huge as compared with the professional Amibroker I have which does not load any memory or less than a few mega bytes. Where does it come from? It comes from the fact this program loads and holds everything in the memory. As a beginner of course it was the way I started to make it years ago and since this one its quite a complex thing the memory issue was never a priority. Its fine like this there are many other programs that are like this one for example Ninjatrader its more or less equivalent with this one ant those are professionals and many (I suppose) and I`m alone so its fine. Like I said it is like (almost) any other program with some being much better in some ways like Amibroker is and others being quite close slightly better. 

    Regarding memory issue I suppose its a matter of writing and reading data from and to the disk and not from and to the memory, all those arrays are quite large and they add up very fast. However for the moment I got no idea what could write so fast to the disk so it does not slow down the program as all file reading/writing to or from the disk is quite slow, except one function that I know that is blistering fast at reading a file. I`ll think about this only when the memory hog which this program is now has zero flaws and that's the only issue. A long time from now likely.

    Speaking of this, as I said its not such a issue, Ninjatrader was used by many and used for real time trading with a issue of being a memory hog so I don`t see it as a big deal especially since this program was made for a different purpose than commercial trading platforms and works differently. 


    There it is with all 10000 bars visible and 268 mega bytes plus 15 megabytes for the chart. This single chart. Loading time 1 minute, but there's a catch here, it loads 2 timeframes and this program unlike all others I know treats timeframes differently. For 1 timeframe loading time cuts in half? I don`t know and I`m not in the mood now to try but if not in half the surely drastically improves loading time and of course increases it with every timeframe added. Its valid for the memory issue as well, the fact it has 2 timeframes at 260 megabytes likely means 1 timeframe would be around 130 megabytes which is not that bad. And speaking of timeframes and this program, well, unlike other programs they are not related in this program. Which mean you can update a timeframe and the other one or others ones not. This allows the user to manually update data by updating each timeframe or only one timeframe and the other(s) whenever it needs it.  

Comments