AuiPaneInfo memory leak

Is there a known problem with memory leaks involving AuiPaneInfo?

I'm new to a large app written in Python (2.7.2+) using wxPython (2.8.12.1 (gtk2-unicode))
running on Ubuntu 11.10, and I've been asked to look into a memory leak.

Using objgraph.show_growth() (http://mg.pov.lt/objgraph/) I've determined that approximately
1500 new AuiPaneInfo objects are instantiated per minute. This happens when the app is
doing next to nothing, with no UI activity. The app may be responding now and then to a
message from a server, but, again, there is no UI activity.

I have not been able to create a small program demonstrating the problem, nor have I been
able to find out much more about the leak with objgraph.

I built a debug version of wxWidgets and wxPython and using gdb put break points on
_wrap_new_AuiPaneInfo and other places where it seemed that instantiation of an AuiPaneInfo
object would happen. The breakpoints were never encountered.

Any information or suggestions will be appreciated.

Roger House

Hi,

Is there a known problem with memory leaks involving AuiPaneInfo?

I'm new to a large app written in Python (2.7.2+) using wxPython (2.8.12.1
(gtk2-unicode))
running on Ubuntu 11.10, and I've been asked to look into a memory leak.

Using objgraph.show_growth() (Python Object Graphs — objgraph 3.6.2 documentation) I've determined
that approximately
1500 new AuiPaneInfo objects are instantiated per minute. This happens when
the app is
doing next to nothing, with no UI activity. The app may be responding now
and then to a
message from a server, but, again, there is no UI activity.

I have not been able to create a small program demonstrating the problem,
nor have I been
able to find out much more about the leak with objgraph.

I built a debug version of wxWidgets and wxPython and using gdb put break
points on
_wrap_new_AuiPaneInfo and other places where it seemed that instantiation of
an AuiPaneInfo
object would happen. The breakpoints were never encountered.

Any information or suggestions will be appreciated.

As far as I remember, there shouldn't be any creation of AuiPaneInfo
things unless there is a specific reason for wxAUI to call
AuiManager.Update(). This could be triggered if you are Freeze()-ing
and Thaw()-ing your GUI, or needlessly refreshing/resizing it, or
loading perspectives, or docking/floating panes.

It appears your interface is already well set-up to use wxAUI and it
is relatively big (in terms of number of lines of code), so I won't
tell you to try and switch to wx.lib.agw.aui (although this will allow
you to easily spot the problem, if it's still there).

Other than that, I have no idea :slight_smile:

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On 1 June 2012 21:07, Roger House wrote:

I thought that I read somewhere that on certain platforms Resize
events could be triggered twice. I do not think it was tied
specifically to AUI. Perhaps if some combination of
auimanager.Update() and adding a new infopanel and the Resize events
are being called one after the other you'd be getting an event storm?

Andrea Gavana advised that I switch from wx.aui to wx.lib.agw.aui, and
this
seems to have solved the problem. There is no longer a memory leak.
Now
we testing our UI very carefully to see that is is still doing what it
always did.
So far this seems to be the case. -- A big thank-you to Andrea for
his help.

Roger

···

On Jun 5, 4:34 pm, Dev Player <devpla...@gmail.com> wrote:

I thought that I read somewhere that on certain platforms Resize
events could be triggered twice. I do not think it was tied
specifically to AUI. Perhaps if some combination of
auimanager.Update() and adding a new infopanel and the Resize events
are being called one after the other you'd be getting an event storm?