Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

visualvm cannot see a java process launched from cygwin

If I start a java process in a cygwin console, and then launch visualVm, the later cannot see the former.

If I start the same process in a Dos console visualvm sees it fine. I am in jdk1.6.0_25. This happens both in win7 32b, and in win7 64b with a 64b jvm.

Anyone can think of an explanation/workaround?

like image 596
Persimmonium Avatar asked Jul 13 '11 09:07

Persimmonium


People also ask

How do I access Java VisualVM?

You can access VisualVM from the bin directory of the JDK: On a Windows system, start VisualVM by double-clicking jvisualvm.exe. You can also select VisualVM from the Start menu (if Windchill shortcuts are installed). On other systems, start VisualVM by invoking the jvisualvm script.

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.

Does VisualVM work with OpenJDK?

VisualVM is an open source tool to monitor JVM instances of each running JVM application. Its built-in features can be further enhanced by installing plugins. The users of Oracle JDK or OpenJDK 9 can download this open source tool from https://visualvm.github.io/index.html.

Where can I find VisualVM in JDK?

To find the location of your Java VisualVM userdir, choose Help > About from the main menu and click Details in the About Java VisualVM window.


2 Answers

I fixed the problem by running VisualVM from within Cygwin. If you prefer not to profile using a remote JMX connection, you can run both VisualVM and your Java program using Cygwin:

Open the Cygwin Console window, navigate to visual_vm.exe and run that file from within the Cygwin environment.

like image 105
seanhodges Avatar answered Oct 23 '22 14:10

seanhodges


I had the same problem. The vm was not shown automatically but I was able to connect via "Add JMX Connection", using hostname and jmx.remote.port...

On VisualVM go to File -> Add JMX Connection

localhost:3333

Add vm parameter at startup e.g.:

 -Dcom.sun.management.jmxremote.port=3333
 -Dcom.sun.management.jmxremote.ssl=false
 -Dcom.sun.management.jmxremote.authenticate=false
like image 33
Laertes Avatar answered Oct 23 '22 14:10

Laertes