<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<title>Mandy Chung&apos;s Blog</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mandychung/" />
<modified>2008-05-06T06:31:56Z</modified>
<tagline></tagline>
<id>tag:weblogs.java.net,2008:/blog/mandychung/294</id>
<generator url="http://www.movabletype.org/" version="3.01D">Movable Type</generator>
<copyright>Copyright (c) 2008, mandychung</copyright>
<entry>
<title>JavaOne 2008</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mandychung/archive/2008/05/javaone_2008_1.html" />
<modified>2008-05-06T06:31:56Z</modified>
<issued>2008-05-06T06:31:51Z</issued>
<id>tag:weblogs.java.net,2008:/blog/mandychung/294.9696</id>
<created>2008-05-06T06:31:51Z</created>
<summary type="text/plain">Meet you at the JavaOne Modularity session and BOF on Wednesday (May 7th) to share more about the Java Module System and OSGi support.  We will show some simple demos of the Java Module System and how a Java module imports an OSGi bundle.</summary>
<author>
<name>mandychung</name>

<email>Mandy.Chung@Sun.COM</email>
</author>
<dc:subject>JavaOne</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mandychung/">
<![CDATA[<p>There are the Java Modularity session and BOF on Wednesday (5/7/2008)at JavaOne:</p>

<p>TS-6185: Modularity in the Java™ Platform<br />
Wednesday 5/7/2008<br />
10:50 AM -11:50 AM</p>

<p>BOF-5032: Modularity in the Java™ Platform<br />
Wednesday 5/7/2008<br />
8:30pm - 9:20pm</p>

<p>At the session, <a href="http://weblogs.java.net/blog/stanleyh/">Stanley</a> and <a href="http://blogs.sun.com/abuckley/en_US/">Alex</a>, the spec leads of JSR 277, will share the technical details of the Java Module System.  At the BOF, we will show some simple demos of the JAM modules and also show a JAM module importing OSGi bundles using the JDK built from the OpenJDK <a href="http://openjdk.java.net/projects/modules/">modules</a> project and then open for Q&A.  Looking forward to meeting you there.</p>

<p>For those who are not attending JavaOne, we will update you in our future blogs.</p>]]>

</content>
</entry>
<entry>
<title>Supporting OSGi Bundles in the Java Module System</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mandychung/archive/2008/04/supporting_osgi.html" />
<modified>2008-04-29T06:43:43Z</modified>
<issued>2008-04-29T06:38:00Z</issued>
<id>tag:weblogs.java.net,2008:/blog/mandychung/294.9628</id>
<created>2008-04-29T06:38:00Z</created>
<summary type="text/plain">A draft specification for supporting OSGi bundles in the Java Module System is made available to the JSR 277 Expert Group to continue the OSGi interoperability discussion.</summary>
<author>
<name>mandychung</name>

<email>Mandy.Chung@Sun.COM</email>
</author>
<dc:subject>J2SE</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mandychung/">
<![CDATA[<p>A draft specification for <a href="http://mail.openjdk.java.net/pipermail/jsr277-eg-observer/2008-April/000262.html">supporting OSGi bundles in the Java Module System</a> is put together based on the past EG discussion in particular the proposals and inputs from Glyn Normington, Richard Hall, and Bryan Atsatt.   It is expected to evolve based on further inputs from the JSR 277 Expert Group.</p>

<p>With the OSGi expertise from the JSR 277 EG and their contributions, we expect that this specification can be finalized soon.  Your feedback is welcome and please send them to jsr-277-comments@jcp.org.</p>

<p>Just to highlight a few main points:<br />
1. One or more module system implementations can run on a single Java virtual machine (e.g. JAM module system and OSGi module system).<br />
2. A Java module can import an OSGi bundle.<br />
3. OSGi bundles are exposed as ModuleDefinitions in the Java Module  System.<br />
4. Other module system can find OSGi bundles via the repository delegation model.<br />
5. OSGi bundles are resolved by the OSGi module system using its own algorithm. </p>

<p>One thing noteworthy:<br></p>

<p>JSR 277 defines the framework and API for the Java Module System and also defines the JAM module system as the default module system implementation for the  Java SE platform and the JAM file format as its distribution format.</p>

<p>JSR 277 Early Draft (EDR2) is being updated to clearly separate the distinction between the Java Module System framework and the JAM module system implementation.   </p>

<p>We recognized the issue with the JSR 277 EDR that didn't clearly separate the framework/abstraction from the JAM module system implementation that led to confusion and also skeptic about the OSGi interoperability support.  Bryan Atsatt also identified and raised this <a href="http://mail.openjdk.java.net/pipermail/jsr277-eg-observer/2008-April/000230.html">concern</a> to the EG.  We hope that the EDR2 will be available in a few weeks after JavaOne.  In the mean time, the draft spec includes some spec clarification relevant for this support.</p>

<p>In addition, Bryan has a nice blog about <a href="http://atsatt.blogspot.com/2008/04/jsr-277-interoperation.html">JSR 277 interoperation</a> that serves very well to set up the context ready for the coming discussion (thanks Bryan).   I'd also like to blog more about this work but probably after JavaOne when I get some time.<br />
</p>]]>

</content>
</entry>
<entry>
<title>JSR 277 and OSGi interoperability</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mandychung/archive/2008/04/jsr_277_and_osg.html" />
<modified>2008-04-18T20:00:01Z</modified>
<issued>2008-04-18T19:54:08Z</issued>
<id>tag:weblogs.java.net,2008:/blog/mandychung/294.9555</id>
<created>2008-04-18T19:54:08Z</created>
<summary type="text/plain">I recently take on a new challenge and am working on the JSR 277 and OSGi interoperability.....</summary>
<author>
<name>mandychung</name>

<email>Mandy.Chung@Sun.COM</email>
</author>
<dc:subject>J2SE</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mandychung/">
<![CDATA[<p>I recently take on a new challenge and join the JSR 277 project working on JSR 277 and OSGi interoperability.  There are lots to learn and I am trying to come up to speed as quickly and effectively as I can.  Thanks to all the interests and excitements around this topic!  I appreciate in advance the participation and contribution from the JSR 277 and 291 Expert Groups and the OSGi experts.</p>

<p>Our goal is to ensure that existing OSGi bundles can be used in Java SE 7.  Like everywhere else, resource has always been tight.  But we are revamping the effort to move forward quickly.</p>

<p>Stay tuned and please be patient with this new member on board :)</p>

<p><i>Digress:</i><br>
Although I won't have time to work on Java SE serviceability, monitoring and management technologies in the near future, I'd still like to meet with you all at <a href="http://java.sun.com/javaone/sf/">JavaOne 2008</a> to talk about these areas.  I highly recommend to check out <a href="https://visualvm.dev.java.net/">VisualVM</a> (the next generation of Java SE troubleshooting GUI tool) at the Java SE booth. Very cool!
<p>
Hope we can show a demo on using VisualVM to monitor and manage Java modules some time soon!]]>

</content>
</entry>
<entry>
<title>New JDK Registration Capability in Java SE 6u5</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mandychung/archive/2008/03/registering_you.html" />
<modified>2008-03-06T23:24:01Z</modified>
<issued>2008-03-06T23:23:50Z</issued>
<id>tag:weblogs.java.net,2008:/blog/mandychung/294.9313</id>
<created>2008-03-06T23:23:50Z</created>
<summary type="text/plain">One of the significant features in the new Java SE 6u5 release is the ability to register the JDK installations through Sun Connection.  You will learn more about this new JDK registration feature in this blog.</summary>
<author>
<name>mandychung</name>

