Skip to content
This repository was archived by the owner on Apr 16, 2025. It is now read-only.
This repository was archived by the owner on Apr 16, 2025. It is now read-only.

FMI Kit in Matlab/Simulink: FMIKit.loadFMU and FMIKit.setStartValue create Matlab Java Heap Space Error #483

@ThomasK211

Description

@ThomasK211

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions