On Sun, Nov 11, 2012 at 4:23 PM, Benjamin Root <ben.root@...> wrote:
> On Thursday, November 8, 2012, Carl Michal wrote:
>> I noticed that a program I had that uses canvas.blit() to do animated
>> with the gtkagg backend was leaking memory.
>> I tracked this down to gtk gc's being allocated in agg_to_gtk_drawable
>> gdk_gc_new(), but never being destroyed.
>> The leak can be seen using the 'Animating selected plot elements' example
>> (if it is modified to run forever, rather than just 50 plots and also
>> changing numerix to numpy). After a few minutes, it is clear from ps that
>> memory usage is slowly but steadily climbing.
>> Patch below (against matplotlib-1.1.1.) fixes it.
>> --- _gtkagg.cpp~ 2012-06-30 12:37:00.000000000 -0700
>> +++ _gtkagg.cpp 2012-11-08 14:30:23.000000000 -0800
>> @@ -121,6 +121,7 @@
>> + gdk_gc_destroy(gc);
>> if (needfree)
>> delete  destbuffer;
> If you are willing, would you like to file a PR against the v1.2.x branch?
> Ben Root
Decided to follow-up on this and it looks like this patch has already
Institute for Computational Engineering Sciences
201 E. 24th St.
The University of Texas at Austin
Austin, TX 78712-1229