Matlab Scripting " Analyze tool " Memory leak?

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Xiangjie Meng
Posts: 15
Joined: Wed Sep 05, 2012 8:09 pm

Matlab Scripting " Analyze tool " Memory leak?

Post by Xiangjie Meng » Tue Jul 01, 2014 6:39 am

Hi all,

Thanks a lot for reading this topic. Recently, I am using "Analyze tool" to run static optimization. The matlab scripting is as follows:

for i = 1:1 %:size(models,2) %for each model
for j= 1:size(motions,2) %do a set of analyses for each motion
resultpath{i,j} = ['ResultsAnalyze_model',num2str(i), '_motion', num2str(j)];
model = Model([path3 models{i}]);
statop = AnalyzeTool([path2 'staticOpt_setup.xml']);
statop.setModel(model);
statop.setCoordinatesFileName(motions{j});
statop.setResultsDir(resultpath{i,j});
statop.run();
clear statop;
clear model;
end
end


I need to run many loops to finish the simulation. But during simulation, the memory used by Matlab keeps going up until Matlab crashes or stop running (without enough memory). I use "clear all" to clear, but not really works. I think this could be cause by some kind of memory leak.

Could you please help me figure out how to deal with this problem? Thanks. If there is a method that I can use Matlab to clear these special memory, that would be very helpful.

Thanks a lot.
Best,

Xiangjie

POST REPLY