This page last changed on Dec 27, 2010 by jlargman.
Occasionally, JIRA may appear to 'freeze' during execution of an operation. During these times, it is helpful to retrieve a thread dump — a log containing information about currently running threads and processes within the Java Virtual Machine. Taking thread-dumps is a non-destructive process that can be run on live systems. This document describes the steps necessary to retrieve a thread dump.
The steps necessary to retrieve the thread dump are dependant on the operating system JIRA is running in — please follow the appropriate steps:
On this page"
Windows Environment
JIRA running from startup.bat
- In the Command Console window where JIRA is running, open the properties dialog box by right clicking on the title bar and select "Properties".
- Select the Layout tab.
- Under Screen Buffer Size, set the Height to 3000.

- Click OK.
- With the same command console in focus, press CTRL-BREAK. This will output the thread dump to the command console.
- Scroll back in the command console until you reach the line containing "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. The thread dump can then be pasted into a text file.
JIRA running as a Windows Service
- Visit http://www.adaptj.com/root/main/download and click 'Launch'.
- Click 'Run' for any security warnings.
- Select 'Process -> Thread Dump'.
- Under Process Id, select the '...' button.
- From the drop-down list, select the JIRA process. Users running JIRA Standalone should select the 'Java (Tomcat) ...' option. Users running JIRA EAR/WAR should select their application server process.
- Click 'OK' to capture the thread dump.
- Save the output to a file, e.g. 'threaddump.log'
Linux/Unix/OS X Environment
Linux/Unix Command Line
- Identify the java process that JIRA is running in. This can be achieved by running a command similar to:The process will appear similarly as follows:
keithb 910 873 1 17:01 pts/3 00:00:18 /usr/java/jdk/bin/java -Xms128m -Xmx256m
-Xms128m -Xmx256m -Djava.awt.headless=true -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.awt.headless=true -Djava.endorsed.dirs=/tmp/atlassian-jira-enterprise-3.6-standalone/common/endorsed
-classpath :
- In order to retrieve the thread dump, execute the commandwhere pid is the process id — in this case, 910.
- The thread dump is logged to the console in which JIRA was started.
Linux/Unix Alternative: Generating Thread Dumps using jstack
If you have trouble using kill -3 <pid> to obtain a thread dump, try using jstack a java utility that will output stack traces of Java threads for a given process.
- Identify the java process that JIRA is running in. This can be achieved by running a command similar to:
- The process will appear similarly as follows:
adam 22668 0.3 14.9 1691788 903928 ? Sl Jan27 9:36 /usr/lib/jvm/java-6-sun-1.6.0.14/bin/java -Djava.util.logging.config.file=/home/adam/Products/installs/atlassian-jira-enterprise-4.0.1-standalone/conf/logging.properties -XX:MaxPermSize=256m -Xms128m -Xmx1048m -Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Datlassian.mail.senddisabled=false -Datlassian.mail.fetchdisabled=false -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/home/adam/Products/installs/atlassian-jira-enterprise-4.0.1-standalone/common/endorsed -classpath /home/adam/Products/installs/atlassian-jira-enterprise-4.0.1-standalone/bin/bootstrap.jar -Dcatalina.base=/home/adam/Products/installs/atlassian-jira-enterprise-4.0.1-standalone -Dcatalina.home=/home/adam/Products/installs/atlassian-jira-enterprise-4.0.1-standalone -Djava.io.tmpdir=/home/adam/Products/installs/atlassian-jira-enterprise-4.0.1-standalone/temp org.apache.catalina.startup.Bootstrap start
- Run jstack <pid> to Capture a Single Thread Dump
This command will take one thread dump of the process id <pid>, in this case the pid is 22668, and log output to the file JIRAthreaddump.txt
adam@jiratrack:~$ jstack 22668 > JIRAthreaddump.txt
- Take Multiple Thread Dumps
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:
adam@jiratrack:~$ jstack 22668 >> JIRAthreaddump.txt
adam@jiratrack:~$ jstack 22668 >> JIRAthreaddump.txt
adam@jiratrack:~$ jstack 22668 >> JIRAthreaddump.txt
Analysis Tools
Try TDA or Samurai to inspect your thread dump.
TDA
- Download TDA
- CD to the directory where the JAR exists
- Run:
java -jar -Xmx512M ~/tda-bin-1.6/tda.jar
- Open your catalina.out file, containing the thread dump
Check the known thread dump knowledge base articles:
|