Skip to content

Commit 8faec90

Browse files
committed
Use private working set instead.
1 parent fd019c0 commit 8faec90

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Common/Cpp/MemoryUtilization/MemoryUtilization_Linux.tpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ MemoryUsage process_memory_usage(){
6060
{
6161
uint64_t bytes = 0;
6262

63-
// Running this at our poll rate is a terrible idea.
6463
#if 1
6564
const std::string TOKEN = "MemAvailable:";
6665

Common/Cpp/MemoryUtilization/MemoryUtilization_Windows.tpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,13 @@ MemoryUsage process_memory_usage(){
2626
}
2727
}
2828
{
29-
PROCESS_MEMORY_COUNTERS data;
30-
if (GetProcessMemoryInfo(GetCurrentProcess(), &data, sizeof(data))){
31-
ret.process_physical_memory = data.WorkingSetSize;
29+
PROCESS_MEMORY_COUNTERS_EX2 data;
30+
if (GetProcessMemoryInfo(
31+
GetCurrentProcess(),
32+
(PROCESS_MEMORY_COUNTERS*)&data,
33+
sizeof(data)
34+
)){
35+
ret.process_physical_memory = data.PrivateWorkingSetSize;
3236
ret.process_virtual_memory = data.PagefileUsage;
3337
}
3438
}

0 commit comments

Comments
 (0)