| Newsgroups |
gmane.comp.video.gimp.windows.devel |
| Message-ID |
<[email protected]> |
--- In [email protected], Tor Lillqvist <tml@i...> wrote:
> Harring Figueiredo writes:
> > Do you know why the momory goes up to 80 MB and then goes back
down ? (Bill
> > also reported the same problem.)
>
> Well, there *used* to be a "non-permanent" leak kinda like that in
> GDK/Win32, present at least in the previous binary build. The test
> program that demonstrated it kept growing, and then if you minimized
> it, its size shrank dramatically, and started growing slowly again if
> unminimized. But that leak definitely should be gone in the
> 2.0.9-20021201 build. There can of course be something similar still
> present, or in the backend-independent parts even.
>
> --tml
Hi,
Please be aware of two things that would cause the symptoms you describe:
1) "Mem Usage" in Task Manager reflects only the -physical- memory
currently used by a process. Any memory that is swapped out will not
be reflected by this value.
This description is well-hidden within the Task Manager help file:
Memory Usage - In Task Manager, the current working set of a process,
in kilobytes. The current working set is the number of pages currently
resident in memory.
2) When a program is minimized (please pardon the vagueness of a
"program" being "minimized", i don't understand this in depth),
Windows 2000 appears to swap out much (in some cases most) of that
process's memory. This makes the "Mem Usage" in Task Manager, which
reflects only physical memory usage, drop accordingly.
The memory is only swapped back in as it is used again by the process
(not all at once, only pages at a time as they are needed). In many
cases none of the swapped out memory is needed again until a program
is restored, at which time you will see the Mem Usage in Task Manager
start to rise again. But it can only rise until all of the pages are
back in physical memory, at which point it again reflects the actual
total of mallocs and such.
You can see this effect by minimizing almost any program and watching
its info in Task Manager. Mem Usage drops when minimized, then when
restored and/or the memory is accessed again, you'll see Mem Usage
rise again and the Page Faults count (optional column in Task Manager,
View->Select Columns) rise as well. Each page fault represents a page
of virtual memory that was requested but not currently in physical
memory, causing Windows to have to swap it back in.
I haven't found this documented anywhere but it explains what I've
observed. One time I couldn't figure out why a plain win32 program I
was writing lost so much memory when minimized (I knew I didn't free
anything), then suddenly seemed to leak so badly after I restored it
again. I noticed its usage stopped rising once it hit the original
amount from before I minimized it, and that the rate of increase
seemed to match the rate at which i accessed memory again (I was lucky
there was a time dependent portion of my program).
Hope this can clear up some confusion.
Rich