Why your Linux server looks out of memory when it is not
27 Nov 2026 memory linux
Cache, available memory, swap and the out-of-memory killer, without the myths.
"Only 80 MB free" alarms people. Usually nothing is wrong.
Unused memory is wasted
Linux keeps recently read files in memory. That cache is released when programs need the space.
Read the right column
free -h
Available estimates what new programs could use. That is the number to watch.
When it is real
- Available memory stays near zero
vmstat 5shows continual swapping- The kernel log reports a killed process
Swap
A little swap used by idle pages is harmless. Constant movement in and out is the problem, and on a hard disk it is painful.
The out-of-memory killer
When nothing can be reclaimed the kernel ends a process, often the largest. A database that "randomly restarts" is a frequent clue. Look:
sudo journalctl -k | grep -i "out of memory"
Fix causes in order
Reduce worker counts, size database buffers to the machine, set limits per service, then consider a larger plan.
Graphs can differ
A host sees memory from outside and may count cache as used. Trust the figures inside the server for tuning.