Pcornel
Linux · Resource Monitoring

Memory

Cheat sheet · https://pcornel.dk/topic.php?topic=2836

Back to the Topic

Answer

Memory monitoring shows used, free, buffers/cache and available memory, swap use and per-process memory (RSS). Linux uses free RAM as cache, so "free" is usually low; "available" is what matters.

Remember

Check available in free -h, not free. Steady swap-in/out (si/so in vmstat) means real memory pressure. OOM kills are logged by the kernel (journalctl -k | grep -i oom). Growing RSS over days points to a leak.

First checks

  • top -o %CPU / htop — live CPU and memory per process
  • vmstat 1 5 — CPU, memory, swap and I/O over time
  • free -h — memory and swap
  • iostat -xz 1 3 — disk utilisation and latency (sysstat)
  • uptime — load averages

Commands

journalctl -k -g oom
systemctl status <unit>
df -h -t tmpfs

Verify in this order

memory used by processes and cache → available falls → swapping → OOM killer as last resort

Where it usually breaks

First mismatch in hardware/kernel capability → scheduler/mm/device → cgroup/namespace → process/thread → service/runtime → workload behavior/counters; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2836

Confirmation

Confirm action

Continue?