Re: [Matplotlib-users] Memory leak; user error or bug?

2010-12-13 Thread Russell Owen
I just tried calling subplot.clear() just before calling  
canvas.draw(). Interestingly enough it increases the memory leak rate  
by roughly 50%!


By the way, the minimal script is available here if you want to try it:



I would be interested to see your code if it is available. What back  
end are you using?


Regards,

-- Russell

On Dec 12, 2010, at 8:08 AM, Friedrich Romstedt wrote:


2010/12/12 Russell Owen :
Simply creating a blank Axes and calling canvas.draw() leaks memory  
-- even without displaying any data or shifting the x axes.


Okay, as a workaround have you tried ax.clear()?

So the example script provided by you can be boiled down further?

I'm using ax.clear() in a layered approach very extensively and have
never noticed memory leaks with this.  I'm having a Layer object which
can be fed by data, and when the data changes, it automatically will
trigger an ax.clear() in the host stack, and then everything is
redrawn.  Not the fastest, but fast enough.

Friedrich


--
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Memory leak; user error or bug?

2010-12-12 Thread Russell Owen
I've boiled it down to nearly nothing as a script attached to this bug report:

it simply creates an Axis and then regularly shifts the x axis limits and calls 
canvas.draw() to display the change. (It also reports memory usage.) You can 
further simplify the script by commenting out the limes that alter the x axis 
limits, but then the display does not change (though matplotlib still leaks 
memory as long as canvas.draw is still called).

I will try ax.clear(). Thanks.

-- Russell

On Dec 12, 2010, at 8:08 AM, Friedrich Romstedt wrote:

> 2010/12/12 Russell Owen :
>> Simply creating a blank Axes and calling canvas.draw() leaks memory -- even 
>> without displaying any data or shifting the x axes.
> 
> Okay, as a workaround have you tried ax.clear()?
> 
> So the example script provided by you can be boiled down further?
> 
> I'm using ax.clear() in a layered approach very extensively and have
> never noticed memory leaks with this.  I'm having a Layer object which
> can be fed by data, and when the data changes, it automatically will
> trigger an ax.clear() in the host stack, and then everything is
> redrawn.  Not the fastest, but fast enough.
> 
> Friedrich


--
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages, 
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Memory leak; user error or bug?

2010-12-12 Thread Friedrich Romstedt
2010/12/12 Russell Owen :
> Simply creating a blank Axes and calling canvas.draw() leaks memory -- even 
> without displaying any data or shifting the x axes.

Okay, as a workaround have you tried ax.clear()?

So the example script provided by you can be boiled down further?

I'm using ax.clear() in a layered approach very extensively and have
never noticed memory leaks with this.  I'm having a Layer object which
can be fed by data, and when the data changes, it automatically will
trigger an ax.clear() in the host stack, and then everything is
redrawn.  Not the fastest, but fast enough.

Friedrich

--
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages, 
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Memory leak; user error or bug?

2010-12-11 Thread Russell Owen
I am sort of adding data points; what I'm really doing is appending data to a 
python list and setting the data in the Line object to that list. The list gets 
shortened every once in awhile to keep the amount of data from getting too 
large.

It turns out the leak is in canvas.draw(), which I call whenever I shift the 
graph in time (by changing the limits on the x axis); if I don't call 
canvas.draw() the time shift is not displayed. Simply creating a blank Axes and 
calling canvas.draw() leaks memory -- even without displaying any data or 
shifting the x axes.

Regards,

-- Russell

On Dec 11, 2010, at 1:32 PM, Friedrich Romstedt wrote:

> 2010/12/1 Russell E. Owen :
>> I'm seeing a nasty memory leak in my strip chart widget using matplotlib
>> 1.0, TkAgg and Mac OS X 10.5
>> 
>> I've posted a minimal version here:
>> > py>
>> 
>> It doesn't seem to matter if I use the animation API or not (the example
>> does not).
>> 
>> Any ideas?
> 
> Hmm, you're adding points right?  I remember one time I had a similar
> timeline updating each second or so, and after 10 hr it took memory of
> the order of Gigabytes (iirc) ... and it took seconds to refresh the
> plot ... took me some time to figure it out that the plotting was the
> culprit ...
> 
> hth, fwiw,
> Friedrich


--
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages, 
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Memory leak; user error or bug?

2010-12-11 Thread Friedrich Romstedt
2010/12/1 Russell E. Owen :
> I'm seeing a nasty memory leak in my strip chart widget using matplotlib
> 1.0, TkAgg and Mac OS X 10.5
>
> I've posted a minimal version here:
>  py>
>
> It doesn't seem to matter if I use the animation API or not (the example
> does not).
>
> Any ideas?

