On 2010-07-12 23:17:19 +0200, John Hunter said: > On Mon, Jul 12, 2010 at 4:06 PM, K.-Michael Aye > <kmichael....@gmail.com> wrote: >> Dear all, >> >> I'm not sure if this is by design or a problem: >> >> In a pylab session, if I repeatedly call imshow with the same image, >> memory increases each time. >> This does not happen if i go the 'Artists' way (fig = .., ax = >> fig.add---, im = ax.imshow) >> Is there a way to avoid memory consumption like this in the pylab style? >> Even a clf() does not release the memory. >> My config is the latest Enthought distribution in 32-bit mode for MacOS. >> > > > Can you post a complete free-standing script that we can run which > exposes the problem? Also please report your version numbers -- we > could look them up from enthought perhaps but you can help us :-)
Of course, sorry. But because I don't know how to read out Python's memory consumption from within python, these lines should be run successively in Ipython, so that one can see, how the 'Real Mem' system indicator grows each time. l = [28.1] arr = ones((1500,1500,3)) l.append(79.7) imshow(arr) l.append(172.0) imshow(arr) l.append(249.0)) l.append(249.0) imshow(arr) l.append(326.3)) l.append(326.3) imshow(arr) l.append(404.4) imshow(arr) l.append(482.4) This was run in an ipython session started with the -pylab flag. The numbers in the l array are the MBs I read of Mac's Activity Monitor for the Python task. Here is the resulting plot: http://dl.dropbox.com/u/139035/mem_growth.png Here's my system info: Darwin paradigm.local 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386 In [25]: print matplotlib.__version__ -------> print(matplotlib.__version__) 0.99.3 Enthought Python Distribution -- http://code.enthought.com Python 2.6.5 |EPD 6.2-2 (32-bit)| (r265:79063, May 28 2010, 15:13:03) my matplotlibrc (some adaptations): http://dl.dropbox.com/u/139035/matplotlibrc Hope this is all you need? BR, Michael > > http://matplotlib.sourceforge.net/faq/troubleshooting_faq.html#troubleshooting > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users