summaryrefslogtreecommitdiffstats
path: root/linux
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2015-11-29 23:55:31 -0200
committerHisham Muhammad <hisham@gobolinux.org>2015-11-29 23:55:31 -0200
commita84aa2e78226563cd758711171c69c9c79131c53 (patch)
treebc1ebf5048e7411ea3e732069e4bb8def65ac132 /linux
parent5bc1f5ed04a56c4b33cf2854e1f3b0918b098cbf (diff)
Cached memory calculations, take 2.
Thanks to @OmegaPhil for discussion and reviewing.
Diffstat (limited to 'linux')
-rw-r--r--linux/LinuxProcessList.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c
index 6724acff..e939b4a9 100644
--- a/linux/LinuxProcessList.c
+++ b/linux/LinuxProcessList.c
@@ -621,7 +621,6 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, const char*
static inline void LinuxProcessList_scanMemoryInfo(ProcessList* this) {
unsigned long long int swapFree = 0;
- unsigned long long int slab = 0;
unsigned long long int shmem = 0;
unsigned long long int sreclaimable = 0;
@@ -651,9 +650,6 @@ static inline void LinuxProcessList_scanMemoryInfo(ProcessList* this) {
if (tryRead("SwapTotal:", &this->totalSwap)) {}
else if (tryRead("SwapFree:", &swapFree)) {}
break;
- case 'l':
- if (tryRead("Slab:", &slab)) {}
- break;
case 'h':
if (tryRead("Shmem:", &shmem)) {}
break;
@@ -666,8 +662,8 @@ static inline void LinuxProcessList_scanMemoryInfo(ProcessList* this) {
#undef tryRead
}
- this->usedMem = this->totalMem - this->freeMem + (slab - sreclaimable) + shmem;
- this->cachedMem = this->cachedMem + sreclaimable;
+ this->usedMem = this->totalMem - this->freeMem;
+ this->cachedMem = this->cachedMem + sreclaimable - shmem;
this->usedSwap = this->totalSwap - swapFree;
fclose(file);
}

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