Confluence 5.7 のサポートは終了しています。
ドキュメントの最新バージョンを確認してください。
If Confluence stops responding and you cannot access its integrated Generate Thread Dump feature, it is possible to create thread dumps outside the application. External thread dumps are also useful if you require information on locks being held or waited upon by threads.
スレッドダンプを複数取得する
Typically you'll want to take several dumps about 10 seconds apart, in which case you can generate several dumps and output the stack traces to a single file as follows:
Confluence を実行している java プロセスを識別します。これは以下の様なコマンドで実現できます。
ps -ef | grep java.
上記からプロセス ID を使用してスレッド ダンプを生成します。
kill -3 <pid>
This will not kill your server (so long as you included the "-3" option, no space in between).
Thread dumps appear in the catalina.out file in the application directory's logs folder. You can search for the term "thread dump" in the log file for the beginning of the dump. Submit this along with the atlassian-confluence.log in your support ticket.
If you are running Confluence through a console, rather than as a service, you can click on the console and press <CTRL>+BREAK
The JDK ships with a tool named jstack for generating thread dumps.
Ctrl + Shift + Esc and find the Process ID of the Java (Confluence) process. You may need to add the PID column using View -> Select Columns ...jstack <pid> を実行して、 単一のスレッドダンプを取得します。このコマンドで、プロセス ID <pid> の1個のスレッドダンプが取得出来ます。この場合のプロセス ID は22668です。
adam@track:~$ jstack -l 22668 > threaddump.txt
このコマンドにより、現在のディレクトリに threaddump.txt というファイルが出力されます。
jstack のよくある問題
java.lang.NoClassDefFoundError: sun/tools/jstack/JStack が発生したら、JDK の lib ディレクトリ tools.jar があるかどうかを確認します。tools.jar がない場合、JDK のフル バージョンをダウンロードします。psexec -s jstack <pid> >> threaddumps.txtThread dumps appear in the catalina.out file in the application directory's logs folder. You can search for the term "thread dump" in the log file for the beginning of the dump. Submit this along with the atlassian-confluence.log in your support ticket.
Often Support may ask you to generate a sequence of thread dumps over a short period, so that they can compare what each dump contains and to look for any long running threads that could be the cause of the performance issue. While manually running kill -3 from the command repeatedly will work, it's often easier to use a small script to automate the process. Here's an example that you can adapt to run on your server:
for i in `seq 1 10` ; do
echo ${i}
your/path/to/jstack `ps aux | grep java | grep confluence | grep -v grep | awk '{print $2}'` >> threaddump.log
sleep 10
done