Ubuntu – htop shows 33% memory usage, but its Mem bar is full

htopmemory usageUbuntu

When I run htop on a remote computer its Mem bar shows that memory is full and even swap shares 2.3G(also I can see the system works very slow). But htop's MEM% column shows about 33% memory usage. Also sum of RES column is about 3G which it confirms 33% memory usage. I have not any idea what is the relation between these results. Also I could not find some processes(except PID 814) to free memory.

You can find a screenshote from my htop here.

Another point is that PID 814 has a red value 16.0T in the VIRT column which is not clear to me(red means unit is Gbyte). Maybe changes to hugepages may affect this output. In the following you can see cat /proc/meminfo | grep Huge output

AnonHugePages:    532480 kB
ShmemHugePages:        0 kB
HugePages_Total:       5
HugePages_Free:        5
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:    1048576 kB

PS: Changes to hugepages were not made by me. I do not know this influences on processes memory usage or not. (on the other hand if I roll back hugepages size, memory uses by process(es) reduces or not? How hugepages influence performance? it uses more memory but the decrease memory page faults? this memory counted as process memory usage such as its data or is respect to OS and counted somewhere else?)

Best Answer

Regarding the htop bar, this link explains that there is a subtle color-coding in the bar itself. I believe the first number on the right of the bar matches the green portion of the bar.

Regarding the bar itself appearing large, I found this to be an interesting read.