Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#3646 closed defect (fixed)

Simulation executables of large models quickly run out of memory

Reported by: Francesco Casella Owned by: somebody
Priority: critical Milestone:
Component: Run-time Version:
Keywords: Cc:

Description

When running simulation of large models, the memory allocated by the simulation process on the heap grows disproportionally.

For example, the simulation of a large test model of a power network (435 MB of code size) eventually generates about 4.8 GB of result data, which is reasonable as long as it is stored on mass storage.

Unfortunately, the simulation process allocates over 40 GB of RAM in the process, which is not acceptable. Results should be just dumped onto the .mat file (preferably by a dedicated thread running on a different CPU!) without taking any RAM at all, besides some reasonable buffer space.

This can also be a problem for smaller models running longer simulations, in particular if there are many events resulting in a large number of steps.

Change History (7)

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

Milestone: 1.9.41.9.5

Milestone pushed to 1.9.5

comment:2 by Martin Sjölund, 9 years ago

Milestone: 1.9.51.10.0

Milestone renamed

comment:3 by Francesco Casella, 9 years ago

It seems that this only happens if sparse solvers are used, so I guess a memory leak in the KLU solver might be involved. I've seen some pull requests on this topic recently, it seems that the problem is not completely solved.

comment:4 by crupp@…, 9 years ago

@casella I finally found time to close ticket:3548. The fix in PR661 was intended to fix the memory leaks for sparse solvers umfpack and klu. You may want to check if it also fixes the issue you are reporting here.

comment:5 by Francesco Casella, 9 years ago

I hope so. At the moment I am unable to run tests due to #3893. I'll check as soon as that problem is solved.

comment:6 by Francesco Casella, 9 years ago

Resolution: fixed
Status: newclosed

My largest test case now consumes about 1MB/s. There is still definitely some memory leak somewhere, but at least with 72 GB on the server, I can simulate for almost one day before I run out of memory. Previously, I did after a few minutes, so the situation has definitely improved.

I guess we should strive to avoid all memory leaks (not everybody has 72 GB on their PC), but I'm moving to a new ticket for that.

comment:7 by Martin Sjölund, 7 years ago

Milestone: 1.10.0

Milestone deleted

Note: See TracTickets for help on using tickets.