3

I'm a new user of VisualVM; nice tool, but i'm currently not able to use the profile and check what variables are allocated. Here is the problem.

In order to use the profile i have to make a calibration, that was not done at the first VisualVM start. First, i tried to go in Tools/Options on the main menu, then I've clicked on Manage. After this i've selected the JDK i'm currently using with my Eclipse Kepler IDE. The selected file is located in G:\JavaJdk\jdk1.7.0_67\bin\java.exe.

When i click on calibrate, VisualVM stucks saying "Connecting to the target VM". Nothing happens: by clicking on Cancel in get an empty window that says "Data transfer error during instrumentation calibration", and after this another window titler "Error" with no error displayed.

Launching a java process and clicking on it from the main VisualVM window I'am able to click on the Profiler Tab: clicking on the Memory button it says that a calibration must be performed, so i click the Ok button but it stucks again at the connection step. Clicking on Cancel i get the same data transfer error, and then "Profile calibration data file does not exists", the machinedata.jdk17 file cannot be found.

My OS is Windows XP, and the VisualVM version is 1.3.8. I've closed sjype, antivirus, Apache, and disabled windows firewall Please tell me if you need any detail.

mark
  • 939
  • 2
  • 13
  • 36
  • 1
    So it gets stuck on "Connecting to the target VM".. hmm, perhaps you could use VisualVM to connect to the JVM and take some thread dumps of the VisualVM process to troubleshoot the hanging issue. Just joking :D How about trying to connect to a JRE instead of the java.exe within your JDK folder? Also, did you define a JAVA_HOME environment variable? Usually the calibration starts without having to manually point to a local JRE/JDK. – the_marcelo_r Sep 09 '14 at 15:57
  • Nothing happend pointing to JRE :( – mark Sep 09 '14 at 16:03
  • Perhaps this VisualVM version is not playing well with your OS, did you try to download an older version? If you are not so attached to VisualVM, you could also try JRockit Mission Control (aka: Java Mission Control), the interface presents way more profiling/reporting options. – the_marcelo_r Sep 09 '14 at 16:05
  • Same problem on Windows 7. VisualVM can attach to processes for sampling and that works fine, but it cannot calibrate the VM and cannot start profiling because of that. – Valentyn Danylchuk Jul 31 '16 at 10:41
  • Maybe this is related to the problem described in http://stackoverflow.com/questions/39858872/visualvm-calibration-step-hangs-with-windows-10 – Daniel Beer Mar 09 '17 at 19:05

2 Answers2

2

Try to use VisualVM 1.3.7, which was released before Windows XP support was discontinued. You can download VisualVM 1.3.7 here

Lonzak
  • 9,334
  • 5
  • 57
  • 88
Tomas Hurka
  • 6,723
  • 29
  • 38
2

I had the same problem on Windows 7 with JDK 8. What finally helped me is to start the Profiler Agent manually, as described in this post in German.

  • Notice the ProfilerServer and its PID in VisualVM java process list when it tries to start the calibration.
  • Look up the full command line in procexp.exe or some other tool. In my case, it was:

    "C:\Program Files\Java\jdk1.8.0_91\bin\java.exe" "-agentpath:C:/Program Files/VisualVM/profiler/lib/deployed/jdk16/windows-amd64/profilerinterface.dll" "-Xbootclasspath/a:C:\Program Files\VisualVM\profiler\lib\jfluid-server.jar;C:\Program Files\VisualVM\profiler\lib\jfluid-server-15.jar" org.netbeans.lib.profiler.server.ProfilerServer "C:/Program Files/VisualVM/profiler/lib/deployed/jdk16/windows-amd64" 5141 10 ____Profiler+Calibration+Run____

  • Run that exact command line manually.

  • Start VisualVM, go to Tools -> Options -> Manage, run the calibration, it should work.
  • I got it working just by copy/pasting the full command line from your post, and editing the paths to match the ones on my system. – amarillion Oct 27 '16 at 13:14