diff --git a/openVulkanoCpp/Host/Windows/SystemInfo.cpp b/openVulkanoCpp/Host/Windows/SystemInfo.cpp index 49a5c70..6457544 100644 --- a/openVulkanoCpp/Host/Windows/SystemInfo.cpp +++ b/openVulkanoCpp/Host/Windows/SystemInfo.cpp @@ -48,13 +48,25 @@ namespace OpenVulkano { switch(type) { - case APP_MEM_TYPE::VM_MAX: return counters.PeakWorkingSetSize; + case APP_MEM_TYPE::VM_MAX: return counters.PeakPagefileUsage; case APP_MEM_TYPE::USED: return counters.PrivateUsage; } } Logger::PERF->error("Failed to get process memory info"); return 0; } + + size_t GetCommitLimit() + { + MEMORYSTATUSEX status; + status.dwLength = sizeof(status); + if(GlobalMemoryStatusEx(&status)) + { + return status.ullTotalPageFile; + } + Logger::PERF->error("Failed to get system commit limit"); + return 0; + } } size_t SystemInfo::GetSystemRam() @@ -69,12 +81,12 @@ namespace OpenVulkano size_t SystemInfo::GetAppRamMax() { - return std::min(GetSystemRam(), GetAppVirtualMemoryMax()); + return std::min(GetSystemRam(), GetCommitLimit()); } size_t SystemInfo::GetAppRamAvailable() { - return std::min(GetSystemRamAvailable(), GetAppVirtualMemoryMax() - GetAppRamUsed()); + return std::min(GetSystemRamAvailable(), GetCommitLimit() - GetAppRamUsed()); } size_t SystemInfo::GetAppRamUsed()