Skip to content

Instantly share code, notes, and snippets.

@geraldstanje
Last active January 18, 2016 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geraldstanje/6d51cbb84702bff4bb06 to your computer and use it in GitHub Desktop.
Save geraldstanje/6d51cbb84702bff4bb06 to your computer and use it in GitHub Desktop.
get the max memory usage of an app
# start the app:
while true; do ./main; sleep 0.1; done;
# monitor:
max=0;
for i in {1..200};
do
x=`ps aux | grep -m1 main | awk '{print $6}'`;
if [ $x -gt $max ]; then
max=$x;
fi;
sleep 0.1;
done;
echo $max
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment