5

I can monitor applications with VisualVM if I use the AdoptOpenJDK HotSpot build for Java8. If I use the OpenJ9 build, VisualVM displays the error "Local applications cannot be detected".

Did anybody get VisualVM to work with OpenJ9?

user3726374
  • 583
  • 1
  • 4
  • 24

1 Answers1

11

OpenJ9 is a lot different from HotSpot in monitoring area. So if you want to monitor OpenJ9, you have to use JMX. Start your OpenJ9 with JMX enabled. For simple configuration you can use following system properties:

java -Dcom.sun.management.jmxremote.port=9999 \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false

Start VisualVM on AdoptOpenJDK and add a local JMX connection on the port 9999 - right click on the 'Local' node and select 'Add JMX connection'. Use 'localhost:9999' as a connection string.

Tomas Hurka
  • 6,723
  • 29
  • 38
  • Thanks, that did work for me. A note though: I could only start VisualVM using the hotspot jdk from AdoptOpenJDK. OpenJ9 did not startup properly. – user3726374 Aug 28 '19 at 06:22
  • Right, As specified in my answer, VisualVM have to run on HotSpot based JDK (OpenJDK, OracleJDK, AdoptOpenJDK, Corretto, etc.). – Tomas Hurka Oct 30 '19 at 12:59
  • When I start a Java program under IntelliJ it's not shown in standalone VisualVM 2.0.1 with openjdk 12.0.1? – powder366 Apr 05 '20 at 13:50