Borrar filtros
Borrar filtros

How can I return simulink memory back to OS?

2 visualizaciones (últimos 30 días)
Kyungjoon Kim
Kyungjoon Kim el 10 de Abr. de 2012
It looks like simulink memory leak. Look following script. (comment memory value from Windows Task Manager)
%matlab start
% 227MB
open_system sf_car
% 358MB
sim sf_car
% 383MB
close_system sf_car
% 386MB
bdclose all
% 386MB
clear
clear all
clear functions
clear classes
clear java
clear global
clear import
clear variables
% 385MB
Even after closing simulink, memory used by MATLAB.exe wasn't decreased. And, when execute simulation, memory was increased slowly.
open_system sf_car
% 355MB
sim sf_car
% 381MB
for i = 1 : 200
sim sf_car
end
% 384
for i = 1 : 200
sim sf_car
end
% 386MB
for i = 1 : 400
sim sf_car
end
% 387MB
I want to return memory increased during simuation back to OS. I tried following command. But It didn't work.
close_system sf_car
close('all', 'hidden');
% 386MB
clear
clear all
clear functions
clear classes
clear java
clear mex
clear global
clear import
clear variables
% 385MB
[m x j] = inmem('-completenames')
for i = 1 : length(m)
if mislocked(m{i})
munlock(m{i})
end
end
clear functions
% 371MB
% decreased a little.. but, after munlock and clear command,
% error message(?) printed during simulation =>
%Error calling slsfnagctlr('NagToken',...)
%A viewer named "DAS" already exists.
%Error calling slsfnagctlr('Clear',...)
%A viewer named "DAS" already exists.
  2 comentarios
Kaustubha Govind
Kaustubha Govind el 10 de Abr. de 2012
Kyungjoon: I would recommend reporting this to MathWorks Tech Support so the appropriate development team can look into this.
K E
K E el 10 de Abr. de 2012
If you figure out the answer from Tech Support could you post it here? Am curious.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Programmatic Model Editing en Help Center y File Exchange.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by