Skip to content

Instantly share code, notes, and snippets.

@leberblock
Created August 27, 2012 09:37
Show Gist options
  • Save leberblock/3486971 to your computer and use it in GitHub Desktop.
Save leberblock/3486971 to your computer and use it in GitHub Desktop.
java: threaddump
tmpdir=$(ps aux | grep -v grep | grep -Eo "tmpdir=[^ ]*" | cut -d "=" -f 2)
pid=$(jps -J-Djava.io.tmpdir=$tmpdir | grep -v Jps | grep -Eo "^[0-9]{1,}")
ln -fs "$tmpdir/.java_pid$pid" "/tmp/.java_pid"$pid;
jstack -l $pid >> "/data/tmp/"$pid"_stacktrace"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment