When an java application server freezes or becomes non-responsive, it is recommended to generate a thread dump for the application. A thread dump is a user-friendly snapshot of the threads and monitors in a Java Virtual Machine (JVM). A thread dump can range from fifty lines to thousands of lines of diagnostics depending on how complex your application is.
On UNIX platforms you can send a signal to a program by using the kill command. This is the quit signal, which is handled by the JVM. On Solaris you can use the command kill -QUIT process_id, where process_id is the process id of your Java program.
run the command kill -QUIT
On Windows platform, enter the key sequence <CTRL> <break>
Thread States :: The key used for the thread states in Thread dump is:
R ==> Running or runnable thread
S ==> Suspended thread
CW ==>Thread waiting on a condition variable
MW ==> Thread waiting on a monitor lock
MS ==> Thread suspended waiting on a monitor lock
Saturday, October 3, 2009
Getting thread dump for java application
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment