Memory grows using parallel
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi, It's my first approach to the parallel computing, and I wrote a matlab code to take advantage this feature in Matlab. My problem is that the memory usage during the parallel run (using a parfor call) grows until I get an out of memory error.
My code is something like:
DATA=rand(1000,1000);
for k=1:1000
A=DATA(k,:);
B=DATA(k,:);
parfor i=1:100 do_something; end
end
I tried to clear out all the unused variables and pass to the function inside the parfor only the necessary part of data to ensure the smallest overhead, but it seems that in some way the code occupy even more memory for each run. Furthermore the whos output during each run didn't reveal the puzzle (all the variables have the same size).
Any ideas/suggestions to help me solve the problem?
Regards d
5 comentarios
Alvaro
el 25 de En. de 2023
Editada: Alvaro
el 25 de En. de 2023
In this case the code might be too simplified to figure out what the issue is, could you post more of the actual code? It would be good to know how you are writing to that text file and what variables you are using to store the results.
Respuestas (0)
Ver también
Categorías
Más información sobre Entering Commands en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!