jstack
The output can also be redirected into any file.
Ref : http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jstack.html
The thread dumps also can be obtained by the following command
kill -3
The thread dump will be appended to the application logs.
(Redirect the standard out (stdout) of the java command to a file. When you send a SIGQUIT signal to the java process, a thread dump is sent to the stdout)
To understand and analyse the thread dumps refer the following
http://weblogs.java.net/blog/bhaktimehta/archive/2007/05/obtaining_and_a.html