本文介绍了jvisualvm没有列出某些Java进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得某个Java进程的堆转储(可疑的内存泄漏)。但是,当我启动jvisualvm工具时,我看不到任何正在运行的Java进程。

I want to get a heap dump (suspected memory leak) of a certain Java process. However, when I start the jvisualvm tool, I cannot see any of the running Java processes.

我已经谷歌了解了这个并且已经找到了几篇文章说你必须使用启动jvisualvm工具的相同JDK来运行Java进程,以便能够看到它们。但是,据我所知,情况已经如此。我在本地做所有事情(我可以​​远程访问机器)。

I have Google'd around about this and have already found a couple of articles saying that you have to run the Java processes using the same JDK that you start the jvisualvm tool with in order for it to be able to see them. However, as far as I can see, this is already the case. I'm doing everything locally (I have remote access to the machine).

需要考虑的几件事情:


  1. 进程在防火墙的Windows 2008服务器上运行

  2. 使用重命名的版本的JDK <$运行进程c $ c> java.exe 可执行文件

  3. 据我所知,进程正在使用1.6.0_18 JDK运行

  4. 其中一个正在运行的进程启动RMI注册表

  1. The processes are running on a firewalled Windows 2008 server
  2. The processes are running using renamed versions of the JDK java.exe executable
  3. As far as I can see the processes are running using the 1.6.0_18 JDK
  4. One of the running processes starts an RMI registry

我正在等待服务器的虚拟副本,所以我可以弄乱用它(这是一个生产服务器)。但与此同时;关于为什么我看不到jvisualvm(或jconsole)中的任何进程的任何想法?

I'm waiting on a virtualized copy of the server so I can mess around with it (this is a production server). But in the meanwhile; any ideas as to why I cannot see any of the processes in jvisualvm (or jconsole for that matter)?

推荐答案

以后我好做了一点研究,看来彼得的评论是正确的。由于JVM进程是由另一个用户启动的(NETWORK SERVICE帐户,因为它们是由Windows服务启动的),因此它们没有显示在jvisualvm中。

Well after I did a little research, it would appear that Peter's comment was correct. Because the JVM processes were launched by another user (the NETWORK SERVICE account because they were being started by a Windows service) they didn't show up in jvisualvm.

由于我可以访问应用程序配置,因此我找到了以下解决方法,其中涉及为目标JVM显式启用不安全的JMX:

Since I have access to the application configuration, I have found the following workaround, which involves explicitly enabling unsecured JMX for the target JVM:


  1. 添加以下JVM参数:

  1. Add the following JVM parameters:

-Dcom.sun.management。 jmxremote.port = 3333 -Dcom.sun.management.jmxremote.ssl = false -Dcom.sun.management.jmxremote.authenticate = false

单击文件 - >添加JMX连接,使用JMX将远程进程添加到jvisualvm。您可以使用端口3333连接到该进程。显然,您可以根据需要更改端口。

Add the remote process to jvisualvm using JMX by click File -> Add JMX Connection. You can connect to the process using port 3333. Obviously you can change the port if you want.

链接到更详细解释这一点的文章


  1. 永久保留JVM设置可能,因为它们允许任何人通过JVM连接到JVM JMX。

  2. 如果需要,您还可以向JMX JVM参数添加身份验证。

  1. It's probably not a good idea to keep the JVM settings permanently, as they would allow anyone to connect to the JVM via JMX.
  2. You can also add authentication to the JMX JVM parameters if you want to.

这篇关于jvisualvm没有列出某些Java进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 05:27