IBM User Guide for Java V7 on Windows > Troubleshooting and support > Using diagnostic tools

Using JConsole

The Java Monitoring and Management Console (JConsole) is a Swing GUI application for monitoring the behavior of Java applications.

The tool is built on the java.lang.management API, introduced in Java 5.0. JConsole can connect to applications running on local and remote workstations. The applications must be configured to allow access. JConsole is not part of the core SDK, and it is experimental and unsupported.

JConsole information includes...


Set up JConsole to monitor a Java application

  1. Start the Java application to monitor using connector options which make it accessible to JConsole. For example...

      -Dcom.sun.management.jmxremote.port=<port number>
      -Dcom.sun.management.jmxremote.authenticate=false
      -Dcom.sun.management.jmxremote.ssl=false

    If using the WebSphere Application Server Liberty profile, jConsole functionality is enabled by editing server.xml and setting...

  2. To start JConsole...

      cd $JAVA_HOME/bin ./jconsole

  3. In New Connection dialog enter your host name and port number.

    If JConsole is running on the same workstation as your Java application, leave host name value as localhost.

    For a remote system, set the host field value to the host name or IP address of the workstation.

  4. Click Connect.

    JConsole starts and displays the summary tab.


Set up JConsole to monitor itself

  1. Start JConsole...

      cd $JAVA_HOME/bin ./jconsole

  2. On the New Connection dialog, in the Remote Process field, enter...

      localhost:0

  3. Click Connect


Using JConsole to monitor a Java application

Summary tab Key details of the JVM you have connected to.
Memory tab History of usage of each memory pool in the JVM, including heap memory. To start a garbage collection, click the Perform GC button.
Threads tab Number of threads currently running and a list of their IDs. Clicking a thread ID shows the thread state and its current stack trace.
Classes tab Current number of loaded classes and the number of classes loaded and unloaded since the application was started. To see classes loaded in the client JVM, select the verbose output check box. Output is displayed to stderr.
MBeans tab Inspect the state of the platform MBeans.
VM tab Information about the Java environment, including JVM arguments and the class path.


Troubleshoot JConsole

Running JConsole on the same workstation as the Java application may affect the performance of your Java application. If this is the case, you can connect JConsole to a JVM running on a remote workstation.

You can pass Java command-line options by prefixing them with -J. For example, to change the maximum heap size...


Known Limitations

The local process list does not work. Use localhost:<port> in the Remote Process field to connect to a local JVM.

The CPU usage display does not work.


See also


Parent: Using diagnostic tools


Error 404 - Not Found

Error 404 - Not Found

The document you are looking for may have been removed or re-named. Please contact the web site owner for further assistance.