[PyQt] weakref, memory management and execution slow down in PyQt4

kjs bfb at riseup.net
Sun Sep 7 21:47:17 BST 2014

Hi all,

I built a small application using PyQt4 and pyqtgraph to visualize some
data. The app has 32 graphs that plot deques of size 10,000. The plots
are updated when 5,000 ints are cycled through each deque.

I also tried invoking objgraph.show_most_common_types(). This test
reveals that the number of objects being created plateaus, except for
weakref objects, which keep growing and growing. Additionally, when I
comment out the calls to plot() and processEvents()[0,1], the weakref
proliferation stops. All objects are created and destroyed with balance.

I have come to believe that the growing number of weakrefs is slowing
down execution.

I do not doubt that I could be using PyQt4 incorrectly. Can anyone
recommend a solution or perhaps some more tests?

Thanks much,

[1] Lines 112-114
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0x8A61431E.asc
Type: application/pgp-keys
Size: 11239 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140907/a5ab15b0/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140907/a5ab15b0/attachment.sig>

More information about the PyQt mailing list