Memory leak in PyQt application

Daniel Nogradi nogradi at gmail.com
Sun Jul 1 04:00:38 EDT 2007


> Python 2.5.1
> Boost.Python
> Qt 4.2.2
> SIP 4.6
> PyQt 4.2
> WinXp
>
> I've a memory leak in a PyQt application and no idea how to find it. What
> happens in the application ?
>
>  From QWindow a QDialog is called on a button "pressed()" signal, that
> instantiate a QThread and waits for it. If the thread has finished, the
> QDialog
> closes.
>
> I've stipped down everything that nothing more happens (to me obviously).
> Boost.Python is used to wrap a C++ Lib (used in the thread). Every time
> memory
> usage increases for ~70 KB.
>
> Sometimes the application crash on closing QWindow. (QtCore.dll)
>
> - One thing I ask me is weather garbage collection is done in the PyQt main
> loop?
>
> What hints do you have to find the leak?


Have a look at valgrind: http://valgrind.org/

HTH,
Daniel



More information about the Python-list mailing list