Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VisualVM: CPU/Memory profiler stuck at "Connecting to the target JVM..."

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?

like image 335
Jire Avatar asked Jun 04 '16 16:06

Jire


People also ask

Does VisualVM work with Java 11?

Use VisualVM bundled with GraalVMGraalVM contains a fully compliant Java SE 8, Java SE 11, and Java SE 17 JDK distribution based on Oracle JDK and OpenJDK. It features an innovative JIT compiler which may noticeably improve performance of Java applications, compared to the standard Oracle JDK or OpenJDK.

Is VisualVM included in JDK?

Various optional tools, including Java VisualVM, are provided with the Java Development Kit (JDK) for retrieving different types of data about running JVM software instances.

What is profiler in VisualVM?

Java VisualVM enables you to take profiler snapshots to capture the results of a profiling session. A profiler snapshot captures the results at the moment the snapshot is taken. To take a snapshot, click the Take Snapshot of Collected Results button in the toolbar while a profiling session is in progress.

How do I monitor VisualVM?

Under the Local node in the Applications window, right-click the application node and choose Open to open the application tab. Click the Profiler tab in the application tab. Click Memory or CPU in the Profiler tab. When you choose a profiling task, VisualVM displays the profiling data in the Profiler tab.


1 Answers

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"

like image 119
ievgen Avatar answered Oct 03 '22 22:10

ievgen