PID=`pgrep java` SCKT=/tmp/.java_pid$PID SGNL=/tmp/.attach_pid$PID CMD='1\0threaddump\0\0\0\0' if [ ! -r $SCKT ]; then touch $SGNL || exit 2 kill -s SIGQUIT $PID sleep 5 rm $SGNL if [ ! -r $SCKT ]; then echo Cannot read $SCKT ... either you are not the correct user for this, or the java process does not 'see' our attach request. exit 1 fi echo Done fi echo -ne "$CMD" | nc -U "$SCKT"
Possible options and variations I know about:
1\0threaddump\0-l\0\0\0
small L for the jstack -L option1\0inspectheap\0\0\0\0
1\0inspectheap\0-live\0\0\0
No comments :
Post a Comment