Parfor memory getting lost

1 visualizzazione (ultimi 30 giorni)
Tiko
Tiko il 4 Dic 2017
Commentato: Tiko il 4 Dic 2017
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 Commenti
Matt J
Matt J il 4 Dic 2017
Modificato: Matt J il 4 Dic 2017
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 il 4 Dic 2017
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).

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Parallel for-Loops (parfor) in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by