Incorrect loading/unloading of FMUs (memory leaks)
FMI v1
- Co-simulation FMUs must be terminated with
fmi1_import_terminate_slave
instead offmi1_import_terminate
. - Call
fmi1_import_free_slave_instance
to run the FMU's internal clean-up.
FMI v2
- Call
fmi2_import_free_slave_instance
to run the FMU's internal clean-up.
Additional problems
- FMI Library does not release its internal data structures on FMU unload
- Two temporary arrays (vars, types) not released when loading FMU
- Potentially low performance when accessing data from
fmus
array by value - Linux-build does not release memory after unloading the FMU unless
malloc_trim
is called manually
Edited by Jussi Koskela