Hi,
We have an in-house developed Python application using wxPython (running on Windows). When launching our application, memory usage according to TaskManager is around 35MB. When opening the GUI, memory increases to around 50MB. When closing the GUI window, nothing changes. When minimizing the GUI however, the memory usage drops to around 3MB! Can anyone explain this? If there anything we can change so TaskManager will report a lower amount of memory usage when our application is in the tray?
Kind regards,
Dreas van Donselaar
Hi Dreas,
We have an in-house developed Python application using wxPython (running
on Windows). When launching our application, memory usage according to
TaskManager is around 35MB. When opening the GUI, memory increases to
around 50MB. When closing the GUI window, nothing changes. When
minimizing the GUI however, the memory usage drops to around 3MB! Can
anyone explain this? If there anything we can change so TaskManager will
report a lower amount of memory usage when our application is in the tray?
I won't trust Task Manager up to this point: all the Windows
applications behave in this way: run it, you get 18 MB; iconize it,
you get 3.5 MB; maximize it again, you get 7 MB. I am not an expert in
this things, but you may want to take a look here:
I don't know why Task Manager is designed in this way, but it would be
nice to have a tool that shows you the real RAM usage whether the app
is iconized or not (which shouldn't even matter).
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/
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,
Dreas van Donselaar
Andrea Gavana wrote:
···
Hi Dreas,
We have an in-house developed Python application using wxPython (running
on Windows). When launching our application, memory usage according to
TaskManager is around 35MB. When opening the GUI, memory increases to
around 50MB. When closing the GUI window, nothing changes. When
minimizing the GUI however, the memory usage drops to around 3MB! Can
anyone explain this? If there anything we can change so TaskManager will
report a lower amount of memory usage when our application is in the tray?
I won't trust Task Manager up to this point: all the Windows
applications behave in this way: run it, you get 18 MB; iconize it,
you get 3.5 MB; maximize it again, you get 7 MB. I am not an expert in
this things, but you may want to take a look here:
Data Access Worldwide - Knowledge Base
I don't know why Task Manager is designed in this way, but it would be
nice to have a tool that shows you the real RAM usage whether the app
is iconized or not (which shouldn't even matter).
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
Hi Andrea,
Andrea Gavana wrote:
Hi Dreas,
We have an in-house developed Python application using wxPython (running
on Windows). When launching our application, memory usage according to
TaskManager is around 35MB. When opening the GUI, memory increases to
around 50MB. When closing the GUI window, nothing changes. When
minimizing the GUI however, the memory usage drops to around 3MB! Can
anyone explain this? If there anything we can change so TaskManager will
report a lower amount of memory usage when our application is in the tray?
I won't trust Task Manager up to this point: all the Windows
applications behave in this way: run it, you get 18 MB; iconize it,
you get 3.5 MB; maximize it again, you get 7 MB. I am not an expert in
this things, but you may want to take a look here:
Data Access Worldwide - Knowledge Base
I don't know why Task Manager is designed in this way, but it would be
nice to have a tool that shows you the real RAM usage whether the app
is iconized or not (which shouldn't even matter).
I recently discovered Process Explorer from SysInternals (now ownded by MS: http://www.microsoft.com/technet/sysinternals/default.mspx but still free of charge, there other tools available from that site but have not tried them) which gives more information, i.e. which dll is used by a process and one can configure it as a Task Manager replacement.
Are the mem usage reports more accurate, I don't know. But a task iconized which does not do anything, should in my view have a lower memory usage - as it is probably/should be swapped to virtual memory (disk).
I have also noticed that calling python garbage collection does have some influence.
My app uses on startup around 35MB "Working Set" and "Virtual Size" is up around 90MB+, if a minimize it I see 5 - 6 MB etc etc, TaskManager would keep reporting something around the 35MB and I could not see which ".pyd" or ".dll" file are in use.
Werner
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.
···
On 2/2/07, Dreas van Donselaar <dreas@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,
Hi Werner,
Are the mem usage reports more accurate, I don't know. But a task
iconized which does not do anything, should in my view have a lower
memory usage - as it is probably/should be swapped to virtual memory (disk).
Uhm, I thought that if you load data into your app, the data is still
there, whether the app is iconized or not. I mean, if I load a 100 MB
text file into self.myTextFile, does it get somewhat hidden if I
iconize my GUI?
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/
···
On 2/2/07, Werner F. Bruhin wrote:
Hi Andrea,
Andrea Gavana wrote:
Hi Werner,
Are the mem usage reports more accurate, I don't know. But a task
iconized which does not do anything, should in my view have a lower
memory usage - as it is probably/should be swapped to virtual memory (disk).
Uhm, I thought that if you load data into your app, the data is still
there, whether the app is iconized or not. I mean, if I load a 100 MB
text file into self.myTextFile, does it get somewhat hidden if I
iconize my GUI?
I am no expert, so take this with a grain of salt.
I guess that the 100MB is still used in the virtual size, but the space or at least some of it is released from RAM (Working Set).
Werner
···
On 2/2/07, Werner F. Bruhin wrote: