mwfx108: This code is consuming memory like a black hole. It runs up to 10GB RAM within 10 seconds of running.
for ( int i = 13; i < 21; i++ ) { for ( int j = 0; j < 6; j++ ) { for ( int k = 34; k < 89; k++ ) { for ( int l = 0; l < 6; l++ ) { ⋮ DoCopyBuffer( i, j, k, l, c );
There is no memory leak. You are loading (21-13)*6 + (89-34)*6 = 378 different indicators on each new bar. Why are you surprised. Each will be unloaded ten minutes after the last access.
William Roeder:
There is no memory leak. You are loading (21-13)*6 + (89-34)*6 = 378 different indicators on each new bar. Why are you surprised. Each will be unloaded ten minutes after the last access.
Oh really. D: Thanks for the invaluable information! I assumed that IndicatorRelease unloads the indicator and releases the memory. Is there any way to unload / free it?
Edit: The creation of the indicators isn't the problem though. It is only when using CopyBuffer( ... ) that the massive memory consumption begins.Edit2: Hmm, I see. IndicatorRelease isn't executed in StrategyTester ... :/
The handle is removed immediately, the calculation block is deleted in some time (if it's not called anymore). When working in the strategy tester, the IndicatorRelease() function is not executed.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
This code is consuming memory like a black hole. It runs up to 10GB RAM within 10 seconds of running.
I don't quite understand why. I reserve memory for the arrays, I create 2 MAs, CopyBuffer, then release the MAs aswell as the arrays. This does not happen when I comment out the "CopyBuffer( ... )" calls. Any idea why and how to fix this?
Showcase: