pylab/matplotlib large plot memory management - bug? or tuning parameter needed?
johan.gronqvist at gmail.com
Tue Oct 20 09:48:57 CEST 2009
> It is not straightforward to avoid memory leaks/consumption in pylab.
> If we define
> x = arange(1e6) # adjust size to make the increment visible, yet
> fast enough to plot
> # then repetition of
> plot(x,hold=0) # consumes increasing memory according to ubuntu
> system monitor
I do not know what closing the window does, but in my programs, running
on debian and opensuse, I found that explicitly calling close() solved
my memory leaks with matplotlib.
> 3/ Are there python/matplotlib memory management tuning parameters I
> can tweak?
You could try to import gc, and then call gc.collect() after each call
docs at: http://docs.python.org/library/gc.html
Hope it helps
More information about the Python-list