Skip to main content

Posts

Showing posts from October, 2014

How to take thread dump of a running application in Oracle and IBM Java ?

A thread dump will help a developer to identify the application hanging issues and performance issues. To analyze this, please take, a continuous snapshot of thread dumps and analyze using a thread dump analyzing tool. In Oracle Java you can use jstack tool. This executable is available in the JAVA_HOME/bin folder. Use the following command ' jstack -l <PID> >> threaddump ' . This will write the thread dump into a file 'threaddump' in the directory from you have executed the command. <PID> should replaced with actual process id. You can use the following command to find the process id in Unix. ' ps -ef | grep java ' . In IBM Java you can use ' kill -3 <PID> ' . This will write the thread dump in application running console or in nohup file or a thread dump file will be generated in the program running directory.