Skip to content

Memory handling on an infinite loop simulation #195

@pedro-ricardo

Description

@pedro-ricardo

Hello there ... firstly thank you for maintaining this library 👍
I have a question about how I can handle memory correctly.

I'm using PyFMI to set an infinite simulation coupled with an OpcUa Server to keep track and interact with the running model.

Here is some characteristics of my algorithm:

  • I've built a simulation using the Master algorithm because I have lots of FMUs to link in my model.
  • The infinite loop I've setup contains a simulation of a step and a sleep to make it realtime.
  • I've seen that the Master class do not have a do_step function so to do this I'm using the simulate(start_time=time, final_time=time+step) function with {'initialize':False} set in options.

My problem is that running this long enough will lead to a memory increasing until it reaches a maximum allowed by the OS.

I do not need the FMUs to keep track of the history of values of the simulations, I only want the latest values in each step ...
I believe the error is here...

Assuming the error is that ... could you guide me to call the correct functions to clean this history so I can run the simulation indefinitely?

Also if you think that the error is somewhere else, could you give me some advice on how to setup this correctly?

Thank you.

Metadata

Metadata

Labels

questionIssue only concerns a or multiple questions.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions