RAM usage calculation. #165
-
Can someone explain to me how ram usage is calculated? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi, I'm assuming you mean for linux? Memory stats are read from The code in question: btop/src/linux/btop_collect.cpp Lines 729 to 766 in e2668c6 |
Beta Was this translation helpful? Give feedback.
@jokerekv2
Hi, I'm assuming you mean for linux?
Memory stats are read from
/proc/meminfo
.But since
/proc/meminfo
doesn't provide a "used" metric, it's calculated fromtotal memory
-available memory
.So "used memory" = "non available memory".
Haven't look at how
htop
calculates this but the current calculation is what made most sense to me.The code in question:
btop/src/linux/btop_collect.cpp
Lines 729 to 766 in e2668c6