Manually Generating a Thread Dump

If Fisheye/Crucible stops responding or is showing poor performance, providing thread dumps to Support can help diagnose the problem.
Note: If you were asked by Atlassian technical support to create thread dumps please take at least six thread dumps – one every ten seconds for one minute so we can identify what the application is doing. Attach all generated files to the support ticket in addition to a Support Zip (the default Support Zip options includes fisheye.out which is the file to which thread dumps are sometimes written).

Generating a Thread Dump for Windows

Method 1: Windows scripts

We now have scripts for generating thread dumps externally on Windows. Download them from this Bitbucket Repository.

Method 2: CTRL+BREAK (only if Fisheye/Crucible is running in a console window)

  1. Right click on the titlebar for the command console window where Fisheye/Crucible is running to open the  Properties dialog box.

  2. [Layout] タブを選択します。

  3. Under Screen Buffer Size, set the Height to 3000 and click OK.

  4. Press CTRL-BREAK on your keyboard.

  5. This will output the thread dump to the command console.

  6. "Full thread dump" と書かれた行まで、コマンド コンソールをスクロールします。

  7. Right click the title bar and select Edit -> Mark.

  8. Highlight the entire text of the thread dump.

  9. Right click the title bar and select Edit -> Copy.

  10. Open a text editor and paste the thread dump and save the file.

Method 3 - VisualVM:

VisualVM is only provided as part of the Java Development Kit (JDK) distribution of Java.  The JDK is not packaged with Fisheye/Crucible, and will need to be downloaded separately.  Your JAVA_HOME environment variable specifies which version of the Java Virtual Machine (JVM) Fisheye/Crucible uses.  If no JAVA_HOME environment variable is set, Fisheye/Crucible uses the Java Runtime Enviroment (JRE) version packaged with the application.

Scenario 1: Fisheye/Crucible is using the JVM provided by the JDK - AND - Fisheye/Crucible is running as a console application:

  1. Start VisualVM (<JDK installation directory>\bin\jvisualvm.exe)
  2. Select com.cenqua.fisheye.FisheyeCtl application in the left-hand pane under Local.
  3. Select the Threads tab in the right pane.
  4. Click Thread Dump.
  5. Select the Threads tab to return.

Scenario 2: Fisheye/Crucible is not using the JVM provided by the JDK - AND - Fisheye/Crucible is running as a console application:

  1. Stop Fisheye/Crucible.
  2. Edit <Fisheye/Crucible installation directory>\bin\fisheyectl.bat
  3. Add the following JMX parameters to the %_EXECCMD% %FISHEYE_OPTS% property (within the existing quotes)

    -Dcom.sun.management.jmxremote.port=6080 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
    You must choose a free port for JMX to bind to – this example uses port 6080
  4. Restart Fisheye/Crucible.

     

  5. Start VisualVM: <JDK installation directory>\bin\jvisualvm.exe

  6. Select File > Add JMX Connection.

  7. Type: localhost:<your JMX port>

  8. Select com.cenqua.fisheye.FisheyeCtl application in the left-hand pane under Local.

  9. Select the Threads tab in the right pane.

  10. Click Thread Dump.

  11. Select the Threads tab to return.

Scenario 3: If Fisheye/Crucible is running as a service:

  1. Stop Fisheye.
  2. Go to Start > Apps (in Windows 8.1/Server 2012) or All Apps (in Windows 8) > Configure Fisheye.
  3. Add the following JMX parameters to the service configuration on the Java tab under Java:

    -Dcom.sun.management.jmxremote.port=6080
    -Dcom.sun.management.jmxremote.authenticate=false
    -Dcom.sun.management.jmxremote.ssl=false
    You must choose a free port for JMX to bind to – this example uses port 608
  4. [Apply] > [OK] の順にクリックします。

  5. Restart Fisheye.

  6. Open Task Manager.

  7. Look for the Process Name Common Daemon Services Runner.

  8. Open the tree for the process and look for the sub-process "Atlassian Fisheye". The PID for the process will be located under the PID column.

    If you are running multiple Atlassian products on the same server, each will have a separate Process Name Common Daemon Services Runner.
  9. Start VisualVM: <JDK installation directory>\bin\jvisualvm.exe

  10. Select File > Add JMX Connection.

  11. Type: localhost:<your JMX port> and click OK.

  12. Select localhost:<your JMX port> in the left-hand pane under "Local".

  13. Select the Threads tab in the right pane.

  14. Click Thread Dump.

  15. Select the Threads tab.

Generating a Thread Dump on Linux, including Solaris and other Unixes

Method 1 - jstack (available for JDK only, not for JRE installations):

  1. Find the process ID of Fisheye/Crucible the JVM using the ps command.

    FC_PID=`ps aux | grep -i fisheye | grep -i java | awk  -F '[ ]*' '{print $2}'`;
  2. Run the following command 6 times with a 10 second interval:

    top -b -H -p $FC_PID -n 1 > fisheye_cpu_usage.`date +%s`.txt; jstack -l $FC_PID > fisheye_threads.`date +%s`.txt
  3. Look in the resulting CPU usage files (fisheye_cpu_usage.<timestamp>.txt) to identify which threads are consistently using a lot of CPU time.

  4. Take the PID of the top 10 threads which are using CPU time and convert them to Hexadecimal (Eg: 11159 becomes 0x2b97).
  5. Find the Hex values in the thread dump (fisheye_threads.<timestamp>.txt) files to figure out which threads are occupying CPU.

Method 2 - Kill Signal:

  1. Find the process ID of Fisheye/Crucible the JVM using the ps command:

    ps aux | grep -i fisheye | grep -i java | awk  -F '[ ]*' '{print $2}'
  2. Run the following command 6 times with a 10 second interval:

    The kill -3 command will NOT terminate your Fisheye/Crucible process.
    kill -3 <pid>
    The thread dump will be printed to Fisheye/Crucible's standard output (fisheye.out).

 

Tools for analyzing thread dump files:

最終更新日: 2019 年 2 月 14 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.