The GlobalMemoryStatus function obtains information about the system's current usage of both physical and virtual memory.
To obtain information about the extended portion of the virtual address space, or if your application may run on computers with more than 4 GB of main memory, use the GlobalMemoryStatusEx function.
The MEMORYSTATUS structure contains information about the current state of both physical and virtual memory. The GlobalMemoryStatus function stores information in a MEMORYSTATUS structure.
typedef struct _MEMORYSTATUS { DWORD dwLength; DWORD dwMemoryLoad; SIZE_T dwTotalPhys; SIZE_T dwAvailPhys; SIZE_T dwTotalPageFile; SIZE_T dwAvailPageFile; SIZE_T dwTotalVirtual; SIZE_T dwAvailVirtual;
} MEMORYSTATUS, *LPMEMORYSTATUS;
Members
dwLength
Size of the MEMORYSTATUS data structure, in bytes. You do not need to set this member before calling the GlobalMemoryStatus function; the function sets it.
dwMemoryLoad
Approximate percentage of total physical memory that is in use.
Windows NT: Percentage of approximately the last 1000 pages of physical memory that is in use.
dwTotalPhys
Total size of physical memory, in bytes.
dwAvailPhys
Size of physical memory available, in bytes.
dwTotalPageFile
Size of the committed memory limit, in bytes.
dwAvailPageFile
Size of available memory to commit, in bytes.
dwTotalVirtual
Total size of the user mode portion of the virtual address space of the calling process, in bytes.
dwAvailVirtual
Size of unreserved and uncommitted memory in the user mode portion of the virtual address space of the calling process, in bytes.