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)
Right click on the titlebar for the command console window where Fisheye/Crucible is running to open the Properties dialog box.
[Layout] タブを選択します。
Under Screen Buffer Size, set the Height to 3000 and click OK.
Press CTRL-BREAK on your keyboard.
This will output the thread dump to the command console.
"Full thread dump" と書かれた行まで、コマンド コンソールをスクロールします。
Right click the title bar and select Edit -> Mark.
Highlight the entire text of the thread dump.
Right click the title bar and select Edit -> Copy.
Open a text editor and paste the thread dump and save the file.
Method 3 - VisualVM:
Scenario 1: Fisheye/Crucible is using the JVM provided by the JDK - AND - Fisheye/Crucible is running as a console application:
- Start VisualVM (<JDK installation directory>\bin\jvisualvm.exe)
- Select com.cenqua.fisheye.FisheyeCtl application in the left-hand pane under Local.
- Select the Threads tab in the right pane.
- Click Thread Dump.
- 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:
- Stop Fisheye/Crucible.
- Edit <Fisheye/Crucible installation directory>\bin\fisheyectl.bat
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 6080Restart Fisheye/Crucible.
Start VisualVM: <JDK installation directory>\bin\jvisualvm.exe
Select File > Add JMX Connection.
Type: localhost:<your JMX port>
Select com.cenqua.fisheye.FisheyeCtl application in the left-hand pane under Local.
Select the Threads tab in the right pane.
Click Thread Dump.
- Select the Threads tab to return.
Scenario 3: If Fisheye/Crucible is running as a service:
- Stop Fisheye.
- Go to Start > Apps (in Windows 8.1/Server 2012) or All Apps (in Windows 8) > Configure Fisheye.
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[Apply] > [OK] の順にクリックします。
Restart Fisheye.
Open Task Manager.
Look for the Process Name Common Daemon Services Runner.
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.Start VisualVM: <JDK installation directory>\bin\jvisualvm.exe
Select File > Add JMX Connection.
Type: localhost:<your JMX port> and click OK.
Select localhost:<your JMX port> in the left-hand pane under "Local".
Select the Threads tab in the right pane.
Click Thread Dump.
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):
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}'`;
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
Look in the resulting CPU usage files (fisheye_cpu_usage.<timestamp>.txt) to identify which threads are consistently using a lot of CPU time.
- Take the PID of the top 10 threads which are using CPU time and convert them to Hexadecimal (Eg: 11159 becomes 0x2b97).
- 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:
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}'
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:
- Samurai - http://samuraism.jp/samurai/en/index.html
- Thread Dump Analyzer (TDA) - https://java.net/projects/tda