if I understand correctly, in the following output produced by free, 3535m is the actual free memory available to applications, only 413m is used, is this correct? need some clarification on the difference between Mem and -/+ buffers/cache row.

free -m
             total       used       free     shared    buffers     cached
Mem:          3949       3854         95          0          9       3431
-/+ buffers/cache:        413       3535
Swap:         2047       1322        725

3 Answers 3


The Mem: total figure is the total amount of RAM that can be used by applications. This is the total RAM installed on the system, minus:

  • memory reserved by hardware devices (often video memory if the graphics card doesn't have its own RAM);
  • memory used by the kernel itself.

That total includes:

  • free: memory that is currently used for any purpose;
  • shared: a concept that no longer exists. It's left in the output for backward compatibility (there are scripts that parse the output from free). (On current systems you'll typically see nonzero values because shared has been repurposed to show memory that's explicitly shared via a shared memory mechanism. On older systems, it included files mapped by more than one process and shareable memory that remained shared after fork().)
  • buffers: memory that is backed by files, and that can be written out to disk if needed;
  • cache: memory that is backed by files, and that can be reclaimed at any time (the difference with buffers is that buffers must be saved to disk before they're reused, whereas cache consists of things that can be reloaded from disk);
  • used -buffers/cache: memory used by applications (and not paged out to swap).

In a pinch, the system could run without buffers and cache, reserving RAM for applications and systematically performing disk reads and writes without any caching. The -/+ buffers/cache figures indicate the amount of RAM used directly by applications (used column) and the amount of RAM not used by applications (free column).

Although this can vary a lot, a healthy system typically has around half its RAM devoted to applications and half devoted to buffers and cache. Unless you're running a dedicated file server, your system has more RAM than it needs for what you're currently doing. If the free - buffers/cache figure was low, that would indicate a system that doesn't have enough RAM (contrary to a widespread belief, having a lot of memory devoted to buffers and cache is important for system performance, and trying to reserve more memory for applications would make 99.99% of systems slower).

The swap line is straightforward, it shows the amount of swap that's in use (either by applications or for tmpfs storage), and the amount that isn't.


Yes you're right. Buffers and cache are used by the OS but are available to applications immediately. The OS is willing to invalidate and throw away some of the cache in order to satisfy the next request for memory.

  • Note that modern Linux kernels include Shmem in Cached and that cannot be thrown away even when system is running out of memory. Commented Aug 30, 2021 at 7:19

The other answer is an excellent interpretation of free. But why are you looking at free? Presumably it's because you are worried the system might be out of memory.

As an update to this, linux kernel 4.20 added /proc/pressure/ ("pressure stall information") which contains indicators as to when bottlenecks (of cpu, I/O, or memory) are causing your system to be slow.

If you look at the contents of /proc/pressure/memory it will tell you the percentage of samples that processes were waiting for memory to be allocated for them. If these numbers are all zero (excepting total), then your system is not out of memory and not waiting for memory.

You must log in to answer this question.