使用JConsole等连接到冻结的jvm

时间:2016-03-28 12:36:56

标签: java tomcat jvm jconsole yourkit

我们正在尝试分析在生产中运行的远程tomcat应用程序。问题是Web池中的所有线程都被阻塞,这似乎阻止我们连接jconsole,jmc甚至YourKit。当jvm正常运行时,所有这些工具都能正常工作。

jconsole的错误是超时:

Could not connect to server1:9090 : Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is: 
java.net.SocketTimeoutException: Read timed out]
Could not connect to server1:9090. Make sure the JVM is running and that you are using the correct protocol in the Service URL (service:jmx:rmi:///jndi/rmi://server1:9090/jmxrmi).

这使我们很难弄清楚我们的应用程序出了什么问题。服务器不使用太多CPU,并且有可用内存。所以没有明显缺乏资源。 jvm似乎已经死了

Java版:jdk1.7.0_75 Tomcat版本:7.0.65

有关如何连接到jvm的任何想法是这样的吗?

1 个答案:

答案 0 :(得分:0)

您有几个选择:

  1. 发送SIGQUIT(Linux)或Control-Break(Windows)并获取堆栈 跟踪。
  2. 获取核心转储(Linux上的gcore)然后您可以使用JVM 使用核心文件的jstack和朋友等工具