- Index
- » Developer
- » OpenModelica development
- » Memory Leaks in OpenModelica
Memory Leaks in OpenModelica
Memory Leaks in OpenModelica
When simulating any model in OpenModelica, the RAM usage increases throughout the lifetime of the simulation. The problem is that if a model simulates for too long a time, all the RAM may be used causing the machine to crash.
I used Valgrind to identify the memory leak issues. It quickly becomes clear that there are some severe memory leaks present in the code if a large model is being simulated. I have uploaded the Valgrind summary of a model that I ran for 10 seconds simulation times, indicating that memory leaks are present in the code. I believe this may be due to the fact that some variables are not deallocated (freed) correctly.
Re: Memory Leaks in OpenModelica
Where have you uploaded the valgrind summary?
What OM version are you using?
- adrpo
- 885 Posts
Re: Memory Leaks in OpenModelica
What is the stats of the model that you are simulating? (omc -d=backenddaeinfo model.mos; use getErrorString() to see the message)
For simpler models the amount of memory leaked is constant. But I suspect some non-linear solver or something could be causing the issue.
- sjoelund.se
- 1700 Posts
Re: Memory Leaks in OpenModelica
That's just 4.3MB (4,399,090 bytes) which is basically almost nothing.
Please also give us the OMC version: omc -version or OMEdit -> Help -> About OMEdit.
- adrpo
- 885 Posts
Re: Memory Leaks in OpenModelica
I am using v1.9.4-dev.beta2.120+g23cee7b at the moment. I am aware that the amount of memory leaked is very little, but the 4.3 MB was after 10 seconds of simulation time. This can become much greater when the simulation time is extended.
Re: Memory Leaks in OpenModelica
So what is the memory leaked after 100 seconds?
- sjoelund.se
- 1700 Posts
Re: Memory Leaks in OpenModelica
Or perhaps is valgrind is too slow, after 0 seconds?
- sjoelund.se
- 1700 Posts
- Index
- » Developer
- » OpenModelica development
- » Memory Leaks in OpenModelica