find /proc -maxdepth 2 -path "/proc/[0-9]*/status" -readable -exec awk -v FS=":" -v TOTSWP="$(cat /proc/swaps | sed 1d | awk 'BEGIN{sum=0} {sum=sum+$(NF-2)} END{print sum}')" '{process[$1]=$2;sub(/^[ \t]+/,"",process[$1]);} END {if(process["VmSwap"] && process["VmSwap"] != "0 kB") {used_swap=process["VmSwap"];sub(/[ a-zA-Z]+/,"",used_swap);percent=(used_swap/TOTSWP*100); printf "%10s %-30s %20s %6.2f%\n",process["Pid"],process["Name"],process["VmSwap"],percent} }' '{}' \; | awk '{print $(NF-2),$0}' | sort -hr | head | cut -d " " -f2-
29695 mysqld 4207592 kB 12.54%
15645 Web Content 183520 kB 0.55%
22256 Web Content 179788 kB 0.54%
27618 VBoxSVC 153160 kB 0.46%
23701 Web Content 121528 kB 0.36%
2061 gnome-shell 99684 kB 0.30%
22149 Web Content 85684 kB 0.26%
22067 firefox 76944 kB 0.23%
7556 xfce4-taskmanag 63716 kB 0.19%
26915 nginx 29988 kB 0.09%
[--] Physical Memory : <b>62.9G</b>
[--] Max MySQL memory : <b>66.6G</b>