java 为什么 VisualVM 不显示所有正常选项卡?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16023507/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 21:39:42  来源:igfitidea点击:

Why isn't VisualVM showing all the normal tabs?

javavisualvmjvisualvm

提问by jwl

Usually I see all these tabs in VisualVM for locally running Java programs:

通常我会在 VisualVM 中看到所有这些用于本地运行 Java 程序的选项卡:

enter image description here

在此处输入图片说明

However, I have one local program which is currently only showing me Overview and Monitor (even though it usually shows all those shown above):

但是,我有一个本地程序,它目前只显示概览和监控(尽管它通常显示上面显示的所有内容):

enter image description here

在此处输入图片说明

Also interesting is that VisualVM itself doesn't present the Profile tab:

同样有趣的是 VisualVM 本身不显示 Profile 选项卡:

enter image description here

在此处输入图片说明

All three of the programs shown are running with the same JVM with the same Java Home.

显示的所有三个程序都在同一个 JVM 和同一个 Java Home 上运行。

What controls which tabs are shown for a particular program? How can I get them all back for my program showing just Overview and Monitor?

什么控制为特定程序显示哪些选项卡?我怎样才能让他们全部回到我的程序中,只显示概述和监控?

I have Visual VM 1.3.5 (latest at this date) and JDK 1.7.0_17.

我有 Visual VM 1.3.5(目前最新)和 JDK 1.7.0_17。

回答by user613114

I found that this was the issue of usage of wrong JDK version. In my case my application was running on 64bit JDK and I started VisualVM from 32bit JDK. After starting VisualVM from the same JDK on which my application is running, everything was fine. Hope it will help you.

我发现这是使用错误的JDK版本的问题。就我而言,我的应用程序在 64 位 JDK 上运行,而我从 32 位 JDK 启动 VisualVM。从运行我的应用程序的同一个 JDK 启动 VisualVM 后,一切正常。希望它会帮助你。

回答by Farzad

You might need to enable jmx ports on your app. Try adding these switches to your VM and see if the tabs appear again:

您可能需要在您的应用程序上启用 jmx 端口。尝试将这些开关添加到您的 VM,看看这些选项卡是否再次出现:

-Dcom.sun.management.jmxremote.port=6789 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false

-Dcom.sun.management.jmxremote.port=6789 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false

回答by gavenkoa

I just remove ~/.visualvmand rerun, See https://java.net/jira/browse/VISUALVM-598

我只是删除~/.visualvm并重新运行,请参阅https://java.net/jira/browse/VISUALVM-598

回答by TMN

What worked for me was specifying the "Start profiling from" classes. If I left this blank, I didn't get the profiler tab. When I specified it, I did. I should probably note that this was a web application running under Tomcat, so I specified org.apache.catalina.startup.**as the starting class.

对我有用的是指定“开始分析”类。如果我把这个留空,我就没有得到探查器选项卡。当我指定它时,我做到了。我可能应该注意到这是一个在 Tomcat 下运行的 Web 应用程序,所以我指定org.apache.catalina.startup.**为起始类。

回答by Liju John

Check that proxy is disabled if you are running VisualVM for local application

如果您为本地应用程序运行 VisualVM,请检查代理是否已禁用

回答by Tom Novosad

I had a similar problem with missing profiler tab in VisualVM. I'm using Oracle JDK 1.8 and want to profile web application running on Tomcat 8 (JPA, Spring, Hibernate, Vaadin, etc).

我在 VisualVM 中缺少分析器选项卡时遇到了类似的问题。我正在使用 Oracle JDK 1.8 并希望分析在 Tomcat 8(JPA、Spring、Hibernate、Vaadin 等)上运行的 Web 应用程序。

I tried all above-mentioned solutions and many others found on the internet, but unfortunately, none of them solved missing profiler tab issue.

我尝试了所有上述解决方案以及在互联网上找到的许多其他解决方案,但不幸的是,它们都没有解决缺少分析器选项卡的问题。

So I switched to Java Mission Controlprofiling tool (JMC + Flight Recorder) which is a part of standard Oracle JDK (from JDK 1.7 update 40) and it works great.

所以我切换到Java Mission Control分析工具(JMC + Flight Recorder),它是标准 Oracle JDK(来自 JDK 1.7 更新 40)的一部分,并且效果很好。

回答by MedAymen Houissa

In my case, the issue was the usage of wrong JDK version. My App was running on jdk1.7.0_80, VisualVm running with jdk1.8.0_162. Replacing the APP JDK version from 1.7.0_79to 1.7.0_80fixes the problem.

就我而言,问题是使用了错误的 JDK 版本。我的应用程序在 jdk1.7.0_80 上运行,VisualVm 在 jdk1.8.0_162 上运行。将 APP JDK 版本从1.7.0_79 替换1.7.0_80修复了该问题。