wxPython (and Matplotlib) Strangeness

Hello NG,

    in my application (that is reaching 50,000 lines of code at the moment)
I use wxPython, matplotlib and other useful resources. I am having 2 strange
behaviors, one related to matplotlib and the other to wxPython.

1) wxPython Problem

When my app starts, it loads a bunch of modules and creates a main wx.Notebook,
with a lot of buttons, grid and textctrls and so on. When it starts, a wx.Gauge
+ a Splashscreen inform the user on the loading progress (usually it takes
5-6 seconds) and at the end the main frame is shown and maximized.
Well, I have launched the Windows Task Manager to monitor the RAM consuption.
This is what happens:

a) Loading and showing everything increase the RAM usage to 70 MB (!!!)
b) If I minimize the main frame the RAM drops down to 4 MB AND;
c) By re-maximizing the main frame the RAM goes to 7 MB.

Now, if I do some interaction with the wxThings in all the tabs in the wx.Notebook,
the RAM keeps increasing. If at a certain point I minimize the main frame
the RAM goes back to 4 MB and re-maximizing it raises the RAM to 8 MB.

Question: what is going on? Is there something (probably easy) that I am
not aware of on Windows machines? Why the minimize/maximize actions have
this effect? Is there a way to reproduce the effect of minimize/maximize
with actually doing it? May it be a memory leaking problem somewhere?

2) Matplotlib problem

In the same app, I have a wx.Grid in which, by clicking with the right mouse
button, a row is selected and a popup menu appears. By choosing the right
item on this submenu, a frame with a Matplotlib figure (and other small
things) is created. Then I close the frame and I redo the same action. Every
time I do this action, it seems that Matplotlib is sucking 4 MB of RAM,
that does not decrease after I have closed the Matplotlib frame.
At a certain point, my app goes over 150 MB of RAM only by having opened/closed
some Matplotlib figures. The only solution I found is still to minimize/maximize
the main GUI frame (as in Problem 1).

Question: why the RAM consumption does not decrease when I close the Matplotlib
frame? Shouldn't be the gc that takes care of doing such action?

Thank you *a lot* for every suggestion, comment, opinion.
Sorry for the long post.