36

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

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:

enter image description here

All three of the programs shown are running with the same JVM with the same 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.

jwl
  • 10,268
  • 14
  • 53
  • 91
  • There is a particular https:// connection this program makes to an external site. When I turn this functionality off (so no requests are made), then I get all my tabs in VisualVM. Hmm.... – jwl Apr 15 '13 at 22:16

8 Answers8

24

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.

user613114
  • 2,731
  • 11
  • 47
  • 73
  • Were you able to do it for a remote application as well (my profile tab is not showing up for remote app, only local) ? thanks – Diego Ramos Jan 29 '21 at 00:14
  • @DiegoRamos VisualVM doesn't support profiling of remote applications: https://docs.oracle.com/javase/8/docs/technotes/guides/visualvm/applications_remote.html – user613114 Jan 29 '21 at 12:33
13

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

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

Farzad
  • 1,132
  • 9
  • 21
  • 1
    these are all local programs -- does this still apply? – jwl Apr 15 '13 at 19:49
  • I once wanted to profile my local jboss and in that case yes it did make a difference. I don't remember if I had to add the jmx port to VisualVM or it found it itself. – Farzad Apr 15 '13 at 19:51
  • I've tried all the suggested answers (verified that jvisualvm uses the same java version as application, deleted ~/.visualvm folder, no proxy) but only this one worked, even though jvisualvm and app were running on the same machine. – streetturtle May 04 '17 at 18:12
5

I've just removed ~/.visualvm and reran, See https://java.net/jira/browse/VISUALVM-598

gavenkoa
  • 45,285
  • 19
  • 251
  • 303
3

As most of the people mentioned, The issue was due to the version mismatch of virtualvm and your application.

additionally, visualvm is bundled in oracle which supports jdk up to 9. If you are using >9, please make sure you go for another profiler.

1

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.

TMN
  • 3,060
  • 21
  • 23
0

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

Liju John
  • 1,749
  • 16
  • 19
0

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

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 Control profiling tool (JMC + Flight Recorder) which is a part of standard Oracle JDK (from JDK 1.7 update 40) and it works great.

BlackBeard
  • 10,246
  • 7
  • 52
  • 62
0

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_79 to 1.7.0_80 fixes the problem.