windows 查看内存

MEMORYSTATUSEX statex;

statex.dwLength = sizeof (statex);

GlobalMemoryStatusEx (&statex);

_tprintf (TEXT("There is %*ld percent of memory in use. "),
WIDTH, statex.dwMemoryLoad);
_tprintf (TEXT("There are %*I64d total KB of physical memory. "),
WIDTH, statex.ullTotalPhys/DIV);
_tprintf (TEXT("There are %*I64d free KB of physical memory. "),
WIDTH, statex.ullAvailPhys/DIV);
_tprintf (TEXT("There are %*I64d total KB of paging file. "),
WIDTH, statex.ullTotalPageFile/DIV);
_tprintf (TEXT("There are %*I64d free KB of paging file. "),
WIDTH, statex.ullAvailPageFile/DIV);
_tprintf (TEXT("There are %*I64d total KB of virtual memory. "),
WIDTH, statex.ullTotalVirtual/DIV);
_tprintf (TEXT("There are %*I64d free KB of virtual memory. "),
WIDTH, statex.ullAvailVirtual/DIV);

// Show the amount of extended memory available.

_tprintf (TEXT("There are %*I64d free KB of extended memory. "),
WIDTH, statex.ullAvailExtendedVirtual/DIV);

原文地址:https://www.cnblogs.com/thbCode/p/4563811.html