Opened 6 years ago

Last modified 6 years ago

#5498 new defect

High Memory Usage When Opening a Model

Reported by: Arinomo <trista.arinomo@…> Owned by: somebody
Priority: high Milestone: Future
Component: *unknown* Version: v1.14.0-dev-nightly
Keywords: Memory Usage Cc:

Description

I have a model with ca. 15.600 equations(~7400 equations are trivial). When opening the model, i've noticed the memory usage jumps to 12GB and stays at that level even though i've closed the model. How can i test for a memory leak? or is it a memory leak problem in the first palce? unfortunately, i can't share the model.

Change History (5)

comment:1 by Martin Sjölund, 6 years ago

We use a garbage collector (Boehm). It uses some syscalls in Linux that have a limit on the number of times it can free the memory (after which the process crashes). Due to this, we have disable free'ing the memory allocation. It is still available to OpenModelica and will be reused when you simulate a model, etc.

Open Tools -> OpenModelica Compiler CLI and enter GC_get_prof_stats(), press enter to send the command and see how much memory is used by the compiler itself. The numbers may be hard to read since the garbage will not be cleaned until necessary though.

comment:2 by Arinomo <trista.arinomo@…>, 6 years ago

Hallo Martin, thanks for the feed back.

But it is possible for a memory to jump to 12GB without even simulating the model? all i've done is open the model.

comment:3 by Martin Sjölund, 6 years ago

Opening a model instantiates the entire model. It can use more memory than simulating the model would. For the nightly build you could test the new frontend which probably uses much less memory: https://github.com/OpenModelica/OMCompiler/pull/3087#issuecomment-492638373

comment:4 by Arinomo <trista.arinomo@…>, 6 years ago

Ah, okey. So that makes sense. Ok, i'll try to look into it. Thanks again. Cheers

comment:5 by Francesco Casella, 6 years ago

You need to use the new front-end also for the OMEdit API calls, please set -d=newInst,nfAPI in Tools | Options | Simulation | Additional Translation Flags

Note: See TracTickets for help on using tickets.