MetaTester taking up all available memory

 

Hello everyone,

I have tried researching this, but didn't find a solution that works. I am using a 16-core AMD CPU with 64GB of RAM.

The problem with the tester agents is that it feels like they never release any memory and always take up all the available memory until the PC crashes. Aside of the 64GB of RAM, I have tried to allocate 300GB pagination file on the HDD to be used in case the RAM is not enough, and guess what - it filled it up too.

I am trying to optimize an EA, which works on M1 bars for 10-20 years ago and can't really do that, because the PC always crashes, because all the RAM gets filled up.

I tried using local agents only - same result. Tried to ZeroMemory all the variables - same result. I don't know what to try anymore to make it work. Feels like a problem with the MetaTester. I'm using the latest built - 2361. I completely understand that I am trying to test M1 bars for 20 years ago, which is a lot of bars to test, but the memory usage just goes higher, it never gets released between the passes.

Any idea how can I solve this issue?

Thank you!

 
GEORGI GEORGIEV:

Hello everyone,

I have tried researching this, but didn't find a solution that works. I am using a 16-core AMD CPU with 64GB of RAM.

The problem with the tester agents is that it feels like they never release any memory and always take up all the available memory until the PC crashes. Aside of the 64GB of RAM, I have tried to allocate 300GB pagination file on the HDD to be used in case the RAM is not enough, and guess what - it filled it up too.

I am trying to optimize an EA, which works on M1 bars for 10-20 years ago and can't really do that, because the PC always crashes, because all the RAM gets filled up.

I tried using local agents only - same result. Tried to ZeroMemory all the variables - same result. I don't know what to try anymore to make it work. Feels like a problem with the MetaTester. I'm using the latest built - 2361. I completely understand that I am trying to test M1 bars for 20 years ago, which is a lot of bars to test, but the memory usage just goes higher, it never gets released between the passes.

Any idea how can I solve this issue?

Thank you!

Do you mean RAM memory or hard disk space?

Because I've seen EAs filling up the hard disk very quickly, due to some coding error that produced a huge log file (up to 30-40Gb per test), but not to use all available RAM memory.

 
I mean filling up RAM + pagination file. Once I restart the PC, the HDD space gets released, so it's not a log file. I am also monitoring this in the task manager - https://prnt.sc/s11fl5
 
GEORGI GEORGIEV:
I mean filling up RAM + pagination file. Once I restart the PC, the HDD space gets released, so it's not a log file. I am also monitoring this in the task manager - https://prnt.sc/s11fl5

That's really strange, I've never seen MT5 tester using 60Gb of RAM before.

 

It's MT5, but should be similar. It's not normal for sure.

Also, any idea how can I escalate this to the MT5 development team? Maybe I can send them a log or something, so they could investigate this and get it fixed?

 
GEORGI GEORGIEV:

It's MT5, but should be similar. It's not normal for sure.

Also, any idea how can I escalate this to the MT5 development team? Maybe I can send them a log or something, so they could investigate this and get it fixed?

I believe its an EA error and MT5 technicians wouldn't look into it.

I hope some experienced coder or developer can help, but without seeing any code or something this seems impossible.

 
You might be right, I downloaded a random free EA from the market and it's behaving way better in terms of memory. Is there a guide or something of what kind of optimizations need to be done in the code? Do classes with only static functions and static variables need to be released in some specific way for example? There are probably some specifics I'm not aware about and if apply them, it will run better.
 
GEORGI GEORGIEV:
You might be right, I downloaded a random free EA from the market and it's behaving way better in terms of memory. Is there a guide or something of what kind of optimizations need to be done in the code? Do classes with only static functions and static variables need to be released in some specific way for example? There are probably some specifics I'm not aware about and if apply them, it will run better.

I don't know, maybe a more experienced coder or developer can help.

 

GEORGI GEORGIEV:
Do classes with only static functions and static variables need to be released in some specific way for example? There are probably some specifics I'm not aware about and if apply them, it will run better.

  1. Of course, not.
  2. You are using new somewhere and not managing / loosing your objects. We can't see your broken code.
 
GEORGI GEORGIEV:

Hello everyone,

I have tried researching this, but didn't find a solution that works. I am using a 16-core AMD CPU with 64GB of RAM.

The problem with the tester agents is that it feels like they never release any memory and always take up all the available memory until the PC crashes. Aside of the 64GB of RAM, I have tried to allocate 300GB pagination file on the HDD to be used in case the RAM is not enough, and guess what - it filled it up too.

I am trying to optimize an EA, which works on M1 bars for 10-20 years ago and can't really do that, because the PC always crashes, because all the RAM gets filled up.

I tried using local agents only - same result. Tried to ZeroMemory all the variables - same result. I don't know what to try anymore to make it work. Feels like a problem with the MetaTester. I'm using the latest built - 2361. I completely understand that I am trying to test M1 bars for 20 years ago, which is a lot of bars to test, but the memory usage just goes higher, it never gets released between the passes.

Any idea how can I solve this issue?

Thank you!

Hi Georgi,

Would you please tell me which AMD CPU you are using. I want to buy an AMD RYZEN 9 3950X and would like to know how much faster the Tester is running with your 16 core CPU compared to an I7 8-core CPU?

Thank you very much!

BTW I might have had the same problem, my PC crashed many times during back testing, but it was gone after I disabled some programs in AutoStart.

 

William Roeder, I am deleting all the objects I'm creating. The EA compiles without warnings. I am planning to try passing all the variables between functions by reference (with const), so they are not using extra memory. I still think I have to ZeroMemory every variable I create, because the tester doesn't have (proper) garbage collection., but I hope I am wrong.

irinacfd, I have exactly AMD RYZEN 9 3950X, but not sure how we can compare the 2 CPUs.

Reason: