An Introduction to JRockit Mission Control

by Marcus Hirt
12/12/2005

Abstract

BEA JRockit Mission Control is a set of powerful tools provided with the BEA JRockit 5.0 R26 JDK. These tools deliver advanced, unobtrusive JVM monitoring and management, suitable for use both in development and production environments. This article gives an introduction to JRockit Mission Control, describing the main components in the suite, how this suite's components differ from competing technologies, and how you can use them to manage your JRockit JVM deployments.

Introduction

JRockit Mission Control is the collective name of the tools provided with the JRockit 5.0 R26 JDK. It is a set of Swing applications you can use to collect and analyze information from the JRockit runtime in different ways. The next version of JRockit Mission Control will be based on the Eclipse Rich Client Platform and the separate tools available as Eclipse plug-ins.

Most technologies used today to monitor, manage, and profile the Java runtime use fairly intrusive technologies, like byte code instrumentation and JVMPI (now deprecated and superseded by JVMTI). The main focus of JRockit Mission Control is to do the necessary instrumentation with the lowest possible impact on the running system. The technology used also enables the application to run at full speed once the tool is disconnected from the JVM. JRockit Mission Control therefore is suitable for use in production environments. The minimal overhead also minimizes the Heisenberg effect and may provide more representative data for your application than the more overhead-prone techniques.

Let's look at the various components of JRockit Mission Control.

JRockit Management Console

The JRockit Management Console is a JMX-based console used to manage and monitor the JRockit JVM. It provides vital health data and a way to control the runtime characteristics of the JRockit JVM. Among the attributes you can monitor are the live set, the heap usage, CPU load, and any other attribute exposed by the MBeans registered in the JVM-internal platform MBean server. The JRockit Management Console also includes a low overhead method profiler and an exception counter.

To monitor a JRockit JVM with the JRockit Management Console, first the management agent in the JVM to be monitored must be started. This can be done by starting the JRockit JVM with the -Xmanagement flag (see the \JRockit Management Console documentation), by using JRCMD, or by using the Ctrl-Break Handler.  You can also use JRCMD and the Ctrl-Break Handler to shut down the management agent. The JRockit Management Console consists of an agent running in the JRockit process, exposing the MBeans registered in the JVM-internal platform MBean server, and a separate JRockit Management Console Swing application.

As Figure 1 illustrates, several instances of the JRockit Management Console can be connected to a single JRockit JVM, and a single Management Console can be connected to several JRockit JVMs. The Management Consoles should either run on different machines or use the -settings option flag to use different settings files. Note that since the console can handle multiple JRockit JVMs, there is usually no need to run multiple Management Consoles on the same machine.

Figure 1
Figure 1: BEA JRockit Management Console communication (click the image for a full-size screen shot)

From a high-level architectural perspective, the monitored JRockit includes:

  • A set of interfaces—JRockit extensions to the java.lang.management interfaces. A dynamically generated MBean exposing all of JRockit's performance counters as attributes also exists. These extensions are internally named the java.lang.management extensions, or JLMEXT for short.
  • An agent exposing those interfaces—Communication with the console is achieved with remote JMX over RMI.
  • The JDP (JRockit Discovery Protocol) Server—The Management Console carries out automatic detection by using multicasting to communicate the location of the particular JRockit. The JDP Server is optional. To enable JDP you need to start your JVM with the -Djrockit.managementserver.autodiscovery=true system property option.

The Method Profiler provides a very low-overhead means of finding out how many times a method is being invoked, and how much time is being spent in that particular method. The methods of interest are simply regenerated with a tiny amount of instrumentation code, which is removed the instant the profiler is stopped. The overhead of using the method profiler therefore is only incurred when you have selected methods for profiling, and only for the selected methods. The Javadocs for the JRockit-specific interfaces are published on Mission Control's home page.

From a high-level architectural perspective, the Management Console Swing application includes:

  • RJMX (JRockit Remote JMX services)—Provides services such as persistence, the attribute subscription abstraction, and the notification framework.
  • The JDP Client—Automatically discovers JRockit JVMs that have JDP enabled.
  • The Management Console GUI (see Figure 2)—The Swing application.

Figure 2
Figure 2: BEA JRockit Management Console (click the image for a full-size screen shot)

The Management Console application introduces the concept of an Attribute Subscription, which, somewhat simplified, is defined by the MBean ObjectName, the Attribute Name, and the subscription interval. The console allows the user to add notification rules, and plot and persist data from such attribute subscriptions. The attribute subscriptions can be based on regular JMX MBean attributes, on individual composite data keys from an attribute, or on JMX notification data (where the subscription interval isn't interesting due to the asynchronous delivery of events from such a subscription). You can create your own composite attribute subscriptions that depend on several other attribute subscriptions for its data, or even create synthetic attribute subscriptions where it's up to you, the implementor, to provide the data.

To summarize, the JRockit Management Console is a very flexible JMX monitor and management tool that provides a wealth of features:

  • Plotting of any numerical attribute
  • Persistence of any set of attributes for offline analysis
  • Special attribute subscriptions for easy plotting of pausetimes, live set usage, and continuous heap usage
  • Notification rules that can take actions when a user-specified condition occurs for a certain attribute
  • The ability for users to plug in their own code for both notification actions and constraints
  • Management of the Java runtime, including dynamically changing the garbage collection strategy, heap size, nursery size, JRockit process affinity, enabling/disabling of verbosity flags, and more
  • A low overhead method profiler
  • An exception counter
  • A means to start JRockit Runtime Analyzer recordings
  • A means to dynamically invoke the operations of your MBeans
  • A way to invoke the JRockit Ctrl-Break Handler

For more information on how to configure the console to use SSL, authentication, and roles, see the JRockit documentation.

Pages: 1, 2

Next Page »