The GetProcessWorkingSetSize function obtains the minimum and maximum working set sizes of a specified process.
The "working set" of a process is the set of memory pages currently visible to the process in physical RAM memory. These pages are resident and available for an application to use without triggering a page fault. The size of a process' working set is specified in bytes. The minimum and maximum working set sizes affect the virtual memory paging behavior of a process.
BOOL GetProcessWorkingSetSize(
HANDLE hProcess, // open handle to the process of interest
LPDWORD lpMinimumWorkingSetSize,
// points to variable to receive minimum working
// set size
LPDWORD lpMaximumWorkingSetSize
// points to variable to receive maximum working
// set size
);
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Windows NT: Requires version 3.5 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in winbase.h.
Import Library: Use kernel32.lib.
Processes and Threads Overview, Process and Thread Functions, SetProcessWorkingSetSize