I've found several answers to this question here on SO, but none that answers my question. I'm trying to track down some memory leaks in our unmanaged C++ application, and from reading the following, it seems that "Memory - Commit Size" is the best metric to use when monitoring memory usage: http://forum.sysinternals.com/virtual-private-bytes-and-working-set_topic18296.html
Here's the explanation of the various metrics reported by Windows Task Manager: http://windows.microsoft.com/en-us/windows-vista/what-do-the-task-manager-memory-columns-mean
I've found the following that describes how to retrieve the Working Set data for a named process: http://msdn.microsoft.com/en-us/library/76yt3c0w.aspx
System.Diagnostics.Process[] processes =
System.Diagnostics.Process.GetProcessesByName(theprocessName);
System.Diagnostics.Process process = processes[0];
However, this mentions nothing about Committed Memory:
Can anyone help? Paul
It looks like you want to use
GetProcessMemoryInfo
. This populates aPROCESS_MEMORY_COUNTERS
structure.The key element of this structure you'll be interested in is