Where to start First steps track · 15 stages
Linux Labs

Memory and swap: free, available and the page cache

cheat sheet · Ubuntu 24.04 · Linux 6.8 · procps 4.0 https://lab.dimsanych.ru/en/wiki/memory-swap/

Cheat sheet

  • free -h memory and swap; the reserve is available
  • grep -E '^(Mem|Cached)' /proc/meminfo same from the kernel, KiB
  • ps -eo pid,rss,comm --sort=-rss | head -5 who holds the most
  • swapon --show active swap; empty means no swap
  • vmstat 1 5 si and so — swap reads and writes
  • sysctl vm.swappiness kernel's eagerness to swap, 60 by default
  • sync; echo 3 | sudo tee /proc/sys/vm/drop_caches drop the cache
Loading…