Linux free Command Explained: Memory, available, Swap and When RAM Is Full

free command linux - custom-freemem-featured.png

The free command is searched constantly by admins who SSH into a slow box and need to know if RAM is the bottleneck. Modern kernels expose available — a better signal than the legacy free column alone.

Next steps: htop,
OOM troubleshooting,
add a swap file.

What free Shows

RAM usage split across apps, kernel caches, and swap spillover.

RAM + swap
overview

Run free -h

Human-readable megabytes/gigabytes — the default first check.

bashsnapshot
free -h
free -h
columns

Focus on available

Linux can reclaim cache for applications; available estimates what is left for new allocations.

bashwide output
free -hw
available
not free alone

Swap Line

Non-zero swap used is not always bad — sustained swap in/out (si/so) means pressure.

bashswap
swapon --show
vmstat 1 3
swap
swapon

Confirm With htop

See which process holds RSS — free only shows the aggregate.

htop
RSS

When Memory Is Critically Low

OOM killer, thrashing, database restarts — available near zero for long periods.

bashkernel
sudo dmesg -T | grep -i 'out of memory' | tail -5
OOM
dmesg

Monitor Trends

Alert on available percentage; containers have cgroup limits separate from host free.

alerting
cgroups

Quick Reference

  • Use free -h — watch available
  • High swap I/O → investigate with htop/vmstat
  • OOM → see OOM guide

Related tutorials

Diagrams are original illustrations by Gnome IT Solutions. Tutorial text © Gnome IT Solutions.