How can I return simulink memory back to OS?

2 次查看(过去 30 天)
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 个评论
Kaustubha Govind
Kaustubha Govind 2012-4-10
Kyungjoon: I would recommend reporting this to MathWorks Tech Support so the appropriate development team can look into this.
K E
K E 2012-4-10
If you figure out the answer from Tech Support could you post it here? Am curious.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programmatic Model Editing 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by