Fix your broken code.
Kkkkkkkk I think that you did not read what I wrote. The Metatrader starts do consume 2gb ram before execute my code, if I stop to debug on the first line of Oninit event it does consume 2gb. So my code is not executed yet in this moment.
Yes but mine is really really HUGE, I believe that RaZop project is the hughesnet created in MQL5.
Any way Alain helps a lot, and I found the problem, it is related to global initializations, then I fund in here that the global initializations create first the statics and dynamics variables.
The thing is that I use a matrix M[400][40][300] size because I am not able to resize second and the third dimension, I am only able to change the first dimension, then I declared a static matrix with all possibilites.
If there is a way to resize the second and the third dimension it will save me. I only found this https://www.mql5.com/en/forum/315929
But if anybody know another way I will be glad.
- 2019.06.17
- www.mql5.com
Yes but mine is really really HUGE, I believe that RaZop project is the hughesnet created in MQL5.
Any way Alain helps a lot, and I found the problem, it is related to global initializations, then I fund in here that the global initializations create first the statics and dynamics variables.
The thing is that I use a matrix M[400][40][300] size because I am not able to resize second and the third dimension, I am only able to change the first dimension, then I declared a static matrix with all possibilites.
If there is a way to resize the second and the third dimension it will save me. I only found this https://www.mql5.com/en/forum/315929
But if anybody know another way I will be glad.
Its not a question of resizing a 2nd or 3rd dimension. It is a question of proper design and implementation of using array of structures dynamically allocated and/or classes.
Its your code design that is the cause of the problem.
I recently also needed to make use of 3 dimensional data that needed to be dynamically sized as needed. You just need to properly analyse the requirements and properly implement the solution so that it is efficient.
EDIT: I can't exactly explain the solution, because each case is different and needs a different approach accordingly.
Its not a question of resizing a 2nd or 3rd dimension. It is a question of proper design and implementation of using array of structures dynamically allocated and/or classes.
Its your code design that is the cause of the problem.
I recently also needed to make use of 3 dimensional data that needed to be dynamically sized as needed. You just need to properly analyse the requirements and properly implement the solution so that it is efficient.
EDIT: I can't exactly explain the solution, because each case is different and needs a different approach accordingly.
As I explained, without knowing your exact details, I am unable to say. All I can say is that you should study up on Structures, Arrays of Structures, Dynamic allocations of those arrays and also to look into Classes to tie everything up into a neat organised bundle.
For example, as a simplified look at what you described, I would build a structure (or class) for each subset of the data and then build on that using dynamic allocation for each level (or dimension) of the data.
However, I am not here to code it for you, only to offer you some advice or guidance of what to study in order for you to do it yourself. I am assuming that you don't intend to hire anyone to do it for you, so your only option is to keep studying it until you can organise your code better.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I Have a EA that consumes 2GB of ram memory, this is a huge EA, it starts to consume this amount just when I start it and even not starting, I mean, on OnInit it starts to consume this Ram memory, is it possible reduce the consume?
Thanks