Skip to content

Instantly share code, notes, and snippets.

@jenslohmann
Last active November 6, 2018 14:04
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 jenslohmann/c9b47fc2317f2289e5cfeda396396b54 to your computer and use it in GitHub Desktop.
Save jenslohmann/c9b47fc2317f2289e5cfeda396396b54 to your computer and use it in GitHub Desktop.
Poor man's meminfo for the single JBoss process on the server
#!/bin/bash
if [ $(ps -ef|grep -E "java.*jboss"|grep -v grep|wc -l) -ne 1 ] ; then
echo "Too many (or no) java processes!"
else
jmap -heap $(ps -ef|grep -E "java.*jboss"|grep -v grep|tr -s " "|cut -d\ -f2)
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment