MEMORYSTATUSEX WinMemStat;
WinMemStat.dwLength = sizeof(MEMORYSTATUSEX);
::GlobalMemoryStatusEx(&WinMemStat);
int nMemCount = WinMemStat.ullTotalPhys / 1024 / 1024; //总内存数,单位MB
int nNousedMem = WinMemStat.ullAvailPhys / 1024 / 1024; //可用内存数,单位MB
int nUsedMem = nMemCount - nNousedMem; //已用的内存数