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


Groups > comp.lang.python > #77669

weakref, memory management and execution slow down in PyQt4

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!news.unit0.net!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.87.MISMATCH!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <bfb@riseup.net>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.152
X-Spam-Level *
X-Spam-Evidence '*H*': 0.70; '*S*': 0.00; 'received:198': 0.07; 'linear': 0.09; 'objects,': 0.09; 'attributed': 0.16; 'filename:fname piece:signature': 0.16; 'invoking': 0.16; 'subject:slow': 0.16; 'thanks,': 0.17; 'app': 0.19; 'received:10.0.1': 0.19; 'memory': 0.22; 'tried': 0.27; 'points': 0.29; 'words': 0.29; 'kevin': 0.30; 'further?': 0.31; 'updated': 0.34; 'created': 0.35; 'except': 0.35; 'objects': 0.35; 'test': 0.35; 'there': 0.35; 'done': 0.36; 'next': 0.36; 'received:10.0': 0.36; 'application': 0.37; 'received:10': 0.37; 'clear': 0.37; 'being': 0.38; 'growing': 0.38; 'to:addr:python-list': 0.38; 'little': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'skip:o 30': 0.61; 'between': 0.67; 'believe': 0.68; 'watching': 0.68; 'respect': 0.70; 'manner': 0.72; 'analysis': 0.75; '100,000': 0.84; 'cycled': 0.84; 'execution.': 0.84; 'growing.': 0.84; 'leak.': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1410072154; bh=J7hLpUYO+1+iH+e9zohWz/lrYyod0EINwBRJhmqAU5Y=; h=Date:From:To:Subject:From; b=CWzYIywMf0N6ud/dVWkDI4UxGtxANQuPrEzyXbqZocDGVRbKen5iyA4nqF6Ol8mFs tO9dg8BDOraYyaP1DwYxLrgSdXnY0wZnjfYfSK9T4VM/iq4fUZ7WOW7VSPNDllizAX /VB8J+TfzaZufDOR9Ki4hKrGvMFhCNdC24+7oko0=
Date Sun, 07 Sep 2014 06:42:11 +0000
From kjs <bfb@riseup.net>
MIME-Version 1.0
To python-list@python.org
Subject weakref, memory management and execution slow down in PyQt4
Content-Type multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="w1mq88SKOkwddoep2g2omRdcaUDcaALcb"
X-Virus-Scanned clamav-milter 0.98.4 at mx1
X-Virus-Status Clean
X-Mailman-Approved-At Sun, 07 Sep 2014 10:21:23 +0200
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.13846.1410078084.18130.python-list@python.org> (permalink)
Lines 241
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1410078084 news.xs4all.nl 2967 [2001:888:2000:d::a6]:33923
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:77669

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

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

The plotting slows down in a linear manner with respect to time. In
other words after cycling through 100,000 data points the time between
calls to process events is much longer than it was at T0.

I have done a little memory profiling. Watching the process on top, it's
clear that there is some memory leak. 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.

I have come to believe that the growing number of weakrefs is slowing
down execution. Is my analysis misguided? How can I introspect further?
If the slowdown can be attributed to weakref escalation, what are some
next steps?

Thanks,
Kevin

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

weakref, memory management and execution slow down in PyQt4 kjs <bfb@riseup.net> - 2014-09-07 06:42 +0000

csiph-web