GlobalMemoryStatus()함수 MSDN 참고 예제
#include <windows.h>
#define DIV 1024
char *divisor = “K”;
void
main(int argc, char *argv[])
{
MEMORYSTATUS stat;
GlobalMemoryStatus (&stat);
printf (“The MEMORYSTATUS structure is %ld bytes long.n”,
stat.dwLength);
printf (“It should be %d.n”, sizeof (stat));
printf (“There is %ld percent of memory in use.n”,
stat.dwMemoryLoad);
printf (“There are %ld total %sbytes of physical memory.n”,
stat.dwTotalPhys/DIV, divisor);
printf (“There are %ld free %sbytes of physical memory.n”,
stat.dwAvailPhys/DIV, divisor);
printf (“There are %ld total %sbytes of paging file.n”,
stat.dwTotalPageFile/DIV, divisor);
printf (“There are %ld free %sbytes of paging file.n”,
stat.dwAvailPageFile/DIV, divisor);
printf (“There are %ld total %sbytes of virtual memory.n”,
stat.dwTotalVirtual/DIV, divisor);
printf (“There are %ld free %sbytes of virtual memory.n”,
stat.dwAvailVirtual/DIV, divisor);
}