Monday January 09, 2006
Java process hang - getting stack traces
The other day, I was looking at a java process hang and here are the basic steps followed to get the jvm/native stack traces and core file for further debugging or investigation. I got the deadlock information in the stack!
Solaris platform
Get the entire process tree from your basic command process. Say ps -ef |egrep "java" . Then running ptree pid gives the all the related processes and see the exact process that you would like to have the stack.
Run the following to command to get the stack:
kill -QUIT pid or kill -3 pid
Observe the stack or other information such as deadlock in the console where the command started or connected log or a redirected file.
Use following command to get the native process stack:
pstack pid
To get the core file, use the command - gcore pid .
Windows Platform
Use ctrl+\ on the command window for getting the stack. Not sure if the process started at the background:-(
One of the helpful page, I found is at
http://www.unixville.com/~moazam/stories/2004/05/18/debuggingHangsInTheJvm.html
Posted by Jagadesh Babu Munta
( Jan 09 2006, 12:58:22 PM PST )
Permalink
Comments [19]