Friday, August 13, 2021

Generate Java thread dump

Often times we need to know what are the processes that are running in our Java app and one way to understand is to get the list of processes which usually called as thread dump.

The two steps to get the thread dump:

1. Get Java pid
    jcmd or jps can be used for retrieving the pid.






2. Generate thread dump

Command: jcmd {pid}
















Note:
To help with understanding the thread dump better, we can redirect output the thread dump to a file and use the online thread dump analyzer, one of my favorite tool is fastThread.

No comments: