12/11/2026
Which process is eating your swap? Here is how to find out. 🔍
Your server feels slow, and free -h shows swap in use. But which app put it there? Linux can tell you. Here are three simple ways.
1. Check one process
Find the process ID, then read its VmSwap value:
pidof nginx
grep VmSwap /proc/PID/status
Replace PID with the number you got. Linux tracks swap for each process in this file.
2. List the top swap users with smem (best way)
Install it, then sort by swap:
sudo apt install smem
smem -s swap -r -k | head
On RHEL, Alma, or Fedora, use dnf install smem. The -r flag sorts by the largest users first, and -k shows readable sizes.
3. No extra tools? Use a one-line loop
for f in /proc/*/status; do awk '/VmSwap|Name/{printf $2 " " $3}END{print ""}' $f; done | sort -k 2 -n -r | head
This prints each process name and its swap size.
Good to know:
- The top swap column is not exact. It only shows virtual size minus RAM size.
- Results are a snapshot. Run the command again a few times to see if it changes.
- Swap in use is not always bad. Constant swap activity is the real warning sign.
Want to know how swap works, how to check it, and how to tune it? Read this guide: https://perlod.com/tutorials/swap-usage-on-linux-servers/
Which app uses the most swap on your server? Tell us in the comments 👇
A complete guide to Swap usage on Linux: Understand vm.swappiness, monitor si and so metrics, and tune your server to prevent swap storms.