On Fri, Nov 21, 2008 at 7:04 AM, Benoit Zuber <[EMAIL PROTECTED]> wrote: > >> > I posted this on maplotlib-users list, but got no reply. I guess that >> > bugs should rather be reported here... >> >> Could you post a *complete* script that demonstrates the leak, eg one >> that calls the function and does any other cleanup? Does it help to >> use gc.collect between function calls? > > Thanks for your reply. Here is the complete script (I was running the > previous one interactively). > In fact, I realised that the memory leak is not total... I mean that the > RAM gets loaded during the first two iterations, which correspond to a > load of 1.9Gb (I have 4Gb RAM in total). Then the RAM usage remains > absolutely stable. > > I then tried to run this script interactively in ipython. Once the > script ends, the RAM is not released (1.9Gb are still used). > Nevertheless, when I call fa() once again, the memory load remains the > same. So this leak does not lead to a crash, which is fine. > > Finally if I comment "matplotlib.use('Agg')", then the load is > increasing during each iteration, saturating the RAM, and starting > filling up the swap. In this case the output of the script is :
If you comment out agg you are using a gui backend presumably (which one) and most of these are known to have some leaks, some of which are beyond our control. Michael has recently made some change to significantly reduce a gtk leak. When you say you are working interactively, do you mean from the python or ipython shell? ipython holds a reference to the names the main module namespace, which could be preventing a gc cleanup. After reading your post, I am not clear if you still have a problem or not. >From the data you posted, it appears that agg is not leaking in your example. JDH ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel