Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using VisualVM with AdoptOpenJDK and OpenJ9

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?

like image 364
user3726374 Avatar asked Jan 26 '23 23:01

user3726374


1 Answers

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.

like image 129
Tomas Hurka Avatar answered May 16 '23 07:05

Tomas Hurka