Created
November 28, 2017 13:12
-
-
Save andrefabbro/afef48a4f09de333b574eeb30275b994 to your computer and use it in GitHub Desktop.
Extrai 10 thread dumps a cada 5 segundos
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
#!/bin/bash | |
# executar enviando o codigo do processo, | |
# exemplo: ps aux | grep java | |
# chamada: ./thread-dump.sh <pid> | |
# deve ser executado com o mesmo usuario dono do processo, | |
# su -p -s /bin/sh jboss -c ./thread-dump.sh <pid> | |
[ -z $pid ] && echo "Informe o pid do processo java" && exit 1 | |
pid="$1" | |
for n in {1..10}; do | |
jstack $1 > `date +%Y%m%d%H%M%S`.thdump | |
sleep 5 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment