mirror of
https://github.com/xzeldon/htop.git
synced 2025-04-05 10:57:07 +03:00
Make process memory percentage calculation saner.
This commit is contained in:
parent
f56c8014f7
commit
d46dcf99fd
@ -602,8 +602,8 @@ void ProcessList_processEntries(ProcessList* this, char* dirname, int parent, fl
|
|||||||
process->percent_cpu = (process->utime + process->stime - lasttimes) /
|
process->percent_cpu = (process->utime + process->stime - lasttimes) /
|
||||||
period * 100.0;
|
period * 100.0;
|
||||||
|
|
||||||
process->percent_mem = process->m_resident /
|
process->percent_mem = (process->m_resident * PAGE_SIZE) /
|
||||||
(float)(this->usedMem - this->cachedMem - this->buffersMem) *
|
(float)(this->totalMem) *
|
||||||
100.0;
|
100.0;
|
||||||
|
|
||||||
this->totalTasks++;
|
this->totalTasks++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user