Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Java™ Troubleshooting Guide for HP-UX Systems: > Chapter 1 Diagnostic and Monitoring Tools and Options

jconsole (1.5+ only)

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

The jconsole command launches a graphical console tool that enables you to monitor and manage Java applications on a local or remote machine.

jconsole can attach to any application that is started with the Java Management Extensions (JMX) agent. A system property defined on the command line enables the JMX agent. Once attached, jconsole can be used to display useful information such as thread usage, memory consumption, and details about class loading, runtime compilation, and the operating system.

In addition to monitoring, jconsole can be used to dynamically change several parameters in the running system. For example, the setting of the -verbose:gc option can be changed so that garbage collection trace output can be dynamically enabled or disabled for a running application.

To use jconsole:

  1. Start the application with the -Dcom.sun.management.jmxremote option. This option sets the com.sun.management.jmxremote system property, which enables the JMX agent.

  2. Start jconsole with the jconsole command.

  3. When jconsole starts, it shows a screen listing the managed Java VMs on the machine. The process id (pid) and command line arguments for each Java VM are displayed. Select one of the Java VMs, and jconsole attaches to it.

The following example shows invocation of jconsole. First the Java application must be started with the JMX agent enabled:

$ java -Dcom.sun.management.jmxremote -jar Java2Demo.jar &
  [1] 13028

Now the jconsole tool can be started on the managed Java VM:

$ /opt/java1.5/bin/jconsole 13028

The following figure shows a jconsole screen:

Figure 1-15 jconsole Screen

jconsole Screen

jconsole can also be run remotely. To learn more about jconsole, including remote invocation, refer to the following webpage:

http://java.sun.com/j2se/1.5.0/docs/guide/management/jconsole.html

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2009 Hewlett-Packard Development Company, L.P.