Question about free -m
I used the free -m Command, but I don't understand what the output means. Can you help me understand it?
1 Reply
(answer by jfeinbaum)
The free command is used to measure the total amount of free and in use physical and swap memory in your system, and adding the -m option will modify it to show all outputs in MegaBytes (MB). As for the different categories it shows, lets look at an example output to get a better understanding:
free -m
total used free shared buff/cache available
Mem: 3946 167 3115 7 663 3543
Swap: 511 0 511
As you can see, the output gives us a handful of categories. Going through them by column from left to right, the definition of each is below:
total:
- The Total installed memory (MemTotal and SwapTotal in /proc/meminfo)
used: - The total Used memory (calculated as total - free - buffers - cache)
free: - The total Unused memory (MemFree and SwapFree in /proc/meminfo)
shared Memory: - The memory that is used (for the most part) by tmpfs (the temporary file storage system) (Shmem in /proc/meminfo, available on kernels 2.6.32, displayed as zero if not available)
buffers: - Memory used by kernel buffers (Buffers in /proc/meminfo)
cache: - Memory used by the page cache and slabs (Cached and Slab in /proc/meminfo)
buff/cache: Sum of buffers and cache
These descriptions were taken, (and slightly modified) from the Manual page for the free command. Try this command to check it out yourself! man free