Multi-threaded Java practitioners know about the indispensible ways to taking thread dumps to see a snapshot of what’s happening in the JVM, and resolve ‘hang’ issues. There are plethora of options, ranging from simple command line tools and utilities to nice GUI applications to writing some code in your application. A sampling of such options:
Stack trace in Java
If the application is running as a console application, you can try one of these:
Sending a signal to the Java Virtual Machine
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. For example, on Solaris you can use the command
kill -QUIT process_id, where process_id is the process number of your Java program.