>> instance of Figure(), then you shouldn't need to close the figure by hand.
>> It should be deleted whenever you delete or replace your instance of
>> Figure.  (If I understand correctly.)

>... Garbage collection will take
> care of reclaiming memory once the user code has no more references to
> the object either.


I guess that is how it should work in theory. However at least for the
version of mpl shipped with ubuntu 8.10 (Version: 0.98.3-4ubuntu1)
there is surely quite a serious and easily demonstrated memory leak
using the artist api. Even if you manually del the figure objects
which are created inside a loop a significant growth of memory can be
observed. In fact I think there may be two separate leaks.

In the attatched standalone code example after 1000 iterations
creating 1000 png graphs there is around 2GB of RAM consumed. If you
takeout the call to savefig around 600MB is consumed.

In my view the code in the loop should execute in constant space
without growth at all. Note that when the function returns the memory
seems to be deallocated so if you check the ram use during the sleep
you should see this.

Any ideas on this?



-- 
Gerry Steele
http://belfast.no-ip.info/

Attachment: memleaktest.py
Description: Binary data

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to