Parfor memory getting lost

2 vues (au cours des 30 derniers jours)
Tiko
Tiko le 4 Déc 2017
Commenté : Tiko le 4 Déc 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 commentaires
Matt J
Matt J le 4 Déc 2017
Modifié(e) : Matt J le 4 Déc 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 le 4 Déc 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).

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Parallel for-Loops (parfor) dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by