Consultor Eletrônico



Kbase 20027: How to Diagnose Java Program Problems?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/16/2008
SUMMARY:

This solution describes the steps you can take when your Java program hangs, crashes or is busy.

SOLUTION:

1) Hanging, deadlocked or frozen programs.

If you think your program is hanging, generate a stack trace
and examine the threads in states MW or CW. If the program is
deadlocked, some of the system threads may show up as the
current threads because there is nothing else for the JVM to
do.

2) Crashed or aborted programs.

If you use UNIX, look for a core file. You can analyze this
file in a native debugging tool such as gdb or dbx. Look for
threads that have called native methods. Because Java
technology uses a safe memory model, any corruption probably
occurred in the native code.

The JVM also uses native code, so it may not necessarily be a
bug in your application.

3) For busy programs.

The best course of action you can take for busy programs is to
generate frequent stack traces. This will narrow down the code
path that is causing the errors, and you can then start your
investigation from there.

Reference to Written Documentation:

http://developer.java.sun.com/developer/technicalArticles/Programming/Stacktrace/index.html