Skip to content

Instantly share code, notes, and snippets.

@david-pm
Last active August 13, 2016 07:09
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 david-pm/5d6fb6069f9590202fa8b31aa92293bf to your computer and use it in GitHub Desktop.
Save david-pm/5d6fb6069f9590202fa8b31aa92293bf to your computer and use it in GitHub Desktop.
monitor memory usage over time
#!/bin/bash
#
# example usage
#
# > mem 0.1 100
for i in `seq 1 $2`
do
free -m
cat /proc/meminfo | grep MemFree
echo "--------------------"
echo
sleep $1
done
uptime | tr -s ' ' | cut -d ' ' -f 7-11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment