JConsole plugin for VisualVM Preview 2
By lmalvent on Nov 24, 2007
This is an experimental plugin for VisualVM Preview 2 that allows to add the JConsole tool functionality into the VisualVM tool. This new VisualVM plugin provides support for JConsole core tabs as well as custom JConsole plugins for both local and remote Java applications.
The JConsole tab will be enabled - by right-clicking in a given local or remote application and choosing the Open item in the contextual menu - in the following cases:
- local process:
- the local Java application is running on JDK 6 or higher (no special management system property needed)
- the local Java application is running on JDK 5 and has been started with the -Dcom.sun.management.jmxremote system property, e.g.
$ java -Dcom.sun.management.jmxremote MyApp
- remote process:
- the remote Java application is running on JDK 5 or higher and has been started with a specific port for remote management and security has been disabled (both authentication and encryption), e.g.
$ java -Dcom.sun.management.jmxremote.port=<port> \\ -Dcom.sun.management.jmxremote.authenticate=false \\ -Dcom.sun.management.jmxremote.ssl=false MyApp
$ visualvm [-J-Djconsole.hidden.tabs=[AOMTCSB]] [-J-Djconsole.plugin.path=<plugin-path>]
Two system properties have been defined by this plugin to control the JConsole core tabs we want to hide and to specify the location of the custom JConsole plugins.
- A = All core tabs
- O = Overview tab
- M = Memory tab
- T = Threads tab
- C = Classes tab
- S = VM-Summary tab
- B = MBeans tab
where <plugin-path> specifies the paths of JConsole plugins to look up which can be a directory or a jar file. Multiple paths are separated by the path separator character of the platform.
If you want to play with it just download the org-netbeans-modules-management-jconsole.nbm NBM file from here and install it. In order to install it choose Tools > Plugins from the main menu of VisualVM, go to the Downloaded tab and click on the Add Plugins button. Specify the location where you stored the JConsole NBM file and click on the Install button.
Find here below some examples of use:
- VisualVM running with JConsole plugin with all JConsole core tabs:
- VisualVM running with JConsole plugin with all JConsole core tabs and JTop custom plugin:
$ visualvm -J-Djconsole.plugin.path="C:\\Program Files\\Java\\jdk1.6.0_10\\demo\\management\\JTop\\JTop.jar"
- VisualVM running with JConsole plugin without JConsole core tabs and JTop custom plugin:
$ visualvm -J-Djconsole.plugin.path="C:\\Program Files\\Java\\jdk1.6.0_10\\demo\\management\\JTop\\JTop.jar" \\ -J-Djconsole.hidden.tabs=A
- VisualVM running with JConsole plugin without Overview/Memory/Classes/VMSummary/MBeans JConsole core tabs and JTop custom plugin:
$ visualvm -J-Djconsole.plugin.path="C:\\Program Files\\Java\\jdk1.6.0_10\\demo\\management\\JTop\\JTop.jar" \\ -J-Djconsole.hidden.tabs=OMCSB