Hmm, you're adding points right?  I remember one time I had a similar
timeline updating each second or so, and after 10 hr it took memory of
the order of Gigabytes (iirc) ... and it took seconds to refresh the
plot ... took me some time to figure it out that the plotting was the
culprit ...

hth, fwiw,
Friedrich

--
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages, 
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Memory leak; user error or bug?

2010-12-01 Thread Daniel Hyams
23 MB RPRVT @ 7:52 PM
40 MB RPRVT @ 8:07 PM

matplotlib 1.0.0
OSX 10.6.5
python.org python, 2.6.6


On Wed, Dec 1, 2010 at 6:53 PM, Russell E. Owen  wrote:

> In article <4cf69ba4.1000...@stsci.edu>,
>  Michael Droettboom 
>  wrote:
>
> > On 12/01/2010 01:40 PM, Russell E. Owen wrote:
> > > I'm seeing a nasty memory leak in my strip chart widget using
> matplotlib
> > > 1.0, TkAgg and Mac OS X 10.5
> > >
> > > I've posted a minimal version here:
> > > <
> http://www.astro.washington.edu/users/rowen/python/MinimalStripChartWdg.
> > > py>
> > >
> > > It doesn't seem to matter if I use the animation API or not (the
> example
> > > does not).
> > >
> > > Any ideas? If this is a bug I'll report it, but I hope I'm just doing
> > > something wrong.
> > I don't have a Mac to try this on -- however, I don't see the leak on
> > Fedora 14/Python 2.7/Numpy 1.5.1/Tkinter with both matplotlib 1.0 and
> > matplotlib SVN head.  That may narrow it down to something Mac OS
> > X-specific.  Sorry that's not totally helpful, but it's a data point.
>
> Thank you; that is very helpful. Unfortunately that suggests it is
> Mac-specific or Tcl/Tk-version-specific which could make it hard to
> track down. I'll report it as a bug in any case.
>
> -- Russell
>
>
>
> --
> Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
> Tap into the largest installed PC base & get more eyes on your game by
> optimizing for Intel(R) Graphics Technology. Get started today with the
> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
> http://p.sf.net/sfu/intelisp-dev2dev
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>



-- 
Daniel Hyams
dhy...@gmail.com
--
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Memory leak; user error or bug?

2010-12-01 Thread Russell E. Owen
In article <4cf69ba4.1000...@stsci.edu>,
 Michael Droettboom  
 wrote:

> On 12/01/2010 01:40 PM, Russell E. Owen wrote:
> > I'm seeing a nasty memory leak in my strip chart widget using matplotlib
> > 1.0, TkAgg and Mac OS X 10.5
> >
> > I've posted a minimal version here:
> >  > py>
> >
> > It doesn't seem to matter if I use the animation API or not (the example
> > does not).
> >
> > Any ideas? If this is a bug I'll report it, but I hope I'm just doing
> > something wrong.
> I don't have a Mac to try this on -- however, I don't see the leak on 
> Fedora 14/Python 2.7/Numpy 1.5.1/Tkinter with both matplotlib 1.0 and 
> matplotlib SVN head.  That may narrow it down to something Mac OS 
> X-specific.  Sorry that's not totally helpful, but it's a data point.

Thank you; that is very helpful. Unfortunately that suggests it is 
Mac-specific or Tcl/Tk-version-specific which could make it hard to 
track down. I'll report it as a bug in any case.

-- Russell


--
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Memory leak; user error or bug?

2010-12-01 Thread Michael Droettboom
On 12/01/2010 01:40 PM, Russell E. Owen wrote:
> I'm seeing a nasty memory leak in my strip chart widget using matplotlib
> 1.0, TkAgg and Mac OS X 10.5
>
> I've posted a minimal version here:
>  py>
>
> It doesn't seem to matter if I use the animation API or not (the example
> does not).
>
> Any ideas? If this is a bug I'll report it, but I hope I'm just doing
> something wrong.
I don't have a Mac to try this on -- however, I don't see the leak on 
Fedora 14/Python 2.7/Numpy 1.5.1/Tkinter with both matplotlib 1.0 and 
matplotlib SVN head.  That may narrow it down to something Mac OS 
X-specific.  Sorry that's not totally helpful, but it's a data point.

Mike

--
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Memory leak; user error or bug?

2010-12-01 Thread Russell E. Owen
I'm seeing a nasty memory leak in my strip chart widget using matplotlib 
1.0, TkAgg and Mac OS X 10.5

I've posted a minimal version here:


It doesn't seem to matter if I use the animation API or not (the example 
does not).

Any ideas? If this is a bug I'll report it, but I hope I'm just doing 
something wrong.

-- Russell


--
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users