用于调试的工具在java应用程序中挂起 [英] Tool for debugging hangs in java application

查看:144
本文介绍了用于调试的工具在java应用程序中挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个java应用程序,有一半时间只是挂起,而另一半JVM崩溃了。有没有一个工具我可以用来看看是什么让它挂起和/或崩溃?
我正在使用CentOS 5.6

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 crash? I'm using CentOS 5.6

推荐答案

有两种不同的情况。

应用程序崩溃:
这是一个OOM吗? NPE?有什么例外?如果有jvm崩溃,你会看到hs_err_.log( http:// java。 sun.com/j2se/1.5/pdf/jdk50_ts_guide.pdf

查看文件,您可能会看到自己的JNI是否导致崩溃或JVM错误。

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

应用程序挂起:我将从visualvm或jstat开始(两者都是JDK的一部分)。你可以看到线程的当前状态并检查是否有任何应用程序错误..

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..

其他linux工具可以帮助查看内部进程:

Other linux tools that could help to see inside process:


  • lsof :你可以检查进程是否打开了太多文件

  • strace :从系统调用的角度看当前活动。

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

Oracle工具文档提供了非常整洁的列表。它还链接了特定于操作系统的工具

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

这篇关于用于调试的工具在java应用程序中挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