41

I have recently reinstalled Windows and I am using JDK 1.8 u91 with the built-in VisualVM. I have checked my proxy settings to ensure that they are all off, both in Windows proxy settings and within the proxy settings of VisualVM.

I have also tried reinstalling JDK, restarting computer, reinstalling Windows. I only have one JDK installed and the classpath is set to the JDK's bin folder in Windows.

All features besides CPU and memory profiling work in VisualVM. My application is ran from IntelliJ, but I have also tried running applications regularly from command line and VisualVM cannot connect to those either.

I have also tried downloading VisualVM off http://visualvm.java.net which also does not work.

I have no plugins installed.

Why does it hang? Is this is a bug introduced with the new JDK?

Jire
  • 9,680
  • 14
  • 52
  • 87

2 Answers2

54

See this bug report - VISUALVM-637

Solution: start JVisualVM using below command :

jvisualvm.exe -J-Dorg.netbeans.profiler.separateConsole=true

I've checked this (and it works !) at Windows 10 X64 with java version "1.8.0_102"

Satyam
  • 703
  • 6
  • 20
ievgen
  • 1,081
  • 11
  • 20
  • 1
    This worked for me after hours of trying all other options and combos of those other option. thanks ievgen – arnzzz Oct 07 '16 at 04:03
  • made it work for me too, using jvisualvm of JDK 1.8.0_92 on Windows 7 – GreenThor Dec 16 '16 at 08:14
  • 4
    this is working for me. I use visualvm.exe from the plugin in IntelliJ. I added the argument above into the **\jdk1.8.0_121\lib\visualvm\etc\visualvm.conf** file. Thanks for this. – arnzzz Mar 07 '17 at 06:19
  • 1
    Worked for me too. Windows 10 with the x63 version of jdk1.8.0_102. – praneetloke May 19 '17 at 14:02
  • 1
    Worked for me, too. I started my Spring Boot app in IntelliJ as normal, opened an Admin CMD prompt and executed `jvisualvm.exe -J-Dorg.netbeans.profiler.separateConsole=true` and all is good. – Mark Jun 29 '17 at 10:46
  • Doing `jvisualvm.exe -J-Dorg.netbeans.profiler.separateConsole=true` solved the problem as stated, but I then ran into the error referred to in https://stackoverflow.com/questions/26834651/redefinition-failed-with-error-62-while-trying-to-profile-an-application ; see that link for the solution. – Don Smith Dec 23 '18 at 19:40
3

Try starting the (local) application to observe with additional:

-Djava.rmi.server.hostname=localhost
Alim Özdemir
  • 2,396
  • 1
  • 24
  • 35