Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jvisualvm hangs when profiling a local process

when I use jVisualVM, I see two local processes: VisualVM itself and the process I am interested in let's call it ProcessX. When I doubleClick the VisualVM process, everything works fine. When I doubleclick ProcessX, the application is stuck and doesn't correspond anymore. I use eclipse to run my java application, and I have a stand-alone version of jVisualVM on a Windows x64 box. I run jVisualVM from "C:\Program Files\Java\jdk1.7.0_51\bin". Setting the Proxy to "No Proxy" in the VisualVM menu didn't help me either

like image 943
Vjeetje Avatar asked Mar 09 '14 22:03

Vjeetje


People also ask

How to set up the running JVM process in VisualVM?

First, Let's run Java VisualVM and connect it to a JVM process running on the local machine. 1. To set up the running JVM process, we can my simple test program called LongSleep.java: /* LongSleep.java #- Copyright (c) 2015, HerongYang.com, All Rights Reserved.

How to enable jvisualvm to collect stats of application on remote server?

To enable JVisualVM to collect stats of application hosted on a remote server, we have to run our application with jmx system properties. They are as follows: com.sun.management.jmxremote.port to specify the port number through which the application will be exposed

What is the jvisualvm utility?

What Is the JVisualVM? This is one of the useful, free utilities that come in the JDK bundle. It's basically a JMX client application. This utility shows stats like memory used, heap data, garbage collector, and CPU profiling.

What does it mean when VisualVM says local application not running?

Description: An error dialog saying that local applications cannot be monitored is shown immediately after VisualVM startup. Locally running Java applications are displayed as <Unknown Application> (pid ###). Resolution: This can happen on Windows systems if the username contains capitalized letters.


1 Answers

There can often be a DNS resolution issue if the process you're trying to connect to using VisualVM is running on localhost. If that's the case, try adding the following system property to the process you're trying to connect to:

 -Djava.rmi.server.hostname=localhost

See also: https://stackoverflow.com/a/6782309/80144 and Has anyone ever got a remote JMX JConsole to work?

like image 65
Lyle Avatar answered Sep 18 '22 23:09

Lyle