Created
August 3, 2018 21:46
-
-
Save wstrange/49b7bf471317c6cafd9d6fbaa95db890 to your computer and use it in GitHub Desktop.
Debug running ds processes with jstack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
dump() { | |
echo "******* Dump $1 *******" | |
pid=`jps -ml | grep $1 | awk '{print $1}'` | |
if [ -n "$pid" ]; then | |
echo $pid | |
jstack $pid; | |
fi | |
} | |
while true | |
do | |
echo "******** Thread dump *******" | |
jps -ml | |
dump Directory | |
dump ReplicationCliMain | |
sleep 30; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment