Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
d46dcf99
Commit
d46dcf99
authored
Apr 10, 2007
by
Hisham Muhammad
Browse files
Make process memory percentage calculation saner.
parent
f56c8014
Changes
1
Hide whitespace changes
Inline
Side-by-side
ProcessList.c
View file @
d46dcf99
...
...
@@ -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
->
buffers
Mem
)
*
process
->
percent_mem
=
(
process
->
m_resident
*
PAGE_SIZE
)
/
(
float
)(
this
->
total
Mem
)
*
100
.
0
;
this
->
totalTasks
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment