|
From: CASOLI J. <jul...@ce...> - 2011-01-13 13:54:13
|
Hello to all, This is yet another question about matplotlib not freeing memory, when closing a figure (using close()). Here is what I'm doing (tried with several backends, on MacOSX and Linux, with similar results): -------------------- import matplotlib as mpl from matplotlib import pylot as plt import numpy as np a = np.arange(1000000) mpl.cbook.report_memory() # -> output: 54256 plt.plot(a) mpl.cbook.report_memory() # -> output: 139968 plt.close() mpl.cbook.report_memory() # -> output: 138748 -------------------- Shouldn't plt.close() close the figure _and_ free the memory used by it? What am I doing wrong ? I tried several other ways to free the memory, such as f = figure(); ... ; del f, without luck. Any help appreciated ! P.S. : side question : how come the call to plot take so much memory (90MB for a 8MB array ?). I have read somewhere that each point is coded on three RGB floats, but it only means an approx. 12MB plot... (plus small overhead) Jules |