Opened 5 years ago

Last modified 3 years ago

#5382 assigned defect

Simcode scales badly for models with large-sized arrays and events

Reported by: federico.terraneo@… Owned by: Karim.Abdelhak
Priority: normal Milestone:
Component: Backend Version: v1.14.0-dev-nightly
Keywords: Cc: casella, Andrea.Bartolini

Description

The attached model leaks around 10GB of RAM when run in OMEdit.
The RAM does not decrease even when the model is unloaded.
A second run leaks an additional 2GB.

Note: a machine with at least 32GB is required to simulate the model. It is possible to reduce the value of nx in the model to make it occupy less RAM but the leak is evident for large nx.

Attachments (1)

Thermal1Dalgorithmic.mo (1.2 KB) - added by federico.terraneo@… 5 years ago.

Download all attachments as: .zip

Change History (10)

Changed 5 years ago by federico.terraneo@…

comment:1 Changed 5 years ago by sjoelund.se

There is no memory leak that I can see by checking with OpenModelica.Scripting.GC_get_prof_stats(). It's just that Linux has a limit to the number of times you can free memory using the calls used by libgc, so we have disabled giving back memory to the OS. The memory will be reused by OMEdit on the next run.

comment:2 Changed 5 years ago by casella

  • Cc Andrea.Bartolini added

comment:3 Changed 5 years ago by adeas31

  • Resolution set to wontfix
  • Status changed from new to closed

My interpretation of Martin's comment is that it won't fix so I am closing this ticket. Feel free to reopen it.

comment:4 Changed 5 years ago by casella

  • Resolution wontfix deleted
  • Status changed from closed to reopened
  • Summary changed from Memory leak to Simcode scales badly for models with large-sized arrays and events

I agree with Martin's judgement that there is no memory leak here. The problem is actually a different one. If you run the model with -d=execstat with different sizes of N, you get this kind of results for the Performance of simCode: created simulation system equations step

N Time/s
1000 1.1
2000 4.2
4000 28.1

There is clearly a scaling problem here, which is probably among the ones listed in #4146. I guess this is also what causes the inordinate escalation of the allocated memory when N = 10000

The solution, as we all now understand, is to have fully vectorized backend and code generation. We can keep this ticket open as it contains a nice test case.

comment:5 Changed 5 years ago by adeas31

  • Component changed from OMEdit to Backend
  • Owner changed from adeas31 to Karim.Abdelhak
  • Status changed from reopened to assigned

comment:6 Changed 5 years ago by casella

  • Milestone changed from 1.14.0 to 1.16.0

Releasing 1.14.0 which is stable and has many improvements w.r.t. 1.13.2. This issue is rescheduled to 1.16.0

comment:7 Changed 4 years ago by casella

  • Milestone changed from 1.16.0 to 1.17.0

Retargeted to 1.17.0 after 1.16.0 release

comment:8 Changed 3 years ago by casella

  • Milestone changed from 1.17.0 to 1.18.0

Retargeted to 1.18.0 because of 1.17.0 timed release.

comment:9 Changed 3 years ago by casella

  • Milestone 1.18.0 deleted

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.