summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2007-04-10 16:27:12 +0000
committerHisham Muhammad <hisham@gobolinux.org>2007-04-10 16:27:12 +0000
commitd46dcf99fdfe039f0cf620a75c81e10612d2e19c (patch)
tree70a7941ca9b4cf3fde177451a093e830ed660a07
parentf56c8014f7b3aa5f6b5591b5433d8a0b22d55ba4 (diff)
Make process memory percentage calculation saner.
-rw-r--r--ProcessList.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ProcessList.c b/ProcessList.c
index aa359f03..961f8d56 100644
--- a/ProcessList.c
+++ b/ProcessList.c
@@ -602,8 +602,8 @@ void ProcessList_processEntries(ProcessList* this, char* dirname, int parent, fl
process->percent_cpu = (process->utime + process->stime - lasttimes) /
period * 100.0;
- process->percent_mem = process->m_resident /
- (float)(this->usedMem - this->cachedMem - this->buffersMem) *
+ process->percent_mem = (process->m_resident * PAGE_SIZE) /
+ (float)(this->totalMem) *
100.0;
this->totalTasks++;

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