Memory Leak Error?

 

I think that this code has no errors.


//Codes From controlerrors.mqh 

//_CountErrors is constant 150.

// Error Line is 85,10 (Structure Array Error)


ArrayResize(Errors,_CountErrors); 

85   Errors[0].code = 10004;Errors[0].desc = "Requote";


But my ea( containing controlerrors.mqh) cannot init after several hours passed from terminal start.(with other eas and charts)


It says that my ea init failed.


1. Whats the reason? ex) Memory Leak

2. Any Function for this error? ex) Memory Free Function

Files:
 
Shin Joo Young:

I think that this code has no errors.

But my ea( containing controlerrors.mqh) cannot init after several hours passed from terminal start.(with other eas and charts)

It says that my ea init failed.

Init is run when you first put it on a chart. Not "after several hours." It never ran, because it returned a failure in init. There must be an error in the code and you should have logged it. Check your return codes for errors and report them.
          What are Function return values ? How do I use them ? - MQL4 and MetaTrader 4 - MQL4 programming forum
          Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
 
whroeder1:
Init is run when you first put it on a chart. Not "after several hours." It never ran, because it returned a failure in init. There must be an error in the code and you should have logged it. Check your return codes for errors and report them.
          What are Function return values ? How do I use them ? - MQL4 and MetaTrader 4 - MQL4 programming forum
          Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles

0 03:09:45.893 Expert Optimizer EURUSD,M1: loaded successfully

1 03:09:45.949 Optimizer EURUSD,M1: array out of range in 'controlerrors.mqh' (85,10)

3 03:09:45.949 Optimizer EURUSD,M1: global initialization failed


                                The Code is above.

 
Shin Joo Young:

0 03:09:45.893 Expert Optimizer EURUSD,M1: loaded successfully

1 03:09:45.949 Optimizer EURUSD,M1: array out of range in 'controlerrors.mqh' (85,10)

3 03:09:45.949 Optimizer EURUSD,M1: global initialization failed


                                The Code is above.


I made an automatic optimizer ea (automatically re-init) but it makes error after several hours from start (many re-init succeeded).

 
Shin Joo Young:

0 03:09:45.893 Expert Optimizer EURUSD,M1: loaded successfully

1 03:09:45.949 Optimizer EURUSD,M1: array out of range in 'controlerrors.mqh' (85,10)

3 03:09:45.949 Optimizer EURUSD,M1: global initialization failed


                                The Code is above.

Check the returned value of ArrayResize().

ArrayResize(Errors,_CountErrors);
There is no way for us to say more. If at some moment there is no more available memory you have to find why. Most probably a bug in your calling code.
 
Alain Verleyen:

Check the returned value of ArrayResize().

There is no way for us to say more. If at some moment there is no more available memory you have to find why. Most probably a bug in your calling code.

Okay I will do it.

 
Alain Verleyen:

Check the returned value of ArrayResize().

There is no way for us to say more. If at some moment there is no more available memory you have to find why. Most probably a bug in your calling code.

4025

ERR_OUT_OF_MEMORY


Any Methods for clearing increasing memory?

Thank You.

Memory Increases very slowly.

 
Shin Joo Young:

4025

ERR_OUT_OF_MEMORY


Any Methods for clearing increasing memory?

Thank You.

Memory Increases very slowly.


If you're running out of memory due to an array that stores errors, I'd say you have bigger problems to fix...