[wxPython-users] wxPython memory usage

Chris Mellon arkanes at gmail.com
Fri Feb 2 06:32:06 PST 2007


On 2/2/07, Dreas van Donselaar <dreas at emailaccount.nl> wrote:
> Hi Andrea,
>
> Thanks for your quick response. The VM Size is indeed not affected by
> closing/minimizing. It shows 40MB though which seems to be quite a lot.
> I guess we have to optimize our code somehow. Or are there "general
> tricks" to lower this? Is 40MB common for a Python/wxPython app?
>
> Kind regards,
>

It's not that unusual. Beware of placing too much emphasis even on the
VM value - that is the amount of your virtual address space that is
allocated. So ever DLL that is loaded (a great many, in most Windows
apps) takes up a certain amount of that space, even though they're
just memory mapped from disk and there's little actual ram taken up.
Memory mapping files will also consume VM space, even though little of
the space is actually committed.

One easy thing you can avoid doing is "from wxPython import *". This
maps the entire wxPython namespace into the local namespace, creating
3400+ Python objects in the process.




More information about the wxpython-users mailing list