Htop and mate-system-monitor shows different memory usage numbers

18-04-bionic-LTS

#1

htop command shows less memory usage than the mate-system-monitor for some reason. Please see below screenshot. Also the free command shows same number as htop.


Excessive memory usage in 18.04
#2

Linux memory is a constantly changing variable as it tries to be most efficient with what's in RAM. It's likely the different libraries are calculating the usage differently.

Since the units can sometimes be a cause of confusion:

SI unit = 1 Megabyte = MB = (1000)^2 bytes = 1000000 bytes
IEC unit = 1 Mebibyte = MiB = (1024)^2 bytes = 1048576 bytes

According to man htop, htop uses the MiB units like MATE System Monitor does, so that clears that one.


Even by knowing the data, I haven't been able to crunch the numbers to conclude how exactly the programs differ, but I do know that MATE System Monitor does include the used space in tmpfs filesystems:

mount | grep tmpfs

(Probably should've used free -m instead of free -h here for more precise measurements - also showing a system load monitor that reports GB with the same value converted to MATE System Monitor's GiB)


#3

Makes sense. Thank you for the response.