Discrepancy between values in htop and /proc/meminfo
0
votes
1
answer
115
views
From the author of htops answer
https://stackoverflow.com/questions/41224738/how-to-calculate-system-memory-usage-from-proc-meminfo-like-htop/41251290#41251290
I got to know that the total memory in htop is calculated from /proc/meminfo. I think I could crosscheck this in code as well and it checks out.
However compared to memory bar in htop. I see a major difference in the memory values shown in /proc/meminfo.
In my /proc/meminfo the memory consumption reads
MemTotal: 4144807288 kB
MemFree: 3513532764 kB
MemAvailable: 3936769368 kB
Buffers: 1119392 kB
So the Total used memory , which I think represented by the memory bar should be MemTotal-MemFree in GBs which should be (4144807288-3513532764)/1024^2=602Gb as far as I understand.
However for me this value shows almost 180Gb. Could anyone explain how the values in /proc/meminfo and one in htop would become different.

Asked by ArunJose
(103 rep)
Jan 31, 2024, 06:34 PM
Last activity: Feb 5, 2024, 10:15 AM
Last activity: Feb 5, 2024, 10:15 AM