Skip to content

Instantly share code, notes, and snippets.

@nicokruger
Created August 21, 2012 14:22
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save nicokruger/3415941 to your computer and use it in GitHub Desktop.
Save nicokruger/3415941 to your computer and use it in GitHub Desktop.
Getting java heap usage using jstat
jdk1.7.0/bin/jstat -gccapacity 9043 | tail -n 1 | awk '{ print $4, $5, $6, $10 }' | python -c "import sys; nums = [x.split(' ') for x in sys.stdin.readlines()]; print(str(sum([float(x) for x in nums[0]]) / 1024.0) + ' mb');"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment