jvisualvm hangs when profiling a local process
Asked Answered
M

2

7

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

Materialism answered 9/3, 2014 at 22:30 Comment(3)
Do you have any special JVM parameters for the process to check (ProcessX)?Eratosthenes
No I don't have any special JVM parameters set.Materialism
have this problem too, did you manage to fix it?Fineberg
R
10

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://mcmap.net/q/175253/-connecting-remote-tomcat-jmx-instance-using-jconsole and Has anyone ever got a remote JMX JConsole to work?

Ruder answered 18/12, 2014 at 18:5 Comment(1)
That worked for me thanksMakings
F
0

I had absolutely the same problem and I hope my solution will help someone else.

The problem and solution: My system is x64, but I ran Intellij Idea file "idea.exe" (this is default exe file. And it's for x32 system) and I ran Java app from IDE. jVisualVM couldn't connect to it, because I installed x64 jdk. When I realize my mistake and run idea64.exe - the problem was resolved. I can open any java process that I run from IDE.

So if you have x64 system - download and run proper version of eclipse.

Fritter answered 16/6, 2015 at 14:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.