Last active
November 30, 2021 18:47
-
-
Save iAnatoly/708464e9b3cd422c671a9cf8fe564200 to your computer and use it in GitHub Desktop.
print out the swap usage by process
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for proc in /proc/*; do cat $proc/smaps 2>/dev/null | awk -v proc="${proc}" '/Swap/{swap+=$2/1024}END{if (swap>1) { "readlink "proc"/exe"|getline c; print int(swap+0.5), "\tMB\t", c }}'; done | sort -n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment