-
-
Save oxUnd/239cfb5c10473f7baea3734e4216f8d7 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env sh | |
Pid=$1 | |
if [ "$Pid" = "" ]; then | |
echo 'please input pid' | |
exit 1 | |
fi | |
echo 'test' | |
prev=0 | |
for i in `seq 1 10000`; | |
do | |
raw=`cat /proc/$Pid/status | grep 'VmRSS'` | |
now=`echo $raw | awk '{ print $2 }'` | |
if [ "$now" -eq "$prev" ]; then | |
echo "${raw} =" | |
elif [ "$now" -gt "$prev" ]; then | |
echo "${raw} +" | |
else | |
echo "${raw} - %%%%%%%%%%%%%%%%" | |
fi | |
prev=$now | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment