From: M. Soyka on
In working on a Tk application, I noticed the following memory
allocation pattern in Tk running under Windows XP.

Choose your favorite Tk application, Tk Demo will do. Start the Task
Manager and display the "Mem Usage" column in the "Processes" tab. Now
start the app.

On my systems, Tk Demo allocates ~8 MB of memory.

Next, minimize the app using the left-most button in the window frame.
On my systems, the memory allocation is reduced to about 700 KB.

Then bring back the app to the main screen (click the button on the task
bar). The memory allocation increases to about 2 MB.

So, all I've done is "iconize" and deiconize the app and somehow 6 MB of
memory have been dropped.

I see this asme pattern in Tk versions 8.3, 8.4, and 8.5.

If I programatically emulate this using "wm iconify/withdraw" and "wm
deiconify", the initial memory allocation remains unchanged.

Doing the same manual sequence under linux with GNOME and using "top",
memory allocation does not change significantly.

Other apps I've tried that initially allocate more substantial memory
(140 MB), can see their allocation significantly reduced (to ~50 MB)
using the above sequence of steps.

Since I don't see the same behavior under linux, I conclude this is a
Windows issue.

Any comments?

Mike
From: APN on
What Task Manager calls "Mem usage" is actually the working set for
the process, not the actual allocated memory in use.

/Ashok

On Aug 13, 6:52 am, "M. Soyka" <mssr...(a)gmail.com> wrote:
> In working on a Tk application, I noticed the following memory
> allocation pattern in Tk running under Windows XP.
From: Donal K. Fellows on
On 13 Aug, 06:44, APN <palm...(a)yahoo.com> wrote:
> What Task Manager calls "Mem usage" is actually the working set for
> the process, not the actual allocated memory in use.

The "VM Usage" column (not enabled by default) is more useful as
that's what's allocated by the OS, and not the physical memory
currently used.

Donal.
From: Melissa Schrumpf on
"M. Soyka" <mssr953(a)gmail.com> wrote:

> In working on a Tk application, I noticed the following memory
> allocation pattern in Tk running under Windows XP.
>
> Choose your favorite Tk application, Tk Demo will do. Start the Task
> Manager and display the "Mem Usage" column in the "Processes" tab. Now
> start the app.

As others have stated, use "VM Usage" instead.


> I see this asme pattern in Tk versions 8.3, 8.4, and 8.5.

You'll likely see it with natively compiled applications as well. I
have.


> If I programatically emulate this using "wm iconify/withdraw" and "wm
> deiconify", the initial memory allocation remains unchanged.

I ran into this issue with a completely separate application (C++ WinAPI
native) a while back. ISTR that the memory usage didn't even drop when
using SendEvent() to mimic the manual clicking, either. It required
actual mouse events to drop the usage.

Welcome to Windows. Miserable memory management since 1.0, and
counting.

--
MKS