Skip to content

Instantly share code, notes, and snippets.

@purijatin
Forked from nicokruger/jvm-heap-usage.sh
Last active August 29, 2015 14:10
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 purijatin/e9ce7dce4afe04d8bdfb to your computer and use it in GitHub Desktop.
Save purijatin/e9ce7dce4afe04d8bdfb to your computer and use it in GitHub Desktop.
# Prints the Total heap usage of Java process
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