I want to get memory usage of my application (Windows, Win7, x64) from within it, programmatically. I tried using the API GetProcessMemoryInfo()
but I'm not sure about the returned values.
What I would like to get are:
the total memory used by the app (RAM + page file)
the total physical memory used by the app (RAM only).
My goal is to track memory leak(s) by executing repetitive tasks from within my application and monitoring/logging the evolution of the used memory.
Note: Currently I'm using PROCESS_MEMORY_COUNTERS::PageFileUsage
for total memory and PROCESS_MEMORY_COUNTERS::WorkingSetSize
for the physical (RAM) memory. I think this is not the right way to get what I want.