2011/3/8 Paul Anton Letnes <paul.anton.let...@gmail.com>: > Hi! > > This simple loop: >>>> import time >>>> import pylab >>>> for i in range(100): > ... time.sleep(0.1) > ... pylab.figure() > ... > will have python use more and more memory. While this is not technically a > memory leak, it becomes one in practice, if I want to create a large number > of figure objects. How can I free the memory used by one or all figure > objects?
Your code creating many objects is not a memory leak. You can reuse figures or dispose of them calling pylab.close(). See docstrings for pylab.close and pylab.clf. Goyo ------------------------------------------------------------------------------ What You Don't Know About Data Connectivity CAN Hurt You This paper provides an overview of data connectivity, details its effect on application quality, and explores various alternative solutions. http://p.sf.net/sfu/progress-d2d _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users