bea.com | products | dev2dev | support | askBEA
 Download Docs   Site Map   Glossary 
Search

JRockit for Windows and Linux User Guide

 Previous Next Contents View as PDF  

JVM Tools

BEA WebLogic JRockit 8.1 Beta uses the tools described in this chapter to facilitate both profiling and debugging your JVM implementation. This section includes information on the following subjects:

 


JVMPI

Warning: This interface is an experimental feature in the Java 2 SDK and is not yet a standard profiling interface.

How JVMPI Works

The JVM Profiler Interface (JVMPI) is a two-way function call interface between the Java virtual machine and an in-process profiler agent. On one hand, the virtual machine notifies the profiler agent of various events, corresponding to, for example, heap allocation, thread start, etc. On the other hand, the profiler agent issues controls and requests for more information through the JVMPI. For example, the profiler agent can turn on/off a specific event notification, based on the needs of the profiler front-end.

The profiler front-end may or may not run in the same process as the profiler agent. It may reside in a different process on the same machine, or on a remote machine connected via the network. The JVMPI does not specify a standard wire protocol. Tools vendors may design wire protocols suitable for the needs of different profiler front-ends.

A profiling tool based on JVMPI can obtain a variety of information such as heavy memory allocation sites, CPU usage hot-spots, unnecessary object retention, and monitor contention, for a comprehensive performance analysis.

JVMPI supports partial profiling, i.e a user can selectively profile an application for certain subsets of the time the virtual machine is up and can also choose to obtain only certain types of profiling information.

In the current version of JVMPI, only one agent per virtual machine can be supported.

Changing the JVMPI Default Behavior

-Xjvmpi[<argument>=<value>, ...]

When JRockit runs with a debugger attached, by default a number of events are enabled that can create significant overhead. Since JVMPI doesn't require all of these events to be sent, you can disable them by setting the -Xjvmpi flag. Use the arguments listed in Table 9-1 to modify the default behavior.:

Table 9-1 Command Line Arguments for -Xjvmpi

Argument

Description

entryexit=off|on (default on)

Setting this to off disables the following method entry and exit events sent by JVMPI:

  • JVMPI_EVENT_METHOD_ENTRY

  • JVMPI_EVENT_METHOD_ENTRY2

  • JVMPI_EVENT_METHOD_EXIT

allocs=off|on (default on)

Setting this to off disables these object allocation and free events:

  • JVMPI_EVENT_OBJECT_ALLOC
  • JVMPI_EVENT_OBJECT_MOVE
  • JVMPI_EVENT_OBJECT_FREE
  • JVMPI_EVENT_ARENA_NEW
  • JVMPI_EVENT_ARENA_DELETE

monitors=off|on (default on)

Setting this to off disable these monitor contention events:

  • JVMPI_EVENT_RAW_MONITOR_CONTENDED_ENTER
  • JVMPI_EVENT_RAW_MONITOR_CONTENDED_ENTERED
  • JVMPI_EVENT_RAW_MONITOR_CONTENDED_EXIT
  • JVMPI_EVENT_MONITOR_CONTENDED_ENTER
  • JVMPI_EVENT_MONITOR_CONTENDED_ENTERED
  • JVMPI_EVENT_MONITOR_CONTENDED_EXIT
  • JVMPI_EVENT_MONITOR_WAIT
  • JVMPI_EVENT_MONITOR_WAITED

arenadelete=off|on (default off)

Setting this to on will enable the JVMPI_EVENT_ARENA_DELETE event. This event is suppressed by default to be compatible with Sun's VM which does not send this event. The event can be enabled if a profiler wishes to receive the event.

JVMPI Documentation

As JVMPI is an experimental interface (see Warning:), Sun Microsystems provides the documentation for tools vendors who have an immediate need for profiling hooks in the Java virtual machine. You can find this documentation at:

http://java.sun.com/products/jdk/1.2/docs/guide/jvmpi/

 


JVMDI

The JVM Debug Interface (JVMDI) is a low-level debugging interface used by debuggers and other programming tools. It allows you to inspect the state and to control the execution of applications running in JRockit.

How JVMDI Works

JVMDI is a two-way interface. The JVMDI client can be notified of interesting occurrences through events. The JVMDI can query and control the application through many different functions, either in response to events or independent of them.

JVMDI clients run in the same virtual machine as the application being debugged and access JVMDI through a native interface. The native, in-process interface allows maximal control with minimal intrusion on the part of a debugging tool. Typically, JVMDI clients are relatively compact. They can be controlled by a separate process which implements the bulk of a debugger's function without interfering with the target application's normal execution.

JVMDI is one layer within the Java Platform Debugger Architecture. This architecture also contains higher-level, out-of-process debugger interfaces. The higher-level interfaces are more appropriate than JVMDI for many debugger tools.

JVMDI Documentation

Sun Microsystems provides complete reference documentation for JVMDI. For more information, g to:

http://java.sun.com/products/jdk/1.2/docs/guide/jvmdi/

 

Back to Top Previous Next