Using JRockit JDK
This section describes how to start BEA JRockit and how to configure it by using standard and non-standard command line options. It includes information on the following subjects:
Before starting BEA JRockit, ensure that you have the following directory set in your PATH environment variable:
To start BEA JRockit, at the command line enter the following:
java
<configuration and tuning options>myClass
Where <
configuration and tuning options>
are the optional configuration and tuning options you want to use. The configuration options are described in Configuring BEA JRockit, below. See Tuning BEA JRockit JVM for details on the tuning options available for this version of BEA JRockit.
Note: You can alternatively start JRockit by specifying the full path to the file; for example, /usr/local/java/bin/java
(depending on where it is installed) on Linux and c:\bea\jrockit
xxx
\bin\java
(depending on where it is installed) on Windows.
The following commands set the type of JRockit you want to run, server-side or client-side:
By setting the JVM type (or accepting the default) will also set the garbage collection algorithm that will be used during runtime. -server
will start the dynamic garbage collector optimized for throughput while -client
will start a a single-spaced, concurrent mark, concurrent sweep garbage collector. If you want to use a specific fixed garbage collector, you can override the default by using the -Xgc
command line option.
A sample start-up command, with some tuning options specified, might look like this:
java -Xverbose:memory -Xmx:256m -Xms:64m myClass
In this example, the following options are set:
-Xverbose:memory
—Displays verbose output about memory usage.-Xmx:256m
—The maximum heap size is set to 256 megabytes.-Xms:64m
—The initial and minimum heap size is set to 64 megabytes.myClass
—Identifies the class that contains the main
method.
When you start BEA JRockit, you can set behavioral parameters by using both standard and non-standard command line options. This section describes some of these options and how to use them at startup to configure BEA JRockit. It contains information on the following subjects:
The standard command line options work the same regardless of the JVM; in other words, these options work the same whether you are running BEA JRockit, Sun Microsystem's HotSpot JVM, or any other third party JVM.
The following standard command line options set general information about BEA JRockit:
-classpath <directories and zips/jars separated by : (Linux) or ; (Windows)>
Specifies the location of classes and resources.
Alternately, you can use the option -cp
to represent -classpath
; for example:
-D<name>[=<value>]
The following options determine if the system will provide messages to the operator and what the form and content of those messages should be.
Extended command line options, proceeded with the letter -X
, are options that are exclusive to BEA JRockit and changes the behavior of JRockit to better suit the needs of different Java applications. These options will not work on other JVMs (conversely, the extended options used by other JVMs won't work with JRockit).
The option -X
displays a short help message on the extended options.
Note: Since these options are an extension to JRockit and non-standard, they are subject to change between releases, see the BEA JRockit JDK Compatibility Statement.
The following are examples on extended options that define general BEA JRockit JVM behavior:
When using the startup option -Xverbose
, BEA JRockit prints, on screen, specific information about the system. The information printed depends upon the parameter that you have specified with the option. Supported parameters are, for example, memory
, load
, gc
, opt
, and cpuinfo
. If you do not specify any parameter, everything will be printed.
Note: To use more than one parameter, separate them with a comma, for example:-Xverbose:gc,opt
Listing 2-1 through Listing 2-6 combined with Table 2-1 through Table 2-6 lists and explains examples of different verbose output. These output examples are to hint you to how the verbose output can look like. The output that you see in these listings can greatly differ from what you see on your system depending on, for example, the version of BEA JRockit that you are running.
Listing 2-1 Print out for -Xverbose:codegen
[codegen] #1 ? (0x2) n jrockit/vm/Allocator.prepareNextChunkAndAlloc(IIII)Ljava/lang/Object;
[codegen] #1 ? (0x2) n @0x6b3543f0-0x6b354465 1.43 ms (1.43 ms)
This is the first (#1) method to be generated with a normal (
|
|
|
This is the name and location of the method that has been generated. |
Listing 2-2 Print out for -Xverbose:opt
[opt ] #1 4 (0x8) o jrockit/vm/Locks.waitForThinRelease(Ljava/lang/Object;I)I
[opt ] #1 4 (0x8) o @0x324D0000-0x324D00A1 26.80 ms (26.80 ms)
This is the first (
|
|
This is the name and location of the method that has been generated. |
|
Listing 2-3 Print out for -Xverbose:cpuinfo
[cpuinfo] Vendor: GenuineIntel
[cpuinfo] Type: Original OEM
[cpuinfo] Family: Pentium 4
[cpuinfo] Brand: Intel(R) Xeon(TM) CPU 2.80GHz
[cpuinfo] Supports: On-Chip FPU
[cpuinfo] Supports: Virtual Mode Extensions
[cpuinfo] Supports: Debugging Extensions
|
This is information about the CPU chip itself, i.e. vendor, type of chip, family name, and the brand name. This information differs depending on the type of CPU you are using. |
|
This lists all features that the CPU supports. For more information about your specific CPU, please contact the vendor. |
Listing 2-4 Print out for -Xverbose:load
[load ] opened zip /localhome/jrockits/jrockit-jdk1.5.0_02/jre/lib/jrockit.jar
[load ] opened zip /localhome/jrockits/jrockit-jdk1.5.0_02/jre/lib/rt.jar
[load ] opened zip /localhome/jrockits/jrockit-jdk1.5.0_02/jre/lib/jsse.jar
[load ] opened zip /localhome/jrockits/jrockit-jdk1.5.0_02/jre/lib/jce.jar
[load ] opened zip /localhome/jrockits/jrockit-jdk1.5.0_02/jre/lib/charsets.jar
[load ] opened zip /localhome/jrockits/jrockit-jdk1.5.0_02/jre/lib/managementapi.jar
[load ] initiated ? (0x2) 0 (nil)/java/lang/Object
[load ] define ? (0x2) # 0 java/lang/Object loader=(nil), src=/localhome/jrockits/jrockit-jdk1.5.0_02/jre/lib/jrockit.jar
[load ] loading ? (0x2) 0 (nil)/java/lang/Object success (0.59 ms)
|
|
|
|
Shows if the class loaded successfully. If it failed, the print out is |
Listing 2-5 Print out for -Xverbose:memory (dynamic garbage collector)
[memory ] GC strategy: System optimized over throughput (initial strategy singleparpar)
[memory ] heap size: 65536K, nursery size: 16384K
[memory ] <s>-<end>: GC <before>K-><after>K (<heap>K), <pause> ms
[memory ] <s/start> - start time of collection (seconds since jvm start)
[memory ] <end> - end time of collection (seconds since jvm start)
[memory ] <before> - memory used by objects before collection (KB)
[memory ] <after> - memory used by objects after collection (KB)
[memory ] <heap> - size of heap after collection (KB)
[memory ] <pause> - total pause time during collection (milliseconds)
[memory ] Changing GC strategy to generational, parallel mark and parallel sweep
[memory ] 1.719-1.731: GC 65536K->3176K (65536K), 11.000 ms
|
Information about the garbage collector strategy that is used. This is the default dynamic garbage collector that optimizes over throughput. |
|
This is the format of the verbose print. The text that follow is an explanation of the different parts of the print-out. |
This the first verbose print of a successful garbage collection. |
Listing 2-6 Print out for -Xverbose:memory (parallel, single-spaced garbage collector)
[memory ] GC strategy: parallel
[memory ] heap size: 65536K
[memory ] <s>-<end>: GC <before>K-><after>K (<heap>K), <pause> ms
[memory ] <s/start> - start time of collection (seconds since jvm start)
[memory ] <end> - end time of collection (seconds since jvm start)
[memory ] <before> - memory used by objects before collection (KB)
[memory ] <after> - memory used by objects after collection (KB)
[memory ] <heap> - size of heap after collection (KB)
[memory ] <pause> - total pause time during collection (milliseconds)
[memory ] 1.561-1.572: GC 65536K->1420K (65536K), 10.000 ms
Information about the garbage collector strategy that is used. Here it is a static parallel, single-spaced garbage collector. |
|
|
This is the format of the verbose print. The text that follow is an explanation of the different parts of the print-out. |
This the first verbose print of a successful garbage collection. |
Use the startup options -Xverbose:memory
and -Xverbosetimestamp
or -Xverbose:opt
and -Xverbosetimestamp
to view a time and date stamp preceded by the other verbose information, as shown here:
[Thu Apr 21 10:24:11 2005][ 5656][memory ] 4.578: parallel nursery GC 22067K->7457K (65536K), 8.905 ms
[Thu Apr 21 10:24:11 2005][ 5656][memory ] 4.781: parallel nursery GC 22157K->7549K (65536K), 9.954 ms
Sample of timestamp information for -Xverbose:opt
and -Xverbosetimestamp
:
[Thu Apr 21 10:24:19 2005][ 5576][opt ] #3 4 (0x8) o jrockit/vm/Locks.monitor Enter(Ljava/lang/Object;)Ljava/lang/Object;
[Thu Apr 21 10:24:19 2005][ 5576][opt ] #3 4 (0x8) o @0x324D0A90-0x324D0AD4 3.29 ms (235.46 ms) 17.26 ms (252.72 ms)