Skip to content

Instantly share code, notes, and snippets.

@oxUnd
Created August 17, 2016 09:36
Show Gist options
  • Save oxUnd/239cfb5c10473f7baea3734e4216f8d7 to your computer and use it in GitHub Desktop.
Save oxUnd/239cfb5c10473f7baea3734e4216f8d7 to your computer and use it in GitHub Desktop.
#!/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