Re: Fastcode MM memory usage



> > It's very difficult to measure the memory usage using task manager. The
> > usage numbers given by the B&V replay tool is the actual address space used
> > by the process and is IMO the best measure.
>
> I'm having trouble following here. The memory usage reported in perfmon
> and the task manager is what's actually allocated, right?

For PerfMon it depends entirely on what you've chosen to monitor. There
is a *long* list of values. The column "Mem Usage" in Task Manager is
called "Working Set" in PerfMon.

Working Set is roughly the amount of RAM currently in use by the
process. For a computer that has plenty of free RAM, this value is
typically very stable. For a computer that does not have enough free
RAM, this value will be constantly changing as pages are first swapped
through the disk cache and then through the hard drive.

In addition, certain events (like minimizing the application) cause the
operating system to "trim the working set". Basically, the operating
system tosses memory pages that haven't been touched in a while.


> So it's a
> different value than that reported by the B&V, but it seems like it
> would be just as valid.

You have a point. Smaller working set = good thing. A memory manager
that produces a smaller working set, either by design or by luck, places
a smaller burden on the operating system.


> We don't really have a lot of trouble with
> fragmentation and address space creep, so I'm more concerned about
> limiting the overall system impact by keeping as little memory allocated
> as possible when we aren't using it. It seems like I'd want to use the
> numbers from the task manager in that case, wouldn't I?

That makes sense. Just bare in mind that the number is ephemeral. Even
the tiniest change (like showing a dialog box) can dramatically affect
the working set.


- Brian
.



Relevant Pages

  • Re: Still confused why working set larger than virtual memory
    ... when working set is larger than virtual memory? ... I think in your below case, you mentioned the file map pages are not counted ... not PerfMon as you do). ...
    (microsoft.public.vc.language)
  • Re: How to display "details" for memory usage?
    ... It is difficult, if not impossible, to account for exact memory usage on NT operating systems but by using Perfmon and select performance counters you can get a fairly close accounting of memory usage. ... To obtain the physical memory usage first determine memory usage by the Operating System and Device Drivers by adding the following Memory Object counters: ... Now that we know the memory usage by the Operating System and Device Drivers we can use the Memory Available Bytes counter and simple arithmetic to obtain the correct size of the Total Process Working Set size: ...
    (microsoft.public.windowsxp.general)
  • Re: Can extra processing threads help in this case?
    ... API for your program that doesn't use virtual memory? ... The operating system allocates working set sizes on a first-come, ...
    (microsoft.public.vc.mfc)
  • Re: Why free() is not deallocating complete memory?
    ... data has been "freed" based on perfmon is probably illusory and a coincidence. ... Perfmon can only report data footprint in terms of the operating system, ... Read my essays on how storage allocators work, ... Until you understand how memory allocation works, you will continue to think that freeing ...
    (microsoft.public.vc.mfc)
  • Re: Can extra processing threads help in this case?
    ... wasn't using *virtual memory*? ... API for your program that doesn't use virtual memory? ... than the process' current working set sizes, ... the operating system denies the second application's ...
    (microsoft.public.vc.mfc)