improve supervision of memory management in FMI interface