Parfor memory getting lost

1 次查看(过去 30 天)
Tiko
Tiko 2017-12-4
评论: Tiko 2017-12-4
I have a while loop in my main function. In each iteration, I call another function where I compute some things within a parfor loop. In order to do its computation, parfor needs a large amount of data. I noticed the amount of used memory increases with time. Parfor doesn't seem to clear the memory after it is finished. I now resolve this by re-starting the parallel pool every few iterations. Is there a better way?
  2 个评论
Matt J
Matt J 2017-12-4
编辑:Matt J 2017-12-4
There's not enough information in your post to be sure that PARFOR is the culprit. Maybe, within the body of the loop, you are calling a particular function that is not clearing its memory.
Tiko
Tiko 2017-12-4
It doesn't happen if I replace parfor by for (but it takes a lot more time, which is why I need the parfor and thus tested a smaller number of iterations). It also does not seem to happen (at least to that extent) in Matlab 2015a (I was using 2015b), but 2015a is a lot slower (I think it penalizes me for writing too many functions and forcing it to copy data between them, but I didn't read what was new between 2015a and 2015b into that much detail).

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Parallel for-Loops (parfor) 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by