How to keep watch on the amount of used memory in a process?

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
allegro
Posts: 7
Joined: Sun Apr 27, 2008 1:59 am

How to keep watch on the amount of used memory in a process?

Post by allegro »

How to keep watch on the amount of used memory in a process?
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

You may use "WMI" test method and query, based on Win32_Process WMI class: http://www.ks-soft.net/hostmon.eng/#mfr ... ts.htm#wmi

Win32_Process WMI class offers several useful counters that you may use:
1. WorkingSetSize - Amount of memory in bytes that a process needs to execute efficiently—for an operating system that uses page-based memory management. If the system does not have enough memory (less than the working set size), thrashing occurs. If the size of the working set is not known, use NULL or 0 (zero). If working set data is provided, you can monitor the information to understand the changing memory requirements of a process. This value is consistent with the MemUsage value in TaskMgr.exe
2. PageFileUsage - Amount of page file space that a process is using currently. This value is consistent with the VMSize value in TaskMgr.exe
3. VirtualSize - Current size of the virtual address space that a process is using, not the physical or virtual memory actually used by the process. Using virtual address space does not necessarily imply corresponding use of either disk or main memory pages. Virtual space is finite, and by using too much, the process might not be able to load libraries.

Query examples:
select WorkingSetSize from Win32_Process where Caption='explorer.exe'
select PageFileUsagefrom Win32_Process where Caption='notepad.exe'
select VirtualSizeWin32_Process where Caption=hostmon.exe'

Regards,
Max
Post Reply