Frequently Asked Question

Why does free -h show almost no free memory, and what should I look at instead?

Linux treats unused RAM as wasted RAM. Any memory not currently allocated to a process gets used by the page cache (recently-read file contents) and the buffer cache (filesystem metadata, in-flight I/O). On a busy server the free column of free -h will sit near zero almost permanently, which alarms newcomers but is exactly how it should look. The cache is not locked memory; the moment any process asks for an allocation, the kernel will reclaim cached pages instantly.

The column to read is available. Added in kernel 3.14 and surfaced in newer free and /proc/meminfo as MemAvailable, it is the kernel's own estimate of how much memory could be handed out without resorting to swap, taking into account reclaimable caches and slab. If available is healthy, you are not short of memory regardless of what free says. If available is approaching zero and Swap used is climbing, then you have a problem.

Further reading and video