How do I get a thread dump

The following methods are sorted and prioritized.

In some of the methods, you are required to obtain the PID of the tomcat process.
On Windows:
$ netstat -ano | findstr <PORT>
*With <PORT> being the port Artifactory id running on (default is 8081)

On Linux use:
$ ps -aef | grep java

Method #1 - Running '$ kill -3 <PID>
This is the best method when Artifactory is running as a service.
The thread dump will be in the catalina.out file.
 
Please note that when Artifactory isn't running as a service, the dump will go to the STDOUT of the shell session that runs the server and won't go to the timestamped catalina.out file.
This method produces the most ideal type of thread dump format.

Method #2 - Using the Support Bundle's built-in thread dump collector

Method #3 - Using 'JStack'

  • Navigate to '{JAVA_HOME}/bin'
  • *Run '$ jstack.exe -l <PID> > thread_dump.txt'

*Note that the user executing jstack.exe must be the same user who owns the JVM process or have sufficient privileges to access it.
This is the least preferable way, as sometimes the thread states may not deduced well, and the stack trace format may not be compatible with IntelliJ's stack trace analyzer.