Hello.
I'm having a problem with my EA. I have the following message repeating:
2022.07.06 13:11:46.206 MemoryException 1228800 bytes not available, 0 heapmin result
2022.07.06 13:11:46.206 MemoryException 1228800 bytes not available, 0 heapmin result
2022.07.06 13:11:46.207 MemoryException 1228800 bytes not available, 0 heapmin result
2022.07.06 13:11:46.207 MemoryException 1228800 bytes not available, 0 heapmin result
2022.07.06 13:11:46.207 MemoryException 1228800 bytes not available, 0 heapmin result
2022.07.06 13:11:46.207 MemoryException 1228800 bytes not available, 0 heapmin result
I am using a lot of indicators on this EA but I never had problem with it.
I'm retrieving data like this (with shift = 0 or 1) :
if(signal == rsi_cl)
{
double array[];
ArraySetAsSeries(array, true);
CopyBuffer(indicator, 0, 0, shift+2, array);
double value = NormalizeDouble(array[shift], 2);
if (value < 30) return buy_signal;
else if (value > 70) return sell_signal;
}
Any idea where that can come from?
Thanks.
Arthur
You can monitor memory with these handy functions - might help to print these out regularly to see if its a memory leak which builds gradually rather than a specific statement
string strMemUsed = IntegerToString(TerminalInfoInteger(TERMINAL_MEMORY_USED)); string strMemAvail = IntegerToString(TerminalInfoInteger(TERMINAL_MEMORY_AVAILABLE)); string strMemTotal = IntegerToString(TerminalInfoInteger(TERMINAL_MEMORY_TOTAL)); string strMemPhys = IntegerToString(TerminalInfoInteger(TERMINAL_MEMORY_PHYSICAL));
You can monitor memory with these handy functions - might help to print these out regularly to see if its a memory leak which builds gradually rather than a specific statement
-2
MemUsed: 1885
MemAvail: 14496
MemTotal: 16382
MemPhys: 8191
after init ind
MemUsed: 1916
MemAvail: 14466
MemTotal: 16382
MemPhys: 8191
-1
MemUsed: 1916
MemAvail: 14466
MemTotal: 16382
MemPhys: 8191
0
MemUsed: 1916
MemAvail: 14458
MemTotal: 16382
MemPhys: 8191
1
MemUsed: 1924
MemAvail: 14456
MemTotal: 16382
MemPhys: 8191
2
MemUsed: 1933
MemAvail: 14449
MemTotal: 16382
MemPhys: 8191
3
MemUsed: 1917
MemAvail: 14462
MemTotal: 16382
MemPhys: 8191
4
MemUsed: 1926
MemAvail: 14456
MemTotal: 16382
MemPhys: 8191
5
MemUsed: 1926
MemAvail: 14453
MemTotal: 16382
MemPhys: 8191
6
MemUsed: 1929
MemAvail: 14453
MemTotal: 16382
MemPhys: 8191
CTrade::PositionOpen: MQL5 program is stopped. Trading is disabled
CTrade::PositionOpen: MQL5 program is stopped. Trading is disabled
CTrade::PositionOpen: MQL5 program is stopped. Trading is disabled
7
MemUsed: 1998
MemAvail: 14384
MemTotal: 16382
MemPhys: 8191
8
MemUsed: 1998
MemAvail: 14384
MemTotal: 16382
MemPhys: 8191
I put prints all the way during init and ontick, everything looks good even the error happens right after the init.
I'm still digging to find the problem
Looks like you have enough RAM.. Doing a search in MQL5.com for heapmin reveals two other forum posts where it is mentioned but its not clear to me what the solution could be.
If you have another PC try it on there, so you can identify whether it is a hardware/OS issue limited to your current host.
Looks like you have enough RAM.. Doing a search in MQL5.com for heapmin reveals two other forum posts where it is mentioned but its not clear to me what the solution could be.
If you have another PC try it on there, so you can identify whether it is a hardware/OS issue limited to your current host.
Actually I can’t reproduce this error on my PC at the moment which is much more powerful but I did have it yesterday.
It seems quite rare when searching MQL.com for heap or heapmin - searching for MemoryException yields more hits but there's a lot to read!
I guess if you have many instances of mt5 running, there could be some conflict over shared memory areas and that's how you have hit the limit even though there is plenty of free RAM available. I have experienced this sort of thing with other products, but they were ERP so there were well documented options to tune them and increase the limits.
It would be down to someone with intricate knowledge of MT5 to publish whether there could be a tuning parameter which could be adjusted to overcome this, or fix it in the kernel if this is the case.
If its your code, you could also review how efficiently you are using memory and whether there are large objects, arrays, datasets etc. you could clear down once they are no longer relevant, or excessive recursion/looping/sorts, etc., just in case that does the trick
It seems quite rare when searching MQL.com for heap or heapmin - searching for MemoryException yields more hits but there's a lot to read!
I guess if you have many instances of mt5 running, there could be some conflict over shared memory areas and that's how you have hit the limit even though there is plenty of free RAM available. I have experienced this sort of thing with other products, but they were ERP so there were well documented options to tune them and increase the limits.
It would be down to someone with intricate knowledge of MT5 to publish whether there could be a tuning parameter which could be adjusted to overcome this, or fix it in the kernel if this is the case.
If its your code, you could also review how efficiently you are using memory and whether there are large objects, arrays, datasets etc. you could clear down once they are no longer relevant, or excessive recursion/looping/sorts, etc., just in case that does the trick
What means ERP please?
About memory management i'm not sure what are the best practices. I use arrays of indicators for example.
Thanks for your help by the way.
What means ERP please?
About memory management i'm not sure what are the best practices. I use arrays of indicators for example.
Thanks for your help by the way.
Sorry - industry term for "Enterprise Resource Planning" software. Usually used by large corporations so very heavily engineered with lots of tunable parameters
Happy to help, although I am not sure I got you closer to a solution...
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello.
I'm having a problem with my EA. I have the following message repeating:
2022.07.06 13:11:46.206 MemoryException 1228800 bytes not available, 0 heapmin result
2022.07.06 13:11:46.206 MemoryException 1228800 bytes not available, 0 heapmin result
2022.07.06 13:11:46.207 MemoryException 1228800 bytes not available, 0 heapmin result
2022.07.06 13:11:46.207 MemoryException 1228800 bytes not available, 0 heapmin result
2022.07.06 13:11:46.207 MemoryException 1228800 bytes not available, 0 heapmin result
2022.07.06 13:11:46.207 MemoryException 1228800 bytes not available, 0 heapmin result
I am using a lot of indicators on this EA but I never had problem with it.
I'm retrieving data like this (with shift = 0 or 1) :
if(signal == rsi_cl)
{
double array[];
ArraySetAsSeries(array, true);
CopyBuffer(indicator, 0, 0, shift+2, array);
double value = NormalizeDouble(array[shift], 2);
if (value < 30) return buy_signal;
else if (value > 70) return sell_signal;
}
Any idea where that can come from?
Thanks.
Arthur