Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jvisualvm - automatically (JMX) reconnect to application?

Is there any way to reconnect disconnected JMX connection in jvisualvm? When monitored JMX enabled application restarts, I have to restart jvisualvm to reconnect it. Am I missing something?

Here are my jvisualvm details:

Version: 1.6.0_22 (Build 100326); platform 091221-4fc006d17cb1
System: Linux (2.6.35-23-generic) , amd64 64bit Java: 1.6.0_22; Java HotSpot(TM) 64-Bit Server VM (17.1-b03, mixed mode)

like image 354
Michał Kowalczuk Avatar asked Jan 13 '11 10:01

Michał Kowalczuk


People also ask

How add JMX connection to VisualVM?

In Java VisualVM's Applications window, right click on the Local machine and select 'Add JMX Connection'. The Add JMX Connection dialog box opens. The host name localhost is already filled in. You only need to add the port number on which the application is exposed for monitoring and management.

Is JMX enabled by default?

Local JMX access If you are using a Java SE 6 or later JVM, local JMX management and monitoring are most likely enabled by default.

How do I connect to a VisualVM remote server?

Connecting to a Remote Host To add a remote host, right-click the Remote node in the Applications window, choose Add Remote Host and type the host name or IP address in the Add Remote Host dialog box. (You can also specify a display name that will be used to refer to the host when listed under the Remote node.)

What is the difference between JConsole and VisualVM?

JConsole uses only JMX, but VisualVM uses other monitoring technologies like Jvmstat, Attach API and SA in addition to JMX. It can merge data from all those monitoring technologies in one place and the user does not need to think which technology he should use in particular situation.


2 Answers

there is JIRA for that feature: https://java.net/jira/browse/VISUALVM-120

like image 123
Marcin Avatar answered Nov 07 '22 15:11

Marcin


At least in the current version (1.8.0_45 (Build 1380-140910)), if you check the "Save security credentials" checkbox in the "Add JMX Connection..." dialog, it will attempt to reconnect to the remote server when visualvm is next started. So, if you get disconnected, you can quit out of visualvm and relaunch it in order to reconnect. I know that's not quite what you were asking for, but at least it works. The fact that the feature you were hoping for still hasn't been implemented over 10 years after it was first requested is pretty sad. My guess is that they're trying to get people to buy Mission Control instead.

The original issue for this at java.net no longer exists, but this appears to be the equivalent on GitHub. Go give it a thumbs up if you care about it being completed/fixed.

like image 27
Matt Passell Avatar answered Nov 07 '22 15:11

Matt Passell