<email>Mandy.Chung@Sun.COM</email>
</author>
<dc:subject>J2SE</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mandychung/">
<![CDATA[<p>JDK product registration is one of the most significant <a href="http://java.sun.com/javase/6/webnotes/ReleaseNotes.html#160_05">features</a> in the new Java SE 6u5 release.  This provides the ability to register the JDK installations through <a href="http://www.sun.com/service/sunconnection/index.jsp">Sun Connection</a>.  Registering the JDK is optional.  We would like the JDK registration to provide mutual <a href="#benefits">benefits</a> to both Sun and the developers. </p>

<h2>JDK Installation Experience</h2>

<p>There is a change in the JDK installation flow for this feature. <br />
<img alt="install.PNG" src="http://weblogs.java.net/blog/mandychung/archive/install.PNG" width="504" height="391" /> </p>

<p>The above is the new panel of the Windows installer at the end of JDK installation. When you click "Finish", the JDK Registration Login page will be opened in a browser.  To complete JDK registration, you will need to login your existing Sun Developer Network (or other Sun online account).  If you do not have an existing account, you can create one during the registration process. After you login and the JDK is registered, you will see a "Thank You" page.</p>

<table>
<tr valign="top">
<td>
<img alt="jdk-register.PNG" src="http://weblogs.java.net/blog/mandychung/archive/jdk-register.PNG"  width="200" height="250" />
<br>
<a href="http://weblogs.java.net/blog/mandychung/archive/jdk-register.PNG" >JDK Registration Login page</a>
</td>
<td>
<img alt="thankyou-page.PNG" src="http://weblogs.java.net/blog/mandychung/archive/thankyou-page.PNG" width="200" height="250" />
<br>
<a href="http://weblogs.java.net/blog/mandychung/archive/thankyou-page.PNG" >Thank You page</a>
</td>
<td>
<img alt="offline-reg-page.PNG" src="http://weblogs.java.net/blog/mandychung/archive/offline-reg-page.PNG" width="200" height="250" />
<br>
<a href="http://weblogs.java.net/blog/mandychung/archive/offline-reg-page.PNG" >Offline JDK Registration Page</a>
</td>
</tr>
</table>

<p>There is an offline JDK registration page located in the JDK install directory (&lt;JDK&gt;\register.html) along with two localized versions (Japanese and simplified Chinese) that allows you to register your JDK any time after installation.</p>

<h2>Technical Details</h2>

<p>The registration process begins after the JDK installation completes where you get the last panel providing the information about JDK registration.  When you click "Finish", the following happens:</p>

<p><b>Step 1:</b><br />
Collect the product registration data about the installed JDK including:</p>

<ul>
  <li>JDK service tag.  See "What is a Service Tag" in my previous <a href="http://weblogs.java.net/blog/mandychung/archive/2008/02/sun_service_tag_1.html">blog</a></li>
  <li>System information including hostname, OS name, version and architecture.</li>
</ul>

<p>The completed list of data being collected is described at the <a href="http://java.sun.com/javase/registration/JDKRegistrationPrivacy.html#what">JDK Product Information page</a>.  In the next release, additional system information may be collected and the JDK Product Information page will be updated accordingly.</p>

<p><b>Step 2:</b><br />
Post the JDK registration data to Sun Connection via https and the data will be temporarily stored in a Sun Connection server until the JDK is registered.  The data will be purged after a short period of time after it is received from the HTTP POST and if the JDK is not registered.</p>

<p><br />
<b>Step 3:</b><br />
Launch the default desktop browser and open the JDK Registration Login  page.  Each JDK registration has a unique identifier which will be passed as part of the URL parameters and the Sun Connection registration web application will use it to look up the registration data it receives from the HTTP POST in step 2.</p>

<p>Thanks to the new <a href="http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html#browse(java.net.URI)">java.awt.Desktop</a> API added in Java SE 6 release which helps the implementation a lot.</p>

<p><i>Known limitation:</i> On Solaris and Linux, the JDK registration implementation is dependent on Gnome libraries. If those libraries are unavailable, the Desktop API is not supported and no browser will be opened.  See the <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/desktop.html">Swing Tutorial</a> for details.</p>

<p><b>Step 4:</b><br />
A new file, &lt;JDK&gt;/register.html, and its localized versions (register_ja.html and register_zh_CN.html) will be generated in the JDK install directory.  We call this file as an offline JDK registration page which combines step 2 and step 3 in an HTML form.  This offline JDK registration page can be used to register your JDK any time.  You may see this page opened in the browser in step 3 if your system doesn't have internet connection or fails to post the registration data in step 2 for example due to the network or firewall configuration.</p>

<p><b>Step 5:</b><br />
Once the browser is launched, the JDK installation process will finish and exit.  At this point, the JDK is not registered until you login your Sun Developer Network account or other Sun online account.  If you do not register, no data will be saved in Sun Connection database.</p>

<h2>JDK Registration and Service Tags</h2>

<p>My previous <a href="http://weblogs.java.net/blog/mandychung/archive/2008/02/sun_service_tag_1.html">blog</a> gave an overview of the Service Tags technology.  Service tag is a digital product identifier to enable product registration.  JDK registration process generates a service tag for the JDK.  The service tag information will then be uploaded to Sun Connection during registration.  If the JDK is installed on a <a href="http://weblogs.java.net/blog/mandychung/archive/2008/02/sun_service_tag_1.html#enable">Service Tags enabled system</a> (i.e. the Service Tags software has been installed on your system), the JDK service tag will be created in the service tag registry and the JDK will be <a href="http://weblogs.java.net/blog/mandychung/archive/2008/02/sun_service_tag_1.html#discover">discoverable</a> with the <a href="https://sunconnection.sun.com/inventory/">Registration Manager client</a> tool.</p>

<p><a name="benefits"><h2>Benefits</h2></a></p>

<p>JDK product registration is part of Sun's larger effort to support registration across its hardware and software products. NetBeans, Glassfish and many other Sun products also provide the ability to register the products.  You can track and manage your registered products at <a href="https://sunconnection.sun.com/inventory">Sun Inventory Channel</a>.  Sun Inventory Channel is one of the <a href="http://www.sun.com/service/sunconnection/index.jsp">Sun Connection</a> services and it is a free inventory management portal that provides a centralized repository to organize and manage your deployed products on your systems.</p>

<p>Registering the JDK and other products will enable us to provide faster and efficient services and collaboration, for example:</p>

<ul>
  <li>provide you more customized updates including new releases, security fixes, and news relevant to your deployed products.</li>
  <li>inform you when a change in one version of a product on your system would have an impact on other products you have running (related to performance, compatibility or security, for example).</li>
  <li>enable us to better test and optimize performance for your system.</li>
  <li>effectively communicate our product or service offerings based on the software you have installed on your system.</li>
</ul>

<h2>References</h2>
 
<ul>
  <li><a href="http://java.sun.com/javase/registration/JDKRegistrationPrivacy.html">JDK Product Registration Information</a> (<a href="http://java.sun.com/javase/ja/registration/JDKRegistrationPrivacy.html">Japanese version</a>)</li>
  <li><a href="http://www.sun.com/service/sunconnection/index.jsp">Sun Connection</a></li>
  <li><a href="https://inventory.sun.com/inventory/">Sun Inventory Channel</a></li>
  <li><a href="https://sunconnection.sun.com/FAQ/sc_faq.html">Sun Service Tag FAQ</a></li>
</ul>
]]>

</content>
</entry>
<entry>
<title>Sun Service Tags and Inventory Channel</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mandychung/archive/2008/02/sun_service_tag_1.html" />
<modified>2008-03-06T22:28:27Z</modified>
<issued>2008-02-19T08:05:40Z</issued>
<id>tag:weblogs.java.net,2008:/blog/mandychung/294.9222</id>
<created>2008-02-19T08:05:40Z</created>
<summary type="text/plain">This blog introduces you a Sun Service Tags Technology enabling automatic discovery of the tagged systems, software, and services.  JDK and JRE 6 update 4 will become discoverable when installed on Solaris and Linux service tag enabled systems.</summary>
<author>
<name>mandychung</name>

