From: Jeff W. <js...@fa...> - 2007-03-28 18:39:51
|
Tom Holroyd (NIH/NIMH) [E] wrote: >> import os,matplotlib >> matplotlib.use('Agg') >> from matplotlib.figure import Figure >> from matplotlib.cbook import report_memory >> >> def plot(): >> fig = Figure() >> i = 0 >> while True: >> print report_memory(i) >> fig.clf() >> ax = fig.add_axes([0.1,0.1,0.7,0.7]) >> ax.plot([1,2,3]) >> i += 1 >> >> if __name__ == '__main__': plot() > > I have matplotlib-0.90.0 installed, and this script doesn't leak for > me. It grows a bit as shown in the graph, then stabilizes. I'm on FC4 > with Python 2.4.3. > > ------------------------------------------------------------------------ > Right - here too (on macos x), it levels off about about 15 times the initial memory usage. I just didn't run it long enough to notice that before. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/PSD R/PSD1 Email : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-124 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg |