Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate thread dump on bitbucket 5.15.1

Akul Bhatnagar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 19, 2018

I had been using *kill signal method* to generate thread dumps from the terminal till we upgraded our staging instance to bitbucket version 5.15.1. I could not find catalina.out where the dump usually gets written. Could anyone please help me understand what I need to change in order to get the thread dumps of the application.

1 answer

0 votes
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 21, 2018

Hello Akul,

There are multiple different ways to access or generate a thread dump within Bitbucket. Using the Kill signal method will record the thread dump to the following:

$BITBUCKET_HOME/log/launcher.log

The catalina.out was using for Bitbucket 4.14 and below.

If you are still unable to generate a thread dump then it is suggest to attempt the jstack thread dump:

jstack:

Sun JDK 1.5 and above ship with native tool called jstack to perform thread dump.

    • Find the process ID of Bitbucket Server the JVM using the ps command:
BITBUCKET_PID=`ps aux | grep -v elasticsearch | grep -i bitbucket | grep -i java | awk  -F '[ ]*' '{print $2}'`;
    • Then run the following command 6 times with a 10 second interval.
top -b -H -p $BITBUCKET_PID -n 1 > bitbucket_cpu_usage.`date +%s`.txt; jstack $BITBUCKET_PID > bitbucket_threads.`date +%s`.txt
    • Look in the resulting cpu usage files 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
    • Search up the Hex values in the thread dumps to figure out which threads are using up all the CPU

Source document: Generate a Thread Dump Externally : See Method 1 - jstack:

If you’re still having issues generating or accessing your thread dump, please let us know.

Regards,
Stephen Sifers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events