Guys, I am using GetProcessMemoryInfo function to get the details of a current process in Visual Studio 2008 running on Windows 7. The output is populated in PROCESS_MEMORY_COUNTERS structure with a list of following members.
- cb
- PageFaultCount
- PeakWorkingSetSize
- WorkingSetSize
- QuotaPeakPagedPoolUsage
- QuotaPagedPoolUsage
- QuotaPeakNonPagedPoolUsage
- QuotaNonPagedPoolUsage
- PagefileUsage
- PeakPagefileUsage
Which one of these members should I use to get the RAM usage of the process?
Is there another way to get the memory usage of a process using Microsoft Visual C++?
Use
WorkingSetSizeto retrieve physical RAM usage per process. Per the MSDN docs for the underlying Win32 API:There is no other way to get the current working set size than what you are using. See here for details.