Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

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.


https://openmodelica.org/images/agorapro/attachments/4676/mini_Valgrind-report.png

Edited by: AntonDV - Jun-27-16 15:36:13

Re: Memory Leaks in OpenModelica

Where have you uploaded the valgrind summary?
What OM version are you using?

Re: Memory Leaks in OpenModelica

I have made the alterations to the post to show the Valgrind screenshot.

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.

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.

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?

Re: Memory Leaks in OpenModelica

Or perhaps is valgrind is too slow, after 0 seconds?

Re: Memory Leaks in OpenModelica


https://openmodelica.org/images/agorapro/attachments/4676/mini_Backend-DAE-info-flag-added.png

https://openmodelica.org/images/agorapro/attachments/4676/mini_100-second-simulation.png

https://openmodelica.org/images/agorapro/attachments/4676/mini_0-second-simulation.png

I have attached the valgrind results for a 0 second simulation and a 100 second simulation. I have also attached the backendDAEinfo logs.

There are 0 guests and 0 other users also viewing this topic
You are here: