[PyQt] Attempting to reduce the memory footprint of my PyQt5 application
Florian Bruhin
me at the-compiler.org
Thu Sep 8 11:08:23 BST 2016
* oliver <oliver.schoenborn at gmail.com> [2016-09-08 00:26:03 -0400]:
> 2. consider using Python slots (unrelated to Qt slots) for large numbers
> of objects stored in lists
Note this only helps when you actually have *a lot* of equal,
immutable objects, like here:
http://tech.oyster.com/save-ram-with-python-slots/
I wouldn't recommend it as a general thing, as it definitely makes
code less maintainable.
> All that being said, you should probably dig deeper into into all of the
> above only when you determine you have a memory leak or are using gigs more
> memory than necessary.
Right - I think the most important thing - before blindly trying to
fix things - is to measure, not guess.
There are various memory profilers for Python, I usually use Pympler:
http://pythonhosted.org/Pympler/
Maybe also try playing with a C++ memory profiler (like valgrind):
http://valgrind.org/
Though I had mixed success with that, and it's *really* slow.
Florian
--
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20160908/28933fdd/attachment.sig>
More information about the PyQt
mailing list