Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #77684 > unrolled thread

Re: weakref, memory management and execution slow down in PyQt4

Started byMichael Torrie <torriem@gmail.com>
First post2014-09-07 13:26 -0600
Last post2014-09-07 13:26 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: weakref, memory management and execution slow down in PyQt4 Michael Torrie <torriem@gmail.com> - 2014-09-07 13:26 -0600

#77684 — Re: weakref, memory management and execution slow down in PyQt4

FromMichael Torrie <torriem@gmail.com>
Date2014-09-07 13:26 -0600
SubjectRe: weakref, memory management and execution slow down in PyQt4
Message-ID<mailman.13853.1410117997.18130.python-list@python.org>
On 09/07/2014 01:11 PM, kjs wrote:
> Thanks for the advice. I commented out the graph generation and PyQt call
> 
>>>> self.app.processEvents()
> 
> where in the class __init__
> 
>>>> self.app = QtGui.QApplication(sys.argv)
> 
> This stopped the weakref proliferation. All other objects grow and
> shrink in number as expected.

Can you make an absolute minimal example with no widgets save the graph
itself?  You could then go to the PyQt folks with that.  Could be a bug,
or could be an improper use of something by your code.  This is one of
the problems with using Qt in other languages: it's not a perfect fit
for Python's object model as it is C++-based.  So you have to think like
a C++ programmer, and you might have to manage some resources manually,
unlike normal Python objects which for the most part take care of
themselves.

Also you could try a minimal example using PySide instead of PyQt and
see if that also manifests the leak.  If so, then the problem could be
in Qt itself.  Though I suspect the problem is some kind of impedance
mismatch between C++ and Python.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web