On Mon, Feb 9, 2009 at 9:59 PM, Jouni K. Seppänen <j...@iki.fi> wrote:

> Ryan May <rma...@gmail.com> writes:
>
> > On Mon, Feb 9, 2009 at 2:37 PM, A B <python6...@gmail.com> wrote:
> >
> > If you're using the full OO interface and creating a figure by making an
> > 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.)
>
> Yes, in the OO interface there is no close() because matplotlib does not
> retain any references to the figure object. Garbage collection will take
> care of reclaiming memory once the user code has no more references to
> the object either.
>
> That said, there have been cases of memory leaks caused by circular
> references among objects that have __del__ methods. I think all known
> leaks have been fixed, but if I were deploying a long-lived application
> that creates lots of figures, I would definitely want to watch its
> memory usage in my exact use case.
>
> --
> Jouni K. Seppänen
> http://www.iki.fi/jks
>

Thank you. The reason I asked the question was that with the OO interface, I
still observed growth in memory consumption (more than I saw after I added
pyplot.close() calls). However, at some point (90M which I still think is a
lot) the growth tapered off and eventually seemed to have stopped.
Essentially, what I do is create a figure, then call plot() on it in a loop
to generate multiple curves, then print_png() on the canvas object.
------------------------------------------------------------------------------
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