parallel run keps incresing RAM usage

I have a conceptually very simple matlab script to run a simulink model to explore different param combinations:
% global param settings
a=
b=
c=
% iterations on "local" params and run N instances in parallel
for d ...
for e ...
for f ...
simIn(1:Nproc) = Simulink.SimulationInput(model);
for idx = 1:N
simIn(idx) = simIn(idx).setBlockParameter(...)
end
out = parsim(simIn, TransferBaseWorkspaceVariables='on')
end
end
end
The problem is that while iterating over d,e,f (i.e., for each parallel run) the RAM used increases until the runs start to use swap space, dramatically reducing performances.
I tried to open the simulink model (and close it) before (and after) every parallel run.
I tried to add Simulink.sdi.setRecordData(false) just after opening the model.
Now I have no idea of why the problem happens and how to solve it.

댓글 수: 2

Walter Roberson
Walter Roberson 2026년 3월 24일 18:39
You appear to be overwriting the results stored in out upon each iteration of for f .
If you are saving the results somehow instead, then the details of how you are doing that might be important.
alberto maurizi
alberto maurizi 2026년 3월 25일 6:30
Well, actually I save the part of the output I need in some files (I don't keep any extra variable in memory) and then I just reuse 'out'.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Model Order Reduction에 대해 자세히 알아보기

질문:

2026년 3월 24일 13:26

댓글:

2026년 3월 25일 6:30

Community Treasure Hunt

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

Start Hunting!

Translated by