Пользуемся для этого psapi.h:
void Dialog::PrintMemoryInfo() {
HANDLE hProcess = GetCurrentProcess();
PROCESS_MEMORY_COUNTERS_EX pmce;
if (hProcess) {
if (GetProcessMemoryInfo(hProcess, (PROCESS_MEMORY_COUNTERS *)&pmce, sizeof(pmce))) {
qDebug() << "PageFaultCount:" << pmce.PageFaultCount;
qDebug() << "PeakWorkingSetSize:" << pmce.PeakWorkingSetSize;
qDebug() << "WorkingSetSize:" << pmce.WorkingSetSize;
qDebug() << "QuotaPeakPagedPoolUsage:" << pmce.QuotaPeakPagedPoolUsage;
qDebug() << "QuotaPagedPoolUsage:" << pmce.QuotaPagedPoolUsage;
qDebug() << "QuotaPeakNonPagedPoolUsage:" << pmce.QuotaPeakNonPagedPoolUsage;
qDebug() << "QuotaNonPagedPoolUsage:" << pmce.QuotaNonPagedPoolUsage;
qDebug() << "PagefileUsage:" << pmce.PagefileUsage;
qDebug() << "PeakPagefileUsage:" << pmce.PeakPagefileUsage;
qDebug() << "PrivateUsage:" << pmce.PrivateUsage;
}
}
}
Текущее состояние выделения памяти запущенной программе смотрим по PrivateUsage.