[PyQt] Reducing Ram Usage Tips?

stan modifiedbessel at free.fr
Fri Mar 13 14:33:51 GMT 2009


On Fri, 2009-03-13 at 09:37 -0400, Darryl Wallace wrote:
> Hello,
> 
> I've recently developed a data analysis program using PyQt.  It's not a 
> huge program but it's not small either.  I've noticed that, in Windows, 
> the memory usage at startup is ~80MB.  I've removed all of the 'import 
> *'s that I previously had and do not load the Qt module at any location.
> 
> I am packaging the entire library in the exe using py2exe.
> 
> Just wondering if anyone else has had any success bringing down the 
> memory consumption.
> 
> Thanks,
> Darryl
> 
While there are a great number advantages to having a nice single
"huge" .exe, memory consumption is driven up as that entire .exe has to
be loaded in memory at one time, of course.  With the "one directory"
option in PyInstaller or py2exe, the .exe's themselves are quite small
by comparison, so that loading and speed generally are much faster out
of the gate as they make system calls "as needed"; of course memory
usage will then increase "as needed", but in general, memory use seems
to remain much smaller.  Of course, the "initial" distribution directory
is often bigger (a "one timer", usually), but later I have found that
simple updates, bug fixes, etc. don't require many additional dirctory
items (of course this depends on what you later add!), but total
subsequent distribution time is greatly simplified and is limited to the
new .exe and the simple occasional additions.

Did you happen to avoid using the QTCore4.dll and QtGui4.dll? (you
mentioned not having loaded the Qt modules) Can these be avoided in
favor of the PyQt dll's??  Those are very large, but I think they must
be always and unavoidably pulled in by PyQt??

> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
> 



More information about the PyQt mailing list