High memory usage on lower timeframes

Posted By: NorbertSz

High memory usage on lower timeframes - 03/09/22 11:31

Dear all,

I started to use multiple Zorro S instances (2.44). As you see on the attached picture this is my VPS's task manager, and my question is about the huge memory usage. The running script is exactly the same on all Zorro instances: they connect to a MT4 terminal (one MT4, one chart open with the Zorro EA.). They are in Trade mode.

The only difference between them is the timeframe: 1, 5, 15, 60, 240.
The highest memory usage is connected to the 1 minute timeframe instance, and the lowest to the 240 minutes.

I found this thread:
https://opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=478604
but I don't use the PRELOAD flag.

In the code:
Code
function run(){
	set(LOGFILE);
	//BarPeriod = 60; //selected with the UI
	LookBack = screenSize * 2 + 20;

(screenSize is a constant, set 200)

So it should only load 420 candles per timeframe, the 1.87 GB RAM on 1 minutes chart is insane.

Additional informations: this huge memory usage is this high at the first moment of the trading, and it's not increasing time-by-time. So i'm pretty sure it's not a memory leak in the code.

Could you help me how is it possible and how can I avoid this phenomenon?
Thank you!


Attached picture zorro_memory.png
Posted By: jcl

Re: High memory usage on lower timeframes - 03/09/22 11:42

https://zorro-project.com/manual/en/asset.htm

Under 'remarks' on this page is a formula to estimate memory requrement per asset. Obviously, it's far away from > 1 GB. So something else in your script is probably the culprit. You can use the memory() function for getting the real memory footprint at any bar.
Posted By: TrumpLost

Re: High memory usage on lower timeframes - 03/10/22 05:01

Watching this thread. Hope you get an answer.
© 2024 lite-C Forums