Here’s a small bash script which will give you a breakdown on which processes are using swap in Linux
1 | #!/bin/bash LIMIT=${1:-30} printf "\e[1m\e[4m%-25s %-25s %s\e[0m\n" "PID" "Swap (kB)" "Process" echo -en " -=[ Doing the Needful once on priority ]=-\r" for x in $(grep Swap /proc/[1-9]*/smaps 2>/dev/null | grep -v '\W0 kB' | tr -s ' ' | cut -d' ' -f-2 | sort -t' ' -k2 -n | tr -d ' ' | tail -$LIMIT); do |