Re: [Matplotlib-users] Memory leaks in a web application

2009-02-10 Thread A B
On Mon, Feb 9, 2009 at 9:59 PM, Jouni K. Seppänen wrote: > Ryan May writes: > > > On Mon, Feb 9, 2009 at 2:37 PM, A B 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 s

Re: [Matplotlib-users] Memory leaks in a web application

2009-02-10 Thread John Hunter
On Tue, Feb 10, 2009 at 7:55 AM, Gerry Steele wrote: > Thanks Michael , > > I had somehow put myself under the impression i was using he OO > version of the api but it is much more clear now. Memory issues now > look better. There is room for confusion. A common usage pattern, one I often use my

Re: [Matplotlib-users] Memory leaks in a web application

2009-02-10 Thread Gerry Steele
Thanks Michael , I had somehow put myself under the impression i was using he OO version of the api but it is much more clear now. Memory issues now look better. Thanks. 2009/2/10 Michael Droettboom : > This is an instance of the OP's problem again. Your example is using the > pyplot (i.e. Matl

Re: [Matplotlib-users] Memory leaks in a web application

2009-02-10 Thread Michael Droettboom
This is an instance of the OP's problem again. Your example is using the pyplot (i.e. Matlab-like) interface, in which case, you must explicitly close each figure when you're done with it, like follows: plt.close(fig) "del fig" only deletes your local reference to the figure. There is sti

Re: [Matplotlib-users] Memory leaks in a web application

2009-02-10 Thread Gerry Steele
>> 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

Re: [Matplotlib-users] Memory leaks in a web application

2009-02-09 Thread Jouni K . Seppänen
Ryan May writes: > On Mon, Feb 9, 2009 at 2:37 PM, A B 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.

Re: [Matplotlib-users] Memory leaks in a web application

2009-02-09 Thread Ryan May
On Mon, Feb 9, 2009 at 2:37 PM, A B wrote: > Thank you very much, Jouni. Pyplot.close() seems to have done the > trick. I followed your advice and converted my code to use the OO > interface. But I'm not sure how I close the figure in OO ... Any > pointers? Thanks. If you're using the full OO i

Re: [Matplotlib-users] Memory leaks in a web application

2009-02-09 Thread A B
Thank you very much, Jouni. Pyplot.close() seems to have done the trick. I followed your advice and converted my code to use the OO interface. But I'm not sure how I close the figure in OO ... Any pointers? Thanks. -- Crea

Re: [Matplotlib-users] Memory leaks in a web application

2009-02-08 Thread Jouni K . Seppänen
A B writes: >f = pyplot.figure() When you do this, matplotlib retains a reference to the figure until you close it so that you can go back to it with e.g. figure(4). So add pyplot.close(f) to your script. Or, even better, use the object-oriented API. To get started with that, see http://mat

[Matplotlib-users] Memory leaks in a web application

2009-02-08 Thread A B
Hi, Following is my post to the Django mailing list from yesterday. The response was that Django isn't known to leak memory so there should be something off with matplotlib or rather that way I am using it. Hopefully someone here could comment on what could be causing the leaks. Thanks in advance.