I created a service to run every 4 hours to analyze 35 currency pairs for all time frames from M30~ MN. After the analysis is complete, the service still takes up 9.5MB of RAM and slows down the computer. I had to Stop and then click Start again to free up the memory to 1.5MB as before running the service. I have researched and found out that the reason the service takes up so much memory is because the iCustom() function has loaded indicators so it takes up memory but does not free it after it has finished using it. I have used local variables in the functions so that when the execution is finished, those variables are freed but the memory is still at 9.5MB. Is there a way to free up all the memory after each execution?
you can use IndicatorRelease function

- www.mql5.com

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I created a service to run every 4 hours to analyze 35 currency pairs for all time frames from M30~ MN. After the analysis is complete, the service still takes up 9.5MB of RAM and slows down the computer. I had to Stop and then click Start again to free up the memory to 1.5MB as before running the service. I have researched and found out that the reason the service takes up so much memory is because the iCustom() function has loaded indicators so it takes up memory but does not free it after it has finished using it. I have used local variables in the functions so that when the execution is finished, those variables are freed but the memory is still at 9.5MB. Is there a way to free up all the memory after each execution?