// This structure contains the details of physical memory and virtual memory
Memorystatus mem_stat;
Mem_stat.dwlength = sizeof (memorystatus );
// Obtain the memory status
Globalmemorystatus (& mem_stat );
Structure member description:
The size of the dwlength memorystatus structure, which is obtained by using the sizeof () function before calling the globalmemorystatus function for the function to detect the structure version.
Dwmemoryload returns a value ranging from 0 ~ Value between 100 to indicate the current system memory usage.
Dwtotalphys returns the total physical memory size, in bytes.
Dwavailphys returns the available physical memory size, in bytes.
Dwtotalpagefile displays the number of bytes that can exist in the page file. Note that this value does not indicate the actual physical size of the page file on the disk.
Dwavailpagefile returns the Available page file size, in bytes.
Dwtotalvirtual returns all available virtual address spaces in the user mode of the calling process, in bytes.
Dwavailvirtual returns the free virtual address space of the user mode part of the calling process, in bytes.