Practical steps to find who is swapping, why it happens and what to tweak. 24.01.2026 | reading time: 3 min Swap can hide performance problems until they hurt users; learn how to spot the culprits and measure impact quickly. Quick reality check Do not guess: run a few quick commands to see system-wide swap and activity; for example use these commands and inspect their output exactly as shown: ```$ free -h total used free shared buff/cache available Mem: 15Gi 10Gi 1.0Gi 200Mi 3.9Gi 4.2Gi Swap: 2.0Gi 512Mi 1.5Gi $ swapon --show --bytes NAME TYPE SIZE USED PRIO /swapfile file 2147483648 536870912 -2 $ vmstat 1 3 procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- r b swpd free buff cache si so bi bo in cs us sy id wa 1 0 524288 1073741824 0 412876160 0 1024 0 12 34 56 10 5 80 5 ``` Find the processes using swap Measure per-process swap by reading /proc: this one-liner sums usage across numeric PIDs and prints a single number, making the culprit hunting objective instead of anecdotal: ```$ awk '/VmSwap/ {sum += $2} END {print sum " kB"}' /proc/[0-9]*/status 2>/dev/null 524288 kB ``` Use a process list when you need names: ```$ for f in /proc/[0-9]*/status; do awk '/Name/ {n=$2} /VmSwap/ {if ($2>0) printf "%s %s kB %s\n", n, $2, FILENAME} ' $f; done | sed -E 's:/proc/([0-9]+)/status:PID \1:' | sort -k2 -n bash 262144 kB PID 1234/status python 262144 kB PID 2345/status ``` Interpret what you see High swap used is not automatically bad; check swap activity (si/so in `vmstat`) to see if pages move frequently, inspect `cat /proc/sys/vm/swappiness` to know the kernel's tendency to swap, and consider whether inactive pages or memory leaks explain the pattern. Mitigations to try If swap activity hurts latency, test increasing RAM, lowering swappiness, adding or resizing a swap file, or enabling compressed RAM (zram); for noisy processes consider ulimit, cgroups or moving workloads to machines with more memory. When to use which metric Use `free` and `swapon --show` for quick totals, `vmstat` or `sar -B` for time series and activity rates, and /proc per-process data or `smem`/`htop` to identify the offending process; combine those views for confident decisions. Hands-on example tools Try `smem -k -r -s swap` when available to get a ready per-process swap report, or `htop` and add the SWAP column for interactive triage; these tools save time but validate with /proc if results surprise you. Final thought Swap is a signal more than a sin: measure system-wide and per-process behavior, test a small change, and iterate until swapping stops being a mystery; learn more Linux internals and consider certification paths like CompTIA Linux+ or LPIC-1 with focused exam prep at bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. storage processes troubleshooting utilities