summaryrefslogtreecommitdiffstats
path: root/linux/Platform.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-02-09 15:57:22 +0100
committerChristian Göttsche <cgzones@googlemail.com>2021-02-09 16:01:05 +0100
commitf273bfd0837b955941462535d66a0c4076948ee9 (patch)
treec3db749dfecdd3f43bf3f5508b50ab124a6df1c8 /linux/Platform.c
parent7ba3396a4c3269f6d26b52f4f4fac72a8b49f25d (diff)
Linux: restore memory calculation regarding HugePages
Subtract the total amount of huge page memory from total and used memory. Restores behavior from #450 (see also #447) Follow-up of 3d497a37
Diffstat (limited to 'linux/Platform.c')
-rw-r--r--linux/Platform.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/linux/Platform.c b/linux/Platform.c
index 83c62d32..da2ae606 100644
--- a/linux/Platform.c
+++ b/linux/Platform.c
@@ -283,8 +283,8 @@ void Platform_setMemoryValues(Meter* this) {
const ProcessList* pl = this->pl;
const LinuxProcessList* lpl = (const LinuxProcessList*) pl;
- this->total = pl->totalMem;
- this->values[0] = pl->usedMem;
+ this->total = pl->totalMem > lpl->totalHugePageMem ? pl->totalMem - lpl->totalHugePageMem : pl->totalMem;
+ this->values[0] = pl->usedMem > lpl->totalHugePageMem ? pl->usedMem - lpl->totalHugePageMem : pl->usedMem;
this->values[1] = pl->buffersMem;
this->values[2] = pl->cachedMem;
this->values[3] = pl->availableMem;

© 2014-2024 Faster IT GmbH | imprint | privacy policy