Tool for debugging hangs in java application

前端 未结 3 1980
北荒
北荒 2020-12-30 03:44

I\'ve got a java application that half the time just hangs, and the other half the JVM crashes. Is there a tool I can use to see what\'s going on that makes it hang and/or c

3条回答
  •  情深已故
    2020-12-30 04:13

    There are two different cases.

    Application crash: Was that an OOM? NPE? What was the exception? If there was jvm crash you will see hs_err_.log (http://java.sun.com/j2se/1.5/pdf/jdk50_ts_guide.pdf)

    Looking at the file you may see if your own JNI caused a crash or JVM bug.

    Application Hang: I would start with visualvm or jstat (both are part of JDK). You can see current state of threads and check if there is any application error..

    Other linux tools that could help to see inside process:

    • lsof : you can check if the process opened too many files
    • strace: see current activity from system call point of view.

    Oracle tools documentation provides pretty neat listing. It also links Operating System Specific tools

提交回复
热议问题