Re: Memory management terminology




adebaene@xxxxxxxxxxxxxxxx wrote:
better_cs_now@xxxxxxxxx a écrit :

OK, thanks for the info!

We've got a process whose image size grows in an unbounded manner. This
process makes extremely heavy use of the heap. We've ruled out a memory
leak, and let's assume that heap fragmentation is not the problem. I'm
wondering if the problem could be along the line of unused pages
remaining in our address space. Is this a possibility under Windows XP?

What do you call "image size" exactly? They're several counters that
relates to a process memory usage (all of them can be accessed through
perfmon) :

- Private bytes. If this one grows unbounded, then you definitely have
a memory leak.

- Virtual bytes. This is the most generic one, taking into account both
reserved and commited memory, swapped or not on disk, so there is not
much you can say if this one grows wthout bounds

- Working set (the physical RAM used by your process) is mostly
unrelated to your process memory consumption, since it may vary a lot
depending on memory pressure from other processes.

- Handle Count : While not directly a memory leak, a handle leak may
explain that your memory consumption go ballistic.

Arnaud
MVP - VC

Well, it is indeed "private bytes" that we're measuring. Could that not
also be indicative of heap fragmentation? All of our heap objects are
wrapped in Boost smart pointers, so a memory leak seems unlikely. We've
looked high and low for one and just can't find one.

Our use of the heap is extremely intensive. Over a run of several days,
we perform billions of allocations / deallocations, and the allocations
vary widely in size. So, our primary suspicion is heap fragmentation. I
believe unbounded growth in "private bytes" could also be indicative of
fragmentation.

Integrating with a demo version of Smartheap produced the following
result: Memory would still grow very large (as indicated by a running
log of "private bytes" generated by perfmon), but it would drop
precipitously as soon as I performed any kind of a gesture in any
application. This sudden drop was not seen before our Smartheap
integration. Now, I do know that a process's working set gets trimmed
by the OS at various times (e.g. when minimizing the app), but just to
reiterate, we were seeing "private bytes" drop suddenly as soon as, for
example, I opened the spread*** generated by perfmon to inspect the
"private bytes" data that had been logged.

.