<email>Mandy.Chung@Sun.COM</email>
</author>
<dc:subject>J2SE</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mandychung/">
<![CDATA[<p>Recently I have been working on a new Java SE project related to a <a href="http://www.sun.com/service/sunconnection/index.jsp">Sun Connection</a> Technology called <b>Service Tags</b>.  I'd like to give a short introduction of the Sun Service Tags technology that you may find various interesting ideas of leveraging it.</p>

<h4>Sun Service Tags</h4>
The Sun Service Tags enable automatic discovery of the <b><i>tagged</i></b> systems and softwares on your systems or a local network.  The JDK and JRE 6 update 4 will become discoverable when installed on Solaris and Linux <a href="#enable">service tag enabled</a> systems.  The Sun Service Tags are not limited for Sun products.  You can create the service tags for your own products (hardwares, softwares, or services)  and leverage the discovery capability for your environment to use. 

<p>Discoverable products are <i>registerable</i> at <a href="#inventory">Sun Connection Inventory Channel</a>.  I'll talk about the JDK product registration next in a couple of weeks.</p>

<h4>What is a Service Tag?</h4>

<p>Sun Service Tag is a XML-based unique identifer of a product instance containing a set of basic information about the product instance on a system.  Below represents a service tag of a JDK instance.</p>

<table style="font-size:80%" cellspacing="1">
<tr bgcolor="lightgray">
  <th align="left">Field</th>
  <th align="left">Value</th>
  <th align="left">Description</th>
</tr>
<tr>
  <td>instance_urn</td>
  <td>urn:st:16f1e569-c583-4190-85ab-42339d984449</td>
  <td>Unique identifier for the product instance</td>
</tr>
<tr  bgcolor="lightgray">
  <td>product_name</td>
  <td>Java SE 6 Development Kit</td>
  <td>Product name</td>
</tr>
<tr>
  <td>product_version</td>
  <td>1.6.0_04-ea</td>
  <td>Product version</td>
</tr>
<tr  bgcolor="lightgray">
  <td>product_urn</td>
  <td>urn:uuid:b58ef9a8-5ae8-11db-a023-080020a9ed93</td>
  <td>Product identifier</td>
</tr>
<tr>
  <td>product_parent_urn</td>
  <td>urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3</td>
  <td>Product parent ID</td>
</tr>
<tr  bgcolor="lightgray">
  <td>product_parent</td>
  <td>Java Platform Standard Edition 6 (Java SE 6)</td>
  <td>Product parent name</td>
</tr>
<tr>
  <td>product_defined_inst_id</td>
  <td>id=1.6.0_04-ea-b07 x86</td>
  <td>Product defined instance ID</td>
</tr>
<tr  bgcolor="lightgray">
  <td>product_vendor</td>
  <td>Sun Microsystems</td>
  <td>Product vendor</td>
</tr>
<tr>
  <td>platform_arch</td>
  <td>x86</td>
  <td>Targeted product architecture</td>
</tr>
<tr  bgcolor="lightgray">
  <td>source</td>
  <td>Windows JDK i586 installer</td>
  <td>Source of the product instance</td>
</tr>
<tr>
  <td>container</td>
  <td>global</td>
  <td>OS container (e.g. Zonename)</td>
</tr>
</table>
<p>
The product_urn field of Sun products is in this format "urn:uuid:" followed with a 32 character long UUID but is not required by Sun Service Tags.  You can also embed additional information about a product besides the basic one in the product_defined_instance_id field.

<p><a name="enable"></a><br />
<h4>Service Tag Enabled System</h4></p>

<p>To enable service tags technology, you need to install the <a href="https://sunconnection.sun.com/inventory/">Service Tags Software</a> that consists of:</p>

<ul>
  <li>Service Tags (ST) Registry: A XML-based registry that contains all service tags on a system locating at <code>/var/sadm/servicetag/registry/servicetag.xml</code> on Solaris and Linux or <code>c:\Program Files\Sun\servicetag</code> on Windows (or [ProgramFilesFolder]\Sun\servicetag if you have a different folder for program files).</li>
  <li>A stclient utility: A command-line utility to add, update, and remove a service tag from the ST registry.</li>
  <li>ST discoverer and listener: Two network services facilitating auto discovery,</li>
</ul>

<h4>Create your own service tag</h4>
Once you enable Service Tags on your system, you can add a service tag for any hardware, software or anything else you want to be tagged.   For example, I have created a service tag for <a href="http://www.skype.com">Skype</a> just as an example by using the <code>stclient</code> utility (I installed Skype on my laptop for making international calls to my mom in Hong Kong) .  You can do it in an interactive mode or with the <code>-a</code> option.

<pre style="font-size:80%">
   c:\Program Files\Sun\servicetag>.\stclient
   > a
   Enter instance URN (optional):
   Enter product (e.g. Sun Web Server): Skype
   Enter version (e.g. 6.1): 3.6
   Enter product URN: A-unique-ID-for-Skype
   Enter product parent URN: A-unique-ID-for-its-parent
   Enter product parent (e.g. JES): Free software
   Enter product defined instance id:
   Enter product vendor (e.g. Sun): Skype
   Enter platform arch  (e.g. SPARC): x86
   Enter container (e.g. zone 0): global
   Enter source (e.g. genesis patch): SkypeSetup.exe
   Skype 3.6 added
   Product instance URN=urn:st:1f158110-de82-11dc-a0f1-000f1f14443e
   Press enter to continue
</pre>

<p><code>stclient</code> will create an entry in ST registry containing the given information and it will assign a product instance URN if not specified.  You can run the <code>stclient -g -i</code> command to get the service tag of a given product instance URN or <code>stclient -x</code> to view all service tags in the ST registry.  Below is the XML entry in the ST registry I added for Skype.</p>

<pre style="font-size:80%">
  &lt;service_tag&gt;
    &lt;instance_urn&gt;urn:st:1f158110-de82-11dc-a0f1-000f1f14443e&lt;/instance_urn>
    &lt;product_name&gt;Skype&lt;/product_name&gt;
    &lt;product_version&gt;3.6&lt;/product_version&gt;
    &lt;product_urn&gt;A-unique-ID-for-Skype&lt;/product_urn&gt;
    &lt;product_parent&gt;Free software&lt;/product_parent&gt;
    &lt;product_parent_urn&gt;A-unique-ID-for-its-parent&lt;/product_parent_urn&gt;
    &lt;product_defined_inst_id&gt;&lt;/product_defined_inst_id&gt;
    &lt;product_vendor&gt;Skype&lt;/product_vendor&gt;
    &lt;platform_arch&gt;x86&lt;/platform_arch&gt;
    &lt;timestamp&gt;2008-02-19 00:32:16 GMT&lt;/timestamp&gt;
    &lt;container&gt;global&lt;/container&gt;
    &lt;source&gt;SkypeSetup.exe&lt;/source&gt;
    &lt;installer_uid&gt;0&lt;/installer_uid&gt;
  &lt;/service_tag&gt;
</pre>

<p><a name="discover"></a><br />
<h4>Discovery</h4></p>

<p>To discover the tagged products on your system, you can start the <a href="https://sunconnection.sun.com/RegistrationClient/client.jnlp">Registration Manager client</a> tool (a Java web start application also available at <a href="https://sunconnection.sun.com/inventory">https://sunconnection.sun.com/inventory</a>).</p>

<p>ST discoverer and listener services allow the system to be discovered via the Registration Manager client tool.  These network services only communicate the service tag information with the Registration Manager client tool and do not communicate with any other services on your system.</p>

<p>These are the screenshots of the Registration Manager client tool looking up the tagged products on my laptop:</p>

<table border="0">
<tr>
<td>
<a href="http://weblogs.java.net/blog/mandychung/archive/regclient.PNG" onclick="window.open('http://weblogs.java.net/blog/mandychung/archive/regclient.PNG','popup','scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img alt="regclient.PNG" src="http://weblogs.java.net/blog/mandychung/archive/regclient.PNG" width="300" height="250" /></a>
</td>
<td>
<a href="http://weblogs.java.net/blog/mandychung/archive/regclient-2.PNG" onclick="window.open('http://weblogs.java.net/blog/mandychung/archive/regclient-2.PNG','popup','scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img alt="regclient.PNG" src="http://weblogs.java.net/blog/mandychung/archive/regclient-2.PNG" width="300" height="250" /></a>
</td>
</tr>
</table>

<p>The first screenshot shows that you can configure the Registration Manager client tool to perform the discovery on a local subnet or one or more specified systems.  Note that the Registration Manager performs no communication with Sun until you decide to perform the "registration" step.  I will blog about product registration later.</p>

<p>The second screenshot shows the list of tagged products on your system including my tagged Skype. Several Sun hardware and software products including JDK and NetBeans IDE are discoverable and more are being added over time. A service tag for the Windows OS is also created as part of the Service Tags software installation. </p>

<p><a name="inventory"><h4>Inventory Channel</h4></a><br />
<a href="https://sunconnection.sun.com/inventory">Sun Connection Inventory Channel</a> is a free offering from Sun that provides a centralized repository to organize the deployed products on your systems and report on them using the report generation tool.  My next blog about JDK product registration will cover more about it.</p>

<p>One of the most basic and difficult problems IT departments have today is to simply know what systems, softwares, and even services they have.  Systems and softwares are installed by various team members at all times.  Systems are shut down and new software is upgraded.  Sun Service Tags and Inventory Channel give IT new tools to manage this complexity.  For example, you can quickly determine what JDK and JRE instances (Java SE 6 update 4 and later releases) are installed on which systems in your environment.</p>

<h4>For More Information</h4>

<ul>
  <li><a href="http://www.sun.com/service/sunconnection/SunConnectionInventoryChannel.pdf">Sun Inventory</a></li>
  <li><a href="https://sunconnection.sun.com/FAQ/sc_faq.html">Sun Service Tag FAQ</a></li>
  <li><a href="http://blogs.sun.com/sunconnection/entry/the_sun_connection_inventory_channel">The Sun Connection Inventory Channel in a Nutshell</a></li>
  <li><a href="http://blogs.sun.com/sunconnection/entry/registering_your_inventory_in_the">Registering Your Inventory in the Disconnected Mode</a></li>
</ul>
]]>

</content>
</entry>
<entry>
<title>VisualVM - All-in-One Java Troubleshooting Tool</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mandychung/archive/2007/10/visualvm_allino.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-10-18T07:16:35Z</issued>
<id>tag:weblogs.java.net,2007:/blog/mandychung/294.8447</id>
<created>2007-10-18T07:16:35Z</created>
<summary type="text/plain">A new VisualVM project is live!  Try out the preview version to monitor, profile and troubleshooting your Java application.</summary>
<author>
<name>mandychung</name>

<email>Mandy.Chung@Sun.COM</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mandychung/">
<![CDATA[<p>A preview version of the VisualVM tool is now available to try out:<br />
<blockquote><br />
    <a href="https://visualvm.dev.java.net/">https://visualvm.dev.java.net/</a><br />
</blockquote></p>

<p>Screenshots from the VisualVM page:</p>

<table>
  <tr>
    <td align="center" style="padding-left: 20px; padding-right: 20px;">
      <center><a href="http://weblogs.java.net/blog/mandychung/archive/screenshot1.png" target="_blank"><img src="http://weblogs.java.net/blog/mandychung/archive/screenshot1_small.png" alt="Overview of running Java application" border="0"></a></center>
    </td>
    <td align="center" style="padding-left: 20px; padding-right: 20px;">
      <center><a href="http://weblogs.java.net/blog/mandychung/archive/screenshot2.png" target="_blank"><img src="http://weblogs.java.net/blog/mandychung/archive/screenshot2_small.png" alt="Basic telemetry of running Java application" border="0"></a></center>
    </td>
  </tr>
  <tr>
    <td align="center" valign="top" style="padding-left: 20px; padding-right: 20px;">
      <center style="font-weight: bold; font-size: smaller;">Overview of running Java application</center>
    </td>
    <td align="center" valign="top" style="padding-left: 20px; padding-right: 20px;">
      <center style="font-weight: bold; font-size: smaller;">Basic telemetry of running Java application</center>

<p>    </td><br />
  </tr></p>

</table>]]>

</content>
</entry>
<entry>
<title>JavaOne 2007 BOFs slides</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mandychung/archive/2007/05/javaone_2007_bo.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-05-22T23:01:16Z</issued>
<id>tag:weblogs.java.net,2007:/blog/mandychung/294.7482</id>
<created>2007-05-22T23:01:16Z</created>
<summary type="text/plain">Slides for our JavaOne 2007 BOFs are available for download.</summary>
<author>
<name>mandychung</name>

<email>Mandy.Chung@Sun.COM</email>
</author>
<dc:subject>JavaOne</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mandychung/">
<![CDATA[<p>Here are the slides for our BOFs:</p>

<p>  <a href="http://blogs.sun.com/alanb/resource/TS-BOF-2007.pdf">BOF-2816: The Troubleshooting and Diagnostic Utilities in JDK Release 5 and 6</a><br />
  <a href="http://weblogs.java.net/blog/mandychung/archive/VisualVM-BOF-2007.pdf"><br />
BOF-9123: Visualize Runtime Problems: A New All-in-One JDK Troubleshooting Tool</a></p>]]>

</content>
</entry>
<entry>
<title>Meet you at JavaOne 2007</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mandychung/archive/2007/05/javaone_2007.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-05-03T18:47:53Z</issued>
<id>tag:weblogs.java.net,2007:/blog/mandychung/294.7216</id>
<created>2007-05-03T18:47:53Z</created>
<summary type="text/plain">JavaOne is next week. Looking forward to meeting you at our BOFs and at our booths at the Pavilion!!</summary>
<author>
<name>mandychung</name>

<email>Mandy.Chung@Sun.COM</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mandychung/">
<![CDATA[<p><a href="http://java.sun.com/javaone/">JavaOne</a> is next week.  Hope to meet you at our BOFs:</p>

<ul>
  <li>BOF-2816: <a href="http://www28.cplan.com/cc158/sessions_catalog.jsp?ilc=158-1&ilg=english&isort=&isort_type=&is=yes&icriteria1=+&icriteria2=+&icriteria7=+&icriteria9=BOF-2816&icriteria8=&icriteria3=">The Troubleshooting and Diagnostic Utilities in JDK Release 5 and 6</a>, on Tuesday (May 8th) at 8:00pm-8:50pm.
<a href="http://blogs.sun.com/alanb/">Alan Bateman</a>, <a href="http://blogs.sun.com/sundararajan/">A. Sundararajan</a> and I will speak at this BOF and show you how to use these tools and utilities to effectively observe your application.</li>
  <li>BOF-9123: <a href="http://www28.cplan.com/cc158/sessions_catalog.jsp?ilc=158-1&ilg=english&isort=&isort_type=&is=yes&icriteria1=+&icriteria2=+&icriteria7=+&icriteria9=BOF-9123&icriteria8=&icriteria3=">Visualize Runtime Problems: A New All-in-One JDK Software Troubleshooting Tool</a>, on Wednesday (May 9th) at 9:55pm-10:45pm. Come check out a new troubleshooting GUI tool for monitoring, performance analysis and diagnosis!</li>
</ul>

<p>I will also be at the Pavilion at the following times.  Please drop by our booth and chat.</p>

<ul>
  <li>Tuesday at 11:15am-1:00pm at booth 940 (Java SE: Start with the Source!)</li>
  <li>Tuesday at 1:00pm-3:00pm at booth 965 (Java SE: Performance & Diagnostics)</li>
  <li>Thursday at 2:45pm-4:45pm at booth 965 (Java SE: Performance & Diagnostics)</li>
</ul>]]>

</content>
</entry>
<entry>
<title>Java SE 6 Monitoring, Management, Diagnosability</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mandychung/archive/2006/12/java_se_6_monit.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2006-12-11T11:40:13Z</issued>
<id>tag:weblogs.java.net,2006:/blog/mandychung/294.6112</id>
<created>2006-12-11T11:40:13Z</created>
<summary type="text/plain">Java SE 6 final release is now available! This presents an overview of the monitoring, management, and diagnosability features in Java SE 6 and also serves as a starting point for you to find the relevant blogs/articles/documentation.  </summary>
<author>
<name>mandychung</name>

<email>Mandy.Chung@Sun.COM</email>
</author>
<dc:subject>J2SE</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mandychung/">
<![CDATA[<a href="http://java.sun.com/javase/6/">Java SE 6</a> final release is now available!  My colleagues and I have blogged about Java SE 6 monitoring, management and diagnosability features in the past 1-2 years.
This presents an overview of the monitoring, management, and diagnosability features in Java SE 6 and also serves as a starting point for you to find the relevant blogs/articles/documentation.  Enjoy!
<p>
<table border="0" cellspacing="0">
<tr>
  <th style="text-align: left;">Feature</th>
  <th style="text-align: left;">Brief Description</th>
  <th>Blogs/Articles</th>
</tr>
<tr style="vertical-align: top; background-color: #eeeeee;">
  <td>Dynamic Attach Capability</td>
  <td>With JDK 6, you no longer require to start your application with any special option to be attached by JDK 6 tools.  The <a href="http://java.sun.com/javase/6/docs/technotes/guides/attach/index.html">Attach API</a> enables you to build your own tool to attach to a running JVM and  load a Java or native agent.<p></td>
  <td>
    <ul>
    <li><a href="http://blogs.sun.com/alanb/entry/late_binding_agents_and_fun">Dynamic attach and late binding agent</a></li>
    <li><a href="http://blogs.sun.com/sundararajan/entry/using_mustang_s_attach_api">How to use the Attach API</a></li>
    <li><a href="http://blogs.sun.com/chegar/entry/diagnosing_deleteonexit_issues">Diagnosing DeleteOnExit issue using the Attach API</a></li>
    </ul>
  </td>
</tr>
<tr style="vertical-align: top;">
  <td>Heap Dump and Analysis</td>
  <td>JDK 6 significantly enhances the ability of diagnosing memory problem.  The HotSpot VM provides the ability to request a heap dump on demand from the jmap tool as well as programmatically.  A heap analysis tool (jhat) is added in JDK 6 to browse the heap dump snapshot you obtain (see <a href="#jhat">below</a> for details).<p></td>
  <td><ul>
    <li><a href="http://blogs.sun.com/alanb/entry/heap_dumps_are_back_with">HotSpot VM built-in heap dumper</a></li>
    <li><a href="http://weblogs.java.net/blog/mandychung/archive/2006/02/from_monitoring_1.html">Six techniques for diagnosing memory usage problems</a></li>
    <li><a href="http://weblogs.java.net/blog/kellyohair/archive/2005/09/heap_dump_snaps.html">hprof, jmap, and jhat</a></li>
    <li><a href="http://weblogs.java.net/blog/jfarcand/archive/2006/02/using_mustangs.html">Using jmap/jhat to profile GlassFish</a></li>
  </ul></td>
</tr>
<tr style="vertical-align: top; background-color: #eeeeee;">
  <td>OutOfMemoryError Diagnosability</td>
  <td>JDK 6 provides a better support to diagnose OutOfMemoryError. This error now includes a stack trace where the allocation failed.  Another useful improvement is the -XX:+HeapDumpOnOutOfMemoryError option which tells the HotSpot VM to generate a heap dump when an allocation from the java heap or the permanent generation cannot be satisfied. In addition, a new -XX:OnOutOfMemoryError=&lt;command&gt; option is added for you to specify a command that the HotSpot VM will invoke when the OutOfMemoryError is thrown.<p></td>
  <td><ul>
    <li><a href="http://blogs.sun.com/alanb/entry/outofmemoryerror_looks_a_bit_better">OutOfMemoryError Improvement</a></li>
    <li><a href="http://blogs.sun.com/alanb/entry/heapdumponoutofmemoryerror_option_in_5_0u7">HeapDumpOnOutOfMemoryError on 5.0u7 and 1.4.2_12</a></li>
  </ul></td>
</tr>
<tr style="vertical-align: top;">
  <td><a href="http://www.sun.com/bigadmin/content/dtrace">DTrace</a> on Solaris</td>
  <td>JDK 6 HotSpot VM provides the built-in dtrace probes.  You can now use dtrace to trace the whole stack of any running Java application on Solaris 10.  JDK 6 comes with the sample DTrace scripts for you to start with (under the &lt;Solaris JDK6&gt;/sample/dtrace directory).<p></td>
  <td><ul>
    <li><a href="http://java.sun.com/javase/6/docs/technotes/guides/vm/dtrace.html">DTrace probes in HotSpot VM</a></li>
    <li><a href="http://java.sun.com/j2se/reference/whitepapers/java-dtrace-whitepaper.pdf">DTrace Support for the Java Platform Whitepaper</a></li>
  </ul></td>
</tr>
<tr style="vertical-align: top; background-color: #eeeeee;">
  <td>Troubleshooting Guide</td>
  <td><a href="http://java.sun.com/javase/6/webnotes/trouble/">Java SE Troubleshooting Guide</a>, a very popular and useful documentation , has been updated to include troubleshooting information for JDK 6.<p></td>
  <td></td>
</tr>
<tr>
  <td colspan="3" style="vertical-align: top;">
<strong><em>JDK Monitoring and Troubleshooting Tools</em></strong>
</td></tr>
<tr style="vertical-align: top; background-color: #eeeeee;">
  <td><a href="http://java.sun.com/javase/6/docs/technotes/tools/share/jconsole.html">jconsole</a>     </td>
  <td>The major JConsole enhancements include dynamic attach capability, the plugin API support and various UI improvement.
<p>
JConsole can attach to any running application which does not need to start with -Dcom.sun.management.jmxremote option. The new JConsole plugin API enables you to extend JConsole to add your own tab or custom UI for the application MBeans.<p></td>
  <td><ul>
    <li><a href="http://weblogs.java.net/blog/mandychung/archive/2006/05/mustang_jconsol_1.html">Summary of JDK 6 JConsole features</a></li>
    <li><a href="http://blogs.sun.com/lmalventosa/entry/changes_to_the_mbeans_tab">MBeans tab enhancements</a></li>
    <li><a href="http://weblogs.java.net/blog/emcmanus/archive/2006/07/how_much_does_i.html">Cost of being monitored with jconsole</a></li>
    <li><a href="http://java.sun.com/javase/6/docs/jdk/api/jconsole/spec/index.html">The JConsole API</a></li>
  </ul</td>
</tr>
<tr style="vertical-align: top;">
  <td><a name="#jhat"></a><a href="http://java.sun.com/javase/6/docs/technotes/tools/share/jhat.html">jhat</a></td>
  <td>A heap analysis tool, formerly <a href="http://hat.dev.java.net/">HAT</a>, is added in JDK 6 to browse a heap dump snapshot.  It provides built-in queries to examine classes, instances, root set, heap histogram and objects pending for finalization.  It also supports a built-in query language, OQL, to query the heap which is particular useful when searching on large number of objects.<p></td>
  <td><ul>
    <li><a href="http://blogs.sun.com/sundararajan/entry/what_s_in_my_java">What's my Java heap</a></li>
    <li><a href="http://blogs.sun.com/sundararajan/entry/querying_java_heap_with_oql">Using OQL to query Java heap</a></li>
    <li><a href="http://blogs.sun.com/sundararajan/entry/permanent_generation_analysis_with_oql">Using OQL to analyze permanent generation</a></li>
    <li><a href="http://weblogs.java.net/blog/jfarcand/archive/2006/02/using_mustangs.html">Using jmap/jhat to profile GlassFish</a></li>
  </ul></td>
</tr>
<tr style="vertical-align: top; background-color: #eeeeee;">
  <td><a href="http://java.sun.com/javase/6/docs/technotes/tools/share/jmap.html">jmap</a></td>
  <td>The jmap -dump and -histo options are now supported on Windows. It provides a light weight mechanism to obtain a heap histogram and heap snapshot on all platforms.<p></td>
  <td></td>
</tr>
<tr style="vertical-align: top;">
  <td><a href="http://java.sun.com/javase/6/docs/technotes/tools/share/jstack.html">jstack</a></td>
  <td>The jstack tool is now supported on Windows. You can print Java stack traces and also detect deadlocks on all platforms.  You can also use the new jstack -l option to print the list of owned <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/locks/package-summary.html">java.util.concurrent locks</a>.<p></td>
  <td></td>
</tr>
<tr style="vertical-align: top; background-color: #eeeeee;">
  <td><a href="http://java.sun.com/javase/6/docs/technotes/tools/share/jinfo.html">jinfo</a></td>
  <td>The jinfo tool adds a new -flag option to get and set an VM option.  For example you can use jinfo to set HeapDumpOnOutOfMemoryError at runtime.<p></td>
  <td></td>
</tr>
<tr>
  <td colspan="3"><strong><em>API Enhancements</em></strong></td>
</tr>
<tr style="vertical-align: top; background-color: #eeeeee;">
  <td><a href="http://java.sun.com/javase/6/docs/technotes/guides/jmx/">Java Management Extensions</a> (JMX)</td>
  <td>The important features of the JMX API in JDK 6 are <a href="http://weblogs.java.net/blog/emcmanus/archive/2006/02/what_is_an_mxbe.html">MXBeans</a> and <a href="http://weblogs.java.net/blog/emcmanus/archive/2005/10/adding_descript.html">Descriptors</a>. MXBeans enable bundling of related values in a MBean without requiring special client configurations to handle to bundle. Descriptors provide you a convenient way to attach additional metadata to your MBeans.<p></td>
  <td><ul>
    <li><a href="http://weblogs.java.net/blog/emcmanus/archive/2006/02/mustang_beta_an.html">JMX Enhancements in Java SE 6</a></li>
    <li><a href="http://java.sun.com/developer/technicalArticles/J2SE/mxbeans/">MXBean  Article</a></li>
    <li><a href="http://blogs.sun.com/lmalventosa/entry/using_the_ssl_tls_based1 ">SSL/TLS-based RMI Socket Factories</a></li>
  </ul></td>
</tr>
<tr style="vertical-align: top;">
  <td><a href="http://java.sun.com/javase/6/docs/api/java/lang/management/package-frame.html">java.lang.management</a></td>
  <td>The java.lang.management API has been enhanced for monitors and <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/locks/AbstractOwnableSynchronizer.html">java.util.concurrent locks</a> monitoring. You can find the list of locks owned by a thread and also report which stack frame locked a monitor.  It also provides a new method to obtain the <a href="http://java.sun.com/javase/6/docs/api/java/lang/management/OperatingSystemMXBean.html#getSystemLoadAverage()">system load average</a>.  In addition, a new <a href="http://java.sun.com/javase/6/docs/jre/api/management/extension/com/sun/management/HotSpotDiagnosticMXBean.html">HotSpotDiagnosticMXBean</a> API provides the programmatic interface to obtain a heap dump and set a VM option.<p></td>
  <td><ul>
    <li><a href="http://java.sun.com/javase/6/docs/technotes/guides/management/enhancements.html">Enhancements in Java SE 6</a></li>
  </ul></td>
</tr>
<tr style="vertical-align: top; background-color: #eeeeee;">
  <td><a href="http://java.sun.com/javase/6/docs/api/java/lang/instrument/package-frame.html">java.lang.instrument</a></td>
  <td>The java.lang.instrument API has been enhanced to provide support for dynamic transformation of loaded classes, multiple agents and appending to class loader search.<p></td>
  <td><ul>
    <li><a href="http://java.sun.com/javase/6/docs/technotes/guides/instrumentation/changes6.html">java.lang.instrument enhancements in Java SE 6</a></li>
  </ul></td>
</tr>
<tr style="vertical-align: top;">
  <td><a href="http://java.sun.com/javase/6/docs/technotes/guides/jvmti/">JVM Tool Interface</a></td>
  <td>JVM TI has been enhanced to provide multiple agents support, better dynamic instrumentation, enhanced heap walking API, resource exhaustion notification, support for early return and monitor stack depth.<p> </td>
  <td><ul>
    <li><a href="http://java.sun.com/javase/6/docs/technotes/guides/jvmti/changes6.html">JVM TI Enhancements in Java SE 6</a></li>
  </ul</td>
</tr>
<tr style="vertical-align: top; background-color: #eeeeee;">
  <td><a href="http://java.sun.com/javase/6/docs/technotes/guides/jpda/">Java Platform Debugger Architecture</a> (JPDA)</td>
  <td>JPDA has been enhanced to support heap walking functionality, force early return, view method arguments when not compiled with -g, process attach connector, monitor stack depth, and breakpoint on monitor locks/release.<p></td>
  <td><ul>
    <li><a href="http://java.sun.com/javase/6/docs/technotes/guides/jpda/enhancements.html">JPDA Enhancements in Java SE 6</a></li>
  </ul></td>
</tr>
</table>

<p>
Additional References:<p>
1. Article: <a href="http://java.sun.com/developer/technicalArticles/J2SE/monitoring/">Monitoring and Managing Java SE 6 Platform Applications</a>
<p>
2. <a href="http://blogs.sun.com/dannycoward/date/20060310">Crash Course: Java SE Monitoring, Management and Troubleshooting</a> 
<p>
3. <a href="http://www.sun.com/bigadmin/features/articles/java_se6_observability.html">Java SE 6 Observability and Solaris OS</a>]]>

</content>
</entry>
<entry>
<title>A Crash Course in Monitoring and Managing Java SE 6 Applications</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mandychung/archive/2006/08/a_crash_course_1.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2006-08-16T21:11:39Z</issued>
<id>tag:weblogs.java.net,2006:/blog/mandychung/294.5367</id>
<created>2006-08-16T21:11:39Z</created>
<summary type="text/plain">An article describing how to diagnose the common Java SE problems such as memory leaks, deadlocks and synchronization issues with the use of JDK 6 tools.</summary>
<author>
<name>mandychung</name>

<email>Mandy.Chung@Sun.COM</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mandychung/">
<![CDATA[<p>I recently wrote an article "<a href="http://java.sun.com/developer/technicalArticles/J2SE/monitoring/">Monitoring and Managing Java SE 6 Platform Applications</a>".  <a href="http://blogs.sun.com/roller/page/alanb">Alan</a>, <a href="http://blogs.sun.com/roller/page/sundararajan">Sundar</a>, <a href="http://weblogs.java.net/blog/kellyohair/">Kelly</a> and I have blogged about various JDK 6 enhancements in the monitoring, management, and diagnosability area.</p>

<p>This article gives you an overview of the monitoring and management capabilities out of the box in JDK 6 and presents a short course how to diagnose several common Java SE problems including memory leaks, deadlocks, and synchronization issues with the use of the JDK tools.</p>]]>

</content>
</entry>
<entry>
<title>JConsole will be supported in Mustang</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mandychung/archive/2006/05/jconsole_will_b.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2006-05-22T20:18:57Z</issued>
<id>tag:weblogs.java.net,2006:/blog/mandychung/294.4873</id>
<created>2006-05-22T20:18:57Z</created>
<summary type="text/plain">JConsole is going to be a supported tool in Mustang (Java SE 6).  We announced it at our JConsole BOF.  If you&apos;re interested in the slides of the JConsole BOF, you can download at.....</summary>
<author>
<name>mandychung</name>

<email>Mandy.Chung@Sun.COM</email>
</author>
<dc:subject>J2SE</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mandychung/">
<![CDATA[<p>Here are the slides of the JConsole BOF that Leif Samuelsson and <a href="http://blogs.sun.com/roller/page/jmxnetbeans">Jean-Francois</a> and I gave at JavaOne on May 18th.  Enjoy!</p>

<p><a href="http://weblogs.java.net/blog/mandychung/archive/jconsole-bof-2006.pdf/jconsole-bof-2006.pdf">Using JConsole to monitor and manage your application</a></p>

<p>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 <a href="https://mustang.dev.java.net/">Mustang snapshot</a> and send us feedback!</p>]]>

</content>
</entry>
<entry>
<title>Meet you @ JavaOne 2006</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mandychung/archive/2006/05/meet_you_javaon.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2006-05-16T02:29:14Z</issued>
<id>tag:weblogs.java.net,2006:/blog/mandychung/294.4747</id>
<created>2006-05-16T02:29:14Z</created>
<summary type="text/plain">I&apos;ll be at JavaOne 2006 tomorrow through Friday. Besides speaking at the BOFs, I&apos;ll be at the Java SE Performance &amp; Diagnostic booth and also the &quot;Ask the Experts&quot; area of the JDK Community booth to meet you all!</summary>
<author>
<name>mandychung</name>

<email>Mandy.Chung@Sun.COM</email>
</author>
<dc:subject>J2SE</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mandychung/">
<![CDATA[<p>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:<br />
o Java SE Performance & Diagnostic Booth on May 16 (Tue) at 10:30am-12:15pm<br />
o JDK Community (Peabody) Booth #723 "Ask the Expert" area on May 18 (Thur) at 11:00am-12:00pm</p>

<p>I'll be at two BOFs on May 18 (Thur) from 9:30pm to 11:30pm in Moscone Center North Mtg Rm 121/122:<br />
o <a href="https://www28.cplan.com/javaone06_cv_124_1/session_details.jsp?isid=277442&ilocation_id=124-1&ilanguage=english">BOF-0442</a> Using JConsole to monitor Your Application<br />
o <a href="https://www28.cplan.com/javaone06_cv_124_1/session_details.jsp?isid=277351&ilocation_id=124-1&ilanguage=english">BOF-3051</a> Using the Tools in JDK 5 and the Java SE 6 Platform to Diagnose Problems and Monitor Applications</p>

<p>Many experts from Java SE will also be at the "<a href="https://jdk.dev.java.net/nonav/J12006/ATE-ScheduleSign.gif">Ask the Experts</a>" area.  Come chat with them!</p>]]>

</content>
</entry>
<entry>
<title>Mustang JConsole</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mandychung/archive/2006/05/mustang_jconsol_1.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2006-05-05T07:55:40Z</issued>
<id>tag:weblogs.java.net,2006:/blog/mandychung/294.4643</id>
<created>2006-05-05T07:55:40Z</created>
<summary type="text/plain">What&apos;s new in Mustang JConsole?</summary>
<author>
<name>mandychung</name>

<email>Mandy.Chung@Sun.COM</email>
</author>
<dc:subject>J2SE</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mandychung/">
<![CDATA[<p><a href="http://java.sun.com/javaone/sf/index.jsp?cid=134574">JavaOne 2006 Conference</a> is coming up soon!  Our BOF "<a href="https://www28.cplan.com/javaone06_cv_124_1/session_details.jsp?isid=277442&ilocation_id=124-1&ilanguage=english">Using JConsole to Monitor and Manage Your Application</a>" is on May 18, 2006 at 10:30pm.    The 9:30pm BOF (same room) is the <a href="https://www28.cplan.com/javaone06_cv_124_1/session_details.jsp?isid=277351&ilocation_id=124-1&ilanguage=english">JDK Tools BOF</a>. 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 <a href="http://download.java.net/jdk6/docs/technotes/guides/management/jconsole.html">JConsole</a> at the JConsole BOF.</p>

<p>Below gives you a summary of the Mustang JConsole features.  <a href="http://bugs.sun.com/services/bugreport/index.jsp">Let us know what you think</a>.</p>

<h3>JConsole Plugin Support</h3>

<p>A new <a href="http://download.java.net/jdk6/docs/jdk/api/jconsole/spec/index.html">com.sun.tools.jconsole.JConsolePlugin</a> API is added in <a href="http://mustang.dev.java.net/">Mustang</a>.   You can build your custom plugin to run with JConsole, for example, to add a new tab to access your application MBeans.</p>

<p><a href="http://blogs.sun.com/roller/page/alanb?entry=two_fine_demos">JTop</a> 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:</p>

<blockquote><pre>
   &lt;JDK6&gt;/bin/jconsole -pluginpath &lt;JDK6&gt;/demo/management/JTop/JTop.jar
</pre></blockquote>

<p>To build a JConsole plugin, it's very simple:</p>

<p>1. Create a subclass of <a href="http://download.java.net/jdk6/docs/jdk/api/jconsole/spec/com/sun/tools/jconsole/JConsolePlugin.html">JConsolePlugin</a> class and implement the <a href="http://download.java.net/jdk6/docs/jdk/api/jconsole/spec/com/sun/tools/jconsole/JConsolePlugin.html#getTabs()"><tt>getTab</tt></a> method and also the <a href="http://download.java.net/jdk6/docs/jdk/api/jconsole/spec/com/sun/tools/jconsole/JConsolePlugin.html#newSwingWorker()"><tt>newSwingWorker</tt></a> method.  The <tt>getTab</tt> method returns the list of tabs to be added to JConsole or an empty list.  The <tt>newSwingWorker</tt> method returns the <a href="http://download.java.net/jdk6/docs/api/javax/swing/SwingWorker.html">SwingWorker</a> to be responsible for the plugin's GUI update.</p>

<p>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 <a href="http://download.java.net/jdk6/docs/api/java/util/ServiceLoader.html">service-provider loading</a> facility to look up and load the plugins.  You can have multiple plugins - one entry per plugin.</p>

<p><a href="http://blogs.sun.com/roller/page/sundararajan">Sundar</a> 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:</p>

<pre>
&lt;JDK6&gt;/bin/jconsole -pluginpath &lt;JDK6&gt;/demo/scripting/jconsole-plugin/jconsole-plugin.jar
</pre>

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

<blockquote><pre>
&gt; memory=mbean("java.lang:type=Memory") # to get the MemoryMXBean
&gt; memory.Verbose      # get the value of "Verbose" attribute
&gt; memory.Verbose=true # set the "Verbose" attribute to true
&gt; memory.gc()         # invoke the gc() operation
</pre></blockquote>

<h3>Dynamic Attach Capability</h3>

<p>JConsole can now attach to any applications running on Mustang JDK even if it wasn't started with <tt>-Dcom.sun.management.jmxremote</tt> option.  This dynamic attach capability uses the <a href="http://download.java.net/jdk6/docs/jre/api/attach/spec/index.html">attach</a>  API that <a href="http://blogs.sun.com/roller/page/alanb?entry=getting_started_with_jconsole_just">Alan Bateman</a> 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.</p>

<h3>UI Improvements</h3>

<p>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 <a href="http://download.java.net/jdk6/docs/api/java/util/concurrent/locks/AbstractOwnableSynchronizer.html">ownable synchronizers</a>.  See the blog about "<a href="http://weblogs.java.net/blog/mandychung/archive/2005/11/thread_dump_and_1.html">Thread dump and concurrent locks</a>".</p>

<h3>Overview Tab and VM Summary Tab</h3>

<p>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.</p>

<h3>JMX MBean Metadata and Descriptor</h3>

<p>JMX <a href="http://download.java.net/jdk6/docs/api/javax/management/Descriptor.html">Descriptor</a> provides a convenient way to add additional metadata to your MBeans.  Mustang JMX supports descriptors for all types of MBeans. Eamonn's <a href="http://weblogs.java.net/blog/emcmanus/archive/2005/10/adding_descript.html">blog</a> describes an easy way to add descriptors to your MBeans.  Mustang JConsole makes the MBean metadata and descriptor information visible in the MBean tab.</p>

<h3>HotSpot Diagnostic MBean</h3>

<p>Mustang adds a HotSpot Diagnostic MBean (see <a href="http://download.java.net/jdk6/docs/jre/api/management/extension/com/sun/management/HotSpotDiagnosticMXBean.html">com.sun.management.HotSpotDiagnosticMBean</a>) 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 <a href="http://blogs.sun.com/roller/page/sundararajan?entry=turning_on_off_and_viewing">blog</a>  about setting VM options and my <a href="http://weblogs.java.net/blog/mandychung/archive/2006/02/from_monitoring_1.html">blog</a> about diagnosing memory problems.</p>

<p>Try the latest version of Mustang JConsole and send us feedback!</p>]]>

</content>
</entry>
<entry>
<title>From Monitoring to Diagnosing Memory Problem in Mustang</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mandychung/archive/2006/02/from_monitoring_1.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2006-02-15T16:28:59Z</issued>
<id>tag:weblogs.java.net,2006:/blog/mandychung/294.4069</id>
<created>2006-02-15T16:28:59Z</created>
<summary type="text/plain">Mustang Beta Release is available!!  Mustang has several enhancements in the VM and the JDK tools to help identify the symptoms and diagnose memory problems from using jconsole to monitor the memory usage and garbage collection activities to using jconsole to take a snapshot of the heap or turn on more diagnostic or tracing such as verbose GC.</summary>
<author>
<name>mandychung</name>

<email>Mandy.Chung@Sun.COM</email>
</author>
<dc:subject>J2SE</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mandychung/">
<![CDATA[<p><a href="http://java.sun.com/javase/6/">Mustang Beta</a> Release is now available!</p>

<p>Mustang has several enhancements in the VM and the JDK tools to help identify the symptoms and diagnose memory problems.  One typical type of memory problems is memory leak causing continuously growing in heap memory usage.  Eventually it may lead to OutOfMemoryError. Another typical type is the application's performance problem with excessive object creation and deletion causing long pause garbage collections. In the past, you would typically restart your application to turn on -verbose:gc option to get GC verbose tracing to determine the time GC spent and the memory usage trend. <a href="http://java.sun.com/j2se/1.5.0/docs/guide/management/">Tiger monitoring and management support</a> enables you to continuously monitor your application at production time and catches the symptom early on.  Mustang brings more...</p>

<p>
A few techniques Mustang provides:
<p>
1. Use jconsole to watch the memory usage of your application
<p>
<img alt="jconsole-memory-tab.PNG" src="http://weblogs.java.net/blog/mandychung/archive/jconsole-memory-tab.PNG" width="668" height="566" />

<p>
The memory usage graph would clearly show if the memory usage is growing over time.  It also provides the <a href="http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html#LowMemoryDetection">low memory detection support</a> such that you can set a threshold to catch abormal behavior.  For example, I set the memory usage threshold to 6 MBytes in the Tenured Gen memory pool. The amount of memory exceeding the threshold will be flagged in red color.

<p>
2. Use jconsole to monitor the garbage collection activities
<p>
The bottom panel of the memory tab displays the garbage collection statistics including the time it spent on GC and also the total number of collections happened.  It would give you a rough idea of how frequent GC happens and how long the GC takes.  If you want to turn on the verbose GC tracing to get details about individual GC invocation, you can do it dynamically through JConsole as described in the "<a href="http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html#VerboseTracing">Using JConsole to monitor applications"</a> article.  You don't need to restart your application.
<p>
3. Use jconsole to find out the number of objects pending for finalization
<p>
Finalizers would be one possible cause of memory leak. There is no guarantee when a finalizer will be run and whether it will be run at all.  An object that has a finalizer will not be garbage collected until its finalizer is run.  JConsole shows the number of objects pending for finalization in the summary tab which would be one useful  information you may want to check when you suspect a leak.
<p>
4. Obtain heap histogram to help determine the leak suspect
<p>
jmap -histo will print the histogram of the heap showing the number of instances and the amount of memory of each class.  jmap -histo option was extended to support on Windows in Mustang b67. The heap histogram would give you more information to determine if a memory leak would possibly exist. Often the class with growing number of instances could be one potential leak suspect.
<p>
5. Obtain heap dump snapshots and use jhat for heap analysis
<p>
Mustang enables you to get heap dump programmatically, at runtime using jmap and jconsole, at OutOfMemoryError and also from a core file. Mustang now also includes <a href="http://hat.dev.java.net/">HAT</a> (Heap Analysis Tool) as jhat utility. Check out several blogs about Mustang heap dump and jhat:
<ul>
<li><a href="http://blogs.sun.com/roller/page/alanb?entry=heap_dumps_are_back_with">Heap dump is back</a></li>
<li><a href="http://weblogs.java.net/blog/kellyohair/archive/2005/09/heap_dump_snaps.html">Heap dump snapshot</a></li>
<li><a href="http://blogs.sun.com/roller/page/sundararajan?entry=querying_java_heap_with_oql">Query Java heap with OQL</a></li>
</ul>

<p>
6. Prepare for OutOfMemoryError
<p>
Alan's <a href="http://blogs.sun.com/roller/page/alanb?entry=outofmemoryerror_looks_a_bit_better">blog</a>  describes the improvement in OutOfMemoryError and also a new VM option -XX:+HeapDumpOnOutOfMemoryError to tell the HotSpot VM to generate a heap dump when it runs out of memory.  You can either specify the VM option at startup time or at runtime via jconsole's MBeans tab.

<p>
<img alt="jconsole-diagnostic.PNG" src="http://weblogs.java.net/blog/mandychung/archive/jconsole-diagnostic.PNG" width="670" height="566" />
<p>

<p>HotSpotDiagnostic MBean provides several diagnostic operations such as to dump heap and set VM option.  We plan to provide a better UI for accessing the HotSpot diagnostic features.</p>

<p>In summary, the diagnosability of memory problem has been improved.  Download Mustang <a href="http://java.sun.com/javase/6/">beta</a> or the latest Mustang <a href="http://mustang.dev.java.net/">snapshot</a> and let you know your feedback.</p>]]>

</content>
</entry>
<entry>
<title>Thread Dump and Concurrency Locks</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mandychung/archive/2005/11/thread_dump_and_1.html" />
<modified>2008-01-02T17:42:16Z</modified>
<issued>2005-11-24T00:12:00Z</issued>
<id>tag:weblogs.java.net,2005:/blog/mandychung/294.3695</id>
<created>2005-11-24T00:12:00Z</created>
<summary type="text/plain">Thread dumps are very useful for diagnosing synchronization related problems such as deadlock on object monitors.  Introducing the Mustang enhancement in thread dump, deadlock detection facility, as well as the monitoring API to improve the diagnosability of java.util.concurrent.locks.</summary>
<author>
<name>mandychung</name>

<email>Mandy.Chung@Sun.COM</email>
</author>
<dc:subject>J2SE</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mandychung/">
<![CDATA[<p><script src="http://weblogs.java.net/blog/mandychung/archive/buttons.js" type="text/javascript"></script></p>

<p>Thread dumps are very useful for diagnosing synchronization related problems such as deadlocks on object monitors. Ctrl-\ on Solaris/Linux or Ctrl-Break on Windows has been a common way to get a thread dump of a running application. On Solaris or Linux, you can send a QUIT signal to the target application.  The target application in both cases prints a thread dump to the standard output and also detects if there is any deadlock involving object monitors.</p>

<p><a href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jstack.html">jstack</a>, a new troubleshooting utility introduced in Tiger (J2SE 5.0), provides another way to obtain a thread dump of an application. <a href="http://blogs.sun.com/roller/page/alanb">Alan Bateman</a> has a nice <a href="http://blogs.sun.com/roller/page/alanb?entry=jstack">blog </a>about jstack and its several improvements in Mustang (Java SE 6).  Mustang jstack works like a remote Ctrl-\ or Ctrl-Break if you are on Windows.</p>

<p><a href="http://java.sun.com/j2se/1.5.0/docs/guide/management/jconsole.html">jconsole </a> is JMX-complaint GUI tool which allows you to get a thread dump on the fly.  The "<a href="http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html">Using JConsole to Monitor Applications</a>" article gives you an overview of the Tiger monitoring and management functionality.</p>

<p>Mustang extends the thread dump, jstack, and jconsole to support <a href="http://download.java.net/jdk6/docs/api/java/util/concurrent/locks/package-summary.html">java.util.concurrent.locks</a> to improve its diagnosability.  For example, the Threads tab in the Mustang jconsole now shows which <a href="http://download.java.net/jdk6/docs/api/java/util/concurrent/locks/AbstractOwnableSynchronizer.html">synchronizer</a> a thread is waiting to acquire when the thread is blocked to lock a <a href="http://download.java.net/jdk6/docs/api/java/util/concurrent/locks/ReentrantLock.html">ReentrantLock</a> and also which thread is owning that lock.</p>

<p><img alt="jconsole-deadlock.PNG" src="http://weblogs.java.net/blog/mandychung/archive/jconsole-deadlock.PNG" width="840" height="581" /></p>

<p>In addition, it has a new "detect deadlock" button (in the bottom).  When you click on the "detect deadlock" button, it will send a request to the target application to perform the deadlock detection operation.  If the target application is running on Mustang, it finds deadlocks involving both object monitors as well as the java.util.concurrent.locks. If the target application is running on Tiger, it finds deadlocks involving object monitors only. Each deadlock cycle will be displayed in a separate Deadlock tab.</p>

<p><img alt="jconsole-deadlock1.PNG" src="http://weblogs.java.net/blog/mandychung/archive/jconsole-deadlock1.PNG" width="840" height="581" /></p>

<p>Click <a href="http://weblogs.java.net/blog/mandychung/archive/jconsole-deadlock1-long." onclick="window.open('http://weblogs.java.net/blog/mandychung/archive/jconsole-deadlock1-long.','popup','width=1039,height=581,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false">here</a> to see a wider form of this screenshot.</p>

<p>JDK 6 has a nice demo <em>FullThreadDump</em> under $JDK_HOME/demo/management/FullThreadDump where JDK_HOME is the location of your JDK 6. This demo has been included in JDK 5.0 and is updated to use the new Mustang API.  It demonstrates the use of the <a href="http://download.java.net/jdk6/docs/api/java/lang/management/package-summary.html">java.lang.management</a> API to get the thread dump and detect deadlock programmatically.</p>]]>

</content>
</entry>

</feed>