I want to get the memory usage (both physical and virtual) and handle
usage of my application. Is there any API function to achieve this?
I tried with GetProcessMemoryInfo(), but it gives only the
PagefileUsage. Is this is same as virtual memory size?
Does anybody know how windows task manger shows all these information.
Thanks in advance,
regards,
FM
Here's the mapping between Task Manager info and Win32 API:
"Memory Performance Information"
http://msdn.microsoft.com/en-us/library/aa965225(VS.85).aspx
HTH
Alex
Thanks for the information.
GetPerformanceInfo() gives only the PagefileUsage. How I get the
handle count and physical memory used by the process?.
Handle count:
`NtQuerySystemInformation' or `GetProcessHandleCount' (WinXP SP1
and higher).
Physical memory:
Task manager does not show you the physical memory usage. The "Mem
Usage" column shows you current working set of a process. See
again the "Memory Performance Information" article I posted
earlier.
Also, I would suggest you to use WMI for obtaining system/process
info. It's clean unified way, which is easier to use than digging
into obscure internal calls. Look for `Win32_Process' class in
MSDN.
HTH
Alex