Memory leaks in a web application

A B <python6009@...287...> 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://matplotlib.sourceforge.net/leftwich_tut.txt

···

--
Jouni K. Sepp�nen
http://www.iki.fi/jks

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 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.)

Ryan

···

On Mon, Feb 9, 2009 at 2:37 PM, A B <python6009@…287…> 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.


Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma