当您启动 jconsole 或 VisualVM 时,它们会向您显示可以附加和监视的“本地运行的 Java 应用程序”列表。
它如何知道本地运行的应用程序存在哪些?
最佳答案
引自VisualVM documentation (它在何时需要显式 JMX 连接?部分中进行了描述,并且涉及本地实例):
Java VisualVM discovers running applications using the
jps
tool (Solaris, Linux, or Mac OS X or Windows), which can only discover Java applications started by the same user as the one who starts the Java VisualVM tool.
有关如何操作的信息 jps
例如,发现本地虚拟机位于 this 中所以回答。简而言之,它扫描 /tmp/hsperfdata_<username>
目录,JVM 实例在其中生成信息文件。
关于java - jconsole/visualvm如何知道本地运行的java应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60944189/