linuxatemyram.com icon indicating copy to clipboard operation
linuxatemyram.com copied to clipboard

How does `free` calculates RAM?

Open Firestar-Reimu opened this issue 4 years ago • 1 comments

I found that total does not equal to used+free+shared+buff/cache

and free+shared does not equal to available

so how does free calculate my RAM?

free -m    
              total        used        free      shared  buff/cache   available
Mem:           7875         889        5903         388        1082        6357
Swap:             0           0           0

On the other hand, my computer has 8GB RAM but it only says total=7875 not 8192

Firestar-Reimu avatar Feb 21 '21 01:02 Firestar-Reimu

Maybe checking #9 about the tmpfs (and /proc/shm) could help resolving the details. Most of the Linux distributions have enabled it for the /tmp mount point. So some part of the RAM is used as an external memory (HDD/SDD).

zloster avatar Feb 15 '22 13:02 zloster