Questions and problems: 1/ when I load the image the first
> time (first imshow command in the script), I see that,
> although the amount of data is very small,
> ipython/matplotlib already uses more than 40 Mb of memory!
> Is that normal?
It seems high, but looks inline with the size of the mpl extension
code (though some of which is redunant numpy/numeric/numarray extensions
that shouldn't all be loaded)
peds-pc311:~/mpl/build> du -h
> 2/ When I now use the mouse_move event, it can go up to 150
> Mb of memory usage!! Again: is that normal?
In your example code below, I notice you are drawing on every mouse
motion. I believe there is a Tkinter specific leak in TkAgg if memory
serves, but it's outside of mpl. What backend are you using? Does
the problem go away with a different backend?
If there is a leak under our control we will certainly find it an fix
it to the best of our abilities. Our canonical memory leak checking
script (which does an imshow and more) is running rock solid on the
Agg backend so if there is a leak it is probably backend specific.
I noticed in your example script that you are only modifiying a text
entry on mouse motion. Your performance will dramatically improve if
you use the blitting techniques described in the animation tutorial.
The basic idea is to capture the background as a pixel buffer,
identify the rectangle region you want to draw the text into, draw the
background, update the text, redraw only the text rectangle etc....
After you've read through this if you get stuck let me know and I'll
put together a small demo for you.