Question about free -m

Linode Staff
I used the free -m Command, but I don't understand what the output means. Can you help me understand it?

1 Reply

Linode Staff

(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

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct