We are using FMIKit in Simulink for a design optimization, swapping FMU's and changing FMU parameters with the following functions:
Swap out FMU's: FMIKit.loadFMU()
Change FMU parameters: FMIKit.setStartValue()
In the course of the optimization, these functions are called a couple of thousand times. Unfortunately, after a few hundred calls MATLAB crashes due to a Java Heap Space Error. As it turns out, using these commands repeatedly leads to something that looks like a memory leak inside the Java heap assigned to MATLAB. I tried all tricks regarding garbage collection etc. which are available on the internet and nothing solved this issue. Only commenting out the above-mentioned functions could prevent the memory leak.
Is this a known issue? Or is there even a known fix to this? I would be happy to hear about it.
We are using FMI Kit 3.0
Best,
Thomas
We are using FMIKit in Simulink for a design optimization, swapping FMU's and changing FMU parameters with the following functions:
Swap out FMU's: FMIKit.loadFMU()
Change FMU parameters: FMIKit.setStartValue()
In the course of the optimization, these functions are called a couple of thousand times. Unfortunately, after a few hundred calls MATLAB crashes due to a Java Heap Space Error. As it turns out, using these commands repeatedly leads to something that looks like a memory leak inside the Java heap assigned to MATLAB. I tried all tricks regarding garbage collection etc. which are available on the internet and nothing solved this issue. Only commenting out the above-mentioned functions could prevent the memory leak.
Is this a known issue? Or is there even a known fix to this? I would be happy to hear about it.
We are using FMI Kit 3.0
Best,
Thomas