Last active
August 29, 2015 13:57
-
-
Save ayush/9463318 to your computer and use it in GitHub Desktop.
shows key memory stats and open files/sockets for a system + process
This file contains hidden or 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
while true; do | |
date; echo; | |
ps aux | awk '{print $2, $4, $11}' | sort -k2r | head -n 5; echo; | |
free -m; echo; | |
cat /proc/meminfo | egrep '(Slab|SRec|SUnr)'; echo; | |
cat /proc/$(pidof $1)/status | grep Vm; | |
echo; echo '_____________________'; echo; | |
cat /proc/sys/fs/file-nr; echo; | |
sudo lsof -c $1 | wc -l; echo; | |
sudo lsof -i -c $1 | grep CLOSE_WAIT | wc -l; echo; | |
echo; echo '************************************'; echo; | |
sleep $2; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shows the following once every minute for
monmem java 60