The Source for Java Technology Collaboration
User: Password:



Mandy Chung's Blog

May 2006 Archives


JConsole will be supported in Mustang

Posted by mandychung on May 22, 2006 at 12:18 PM | Permalink | Comments (4)

Here are the slides of the JConsole BOF that Leif Samuelsson and Jean-Francois and I gave at JavaOne on May 18th. Enjoy!

Using JConsole to monitor and manage your application

JConsole was shipped in Tiger JDK as a demo and experimental tool. In Mustang, JConsole becomes a supported tool like the other JDK tools such as java and javac. From the engineering team's perspective, we have been making sure that jconsole is of high quality in the same way as a supported tool. The major effort to make JConsole as a supported tool is to provide accessibility support. Leif Samuelsson, the lead and the author of JConsole, has been putting time in improving JConsole accessibility. We expect more work to put in build 86 which should be available for download in 2 weeks. Try out the Mustang snapshot and send us feedback!



Meet you @ JavaOne 2006

Posted by mandychung on May 15, 2006 at 06:29 PM | Permalink | Comments (4)

I'll be at JavaOne 2006 tomorrow through Friday! It's a great opportunity to meet you all. If you'd like to chat about JConsole, VM monitoring and management, or Java SE serviceability/troubleshooting, come by:
o Java SE Performance & Diagnostic Booth on May 16 (Tue) at 10:30am-12:15pm
o JDK Community (Peabody) Booth #723 "Ask the Expert" area on May 18 (Thur) at 11:00am-12:00pm

I'll be at two BOFs on May 18 (Thur) from 9:30pm to 11:30pm in Moscone Center North Mtg Rm 121/122:
o BOF-0442 Using JConsole to monitor Your Application
o BOF-3051 Using the Tools in JDK 5 and the Java SE 6 Platform to Diagnose Problems and Monitor Applications

Many experts from Java SE will also be at the "Ask the Experts" area. Come chat with them!



Mustang JConsole

Posted by mandychung on May 04, 2006 at 11:55 PM | Permalink | Comments (15)

JavaOne 2006 Conference is coming up soon! Our BOF "Using JConsole to Monitor and Manage Your Application" is on May 18, 2006 at 10:30pm. The 9:30pm BOF (same room) is the JDK Tools BOF. The Java SE serviceability team will be there. It's late at night but hope to see you there. We're going to do a live demo of the Mustang JConsole at the JConsole BOF.

Below gives you a summary of the Mustang JConsole features. Let us know what you think.

JConsole Plugin Support

A new com.sun.tools.jconsole.JConsolePlugin API is added in Mustang. You can build your custom plugin to run with JConsole, for example, to add a new tab to access your application MBeans.

JTop is a JDK demo that shows the thread CPU usage of all threads running in the application. This demo is helpful to identify the threads that has high CPU consumption. It is updated to be used as a standalone GUI as well as a JConsole plugin. To run JConsole with the JTop plugin:

   <JDK6>/bin/jconsole -pluginpath <JDK6>/demo/management/JTop/JTop.jar

To build a JConsole plugin, it's very simple:

1. Create a subclass of JConsolePlugin class and implement the getTab method and also the newSwingWorker method. The getTab method returns the list of tabs to be added to JConsole or an empty list. The newSwingWorker method returns the SwingWorker to be responsible for the plugin's GUI update.

2. Create a file "META-INF/services/com.sun.tools.jconsole.JConsolePlugin" to contain the fully-qualified class name of the plugin class. JConsole uses the service-provider loading facility to look up and load the plugins. You can have multiple plugins - one entry per plugin.

Sundar added a new scripting demo to demonstrate the power of using scripting language with JMX technology and the out-of-the-box manageability. This scripting demo is built as a JConsole plugin. It adds a scripting shell tab in JConsole where you can access MBean attributes or operations using a scripting language. To try, run JConsole as follows:

<JDK6>/bin/jconsole -pluginpath <JDK6>/demo/scripting/jconsole-plugin/jconsole-plugin.jar

Check out the file <JDK6>/demo/scripting/jconsole-plugin/src/resources/jconsole.js for the javascript commands. A few commands for you to start with:

> memory=mbean("java.lang:type=Memory") # to get the MemoryMXBean
> memory.Verbose      # get the value of "Verbose" attribute
> memory.Verbose=true # set the "Verbose" attribute to true
> memory.gc()         # invoke the gc() operation

Dynamic Attach Capability

JConsole can now attach to any applications running on Mustang JDK even if it wasn't started with -Dcom.sun.management.jmxremote option. This dynamic attach capability uses the attach API that Alan Bateman added in Mustang which enables a tool like JConsole to load the management agent in the target VM dynamically. It's a very useful feature and makes JConsole and the out-of-the-box management easier.

UI Improvements

There are many UI improvements in Mustang JConsole. Just to highlight a few: (1) JConsole now is using the system look-and-feel on Windows and Gnome desktop. (2) The connection dialog has been improved for user experience and a new sheet dialog is designed for the progress bar. (3) The thread tab now has a new detect deadlock button that finds the deadlocks involved in object monitors and java.util.concurrent ownable synchronizers. See the blog about "Thread dump and concurrent locks".

Overview Tab and VM Summary Tab

A new overview tab is added in Mustang JConsole to plot multiple charts in one tab to provide an easy way for users to correlate various resource consumption. Previously you would have to switch among several tabs if you want to correlate the data such as memory usage, threads, and CPU usage. Another improvement is that we merge the Summary tab and VM tab into one single "VM Summary" tab where you can cut-and-paste the selected text into a report file.

JMX MBean Metadata and Descriptor

JMX Descriptor provides a convenient way to add additional metadata to your MBeans. Mustang JMX supports descriptors for all types of MBeans. Eamonn's blog describes an easy way to add descriptors to your MBeans. Mustang JConsole makes the MBean metadata and descriptor information visible in the MBean tab.

HotSpot Diagnostic MBean

Mustang adds a HotSpot Diagnostic MBean (see com.sun.management.HotSpotDiagnosticMBean) which provides an API to request heap dump at runtime and also change the setting of certain VM options. You can access the HotSpot Diagnostic MBean via JConsole MBean tab. See Sundar's blog about setting VM options and my blog about diagnosing memory problems.

Try the latest version of Mustang JConsole and send us feedback!





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds