User Guide
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:
Note: If JRockit behaves in some unexpected way, please consult the BEA JRockit Developers FAQ. If that doesn't solve your problem, please send an e-mail to support@bea.com.
Before starting BEA JRockit JVM, ensure that you have the following directory set in your PATH environment variable:
To start the BEA JRockit, at the command line enter the following:
java
<configuration and tuning options>
myClass
Where <configuration and tuning options>
are the 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 with by fully qualifying the 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 its installed) on Windows.
A sample start-up command, with some tuning options specified, might look like this:
java -verbose:memory -Xgcprio:throughput -Xmx:256m -Xms:64m -Xns:24m myClass
In this example, the following options are set:
-verbose:memory
—Displays verbose output about memory usage.-Xgcprio:throughput
—A dynamic garbage collector prioritized for memory throughput will be used.-Xmx:256m
—The maximum heap size is set to 256 megabytes.-Xms:64m
—The initial heap size is set to 64 megabytes.-Xns:24m
-—The nursery size is set to 24 megabytes.myClass
—Identifies the class that contains the Main()
method.For more information on the tuning options discussed above, please refer to
When you start BEA JRockit, you can set behavioral parameters by using either standard or non-standard command line options. This section describes these options and how to use them at startup to configure BEA JRockit. It contains information on the following subjects:
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 JVM, Sun Microsystem's HotSpot JVM, or any other third-party JVM.
The following commands set the type of JVM you want to run, server-side or client-side:
You should be aware that setting the JVM type (or accepting the default) will also set the garbage collection algorithm that will be used during runtime. -server
will start a single-spaced, parallel mark, parallel sweep collector while -client
will start a a single-spaced, concurrent mark, concurrent sweep garbage collector. If you want to use a different collector, such as the dynamic, unified garbage collector or one of the specific fixed garbage collectors, you can override the default by using either the -Xgcprio
or -Xgc
command line options. For more information on garbage collection and the -server
and -client
options, please refer to Using -server and -client to Set a Fixed Garbage Collector in Using BEA JRockit Memory System.
The following standard command line options set general information about BEA JRockit JVM:
-classpath <directories and zips/jars separated by : (Linux) or ; (Windows)>
Tells the VM where to look for 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.
-version
-showversion
-verbose[:<components
separated by ,>]
Tells JRockit to display verbose output. This option is used mainly for debugging purposes and causes a lot of output to the console. Supported components are memory
, load, gc, opt,
and codegen
. If no component is given, JRockit will display verbose information on everything. For more information on the components and the -verbose
information they display, please refer to Table 2-1.
-help
-X
Non-standard, or -X
, command line options are options that are exclusive to BEA JRockit JVM that change the behavior of BEA JRockit JVM to better suit the needs of different Java applications. These options are all preceded by -X
and will not work on other JVMs (conversely, the non-standard options used by other JVMs won't work with BEA JRockit).
Note: Since these options are non-standard, they are subject to change at any time.
The following non-standard options define general BEA JRockit JVM behavior:
-Xnoopt
-Xverify
-Xstrictfp
Enables strict floating point arithmetics globally for all methods in all classes. This option is similar to the Java keyword strictfp
. See the Java Language Specification for more details on strictfp
.
-Xverbose
-Xverbose
causes BEA JRockit to print to the screen specific information about the system. The information displayed depends upon the parameter specified with the option; for example, specifying the parameter cpuinfo
displays information about your CPU and indicates whether or not the JVM can determine if hyper threading is enabled. Table 2-1 lists the parameters available for -Xverbose
.
Note: To use more than one parameter, separate them with a comma; for example:
-Xverbosetimestamp
You can force a timestamp to print out with other information generated by -Xverbose
by using the command -Xverbosetimestamp
. When you use this command, the time and date will precede the verbose information, as shown here:
[Wed Jan 14 16:51:57 2004][14578][load ]created: java/lang/Integer : 1.4034ms
BEA JRockit allows its own Management Console, JRA, and other tools, to connect to running processes through its own proprietary interface. You can open a port on the VM that can only connect to the tools that run locally on your system and not allow a connection from other tools running anywhere else on the network. This allows authorized users to access the production system and run the tool locally so they can monitor or attach to a running BEA JRockit instance, without exposing a security hole for non-authorized users to invade production systems.
To do this, you need to run the JVM with a security manager and grant access to the management server from the host(s) to which you choose to grant privileges. Use this procedure:
When BEA JRockit JVM is run as a service (for example, the servlet engine for a web server), it might receive CTRL_LOGOFF_EVENT
or SIGHUP
. Upon receiving such events, if the VM tries to initiate shutdown, it will fail, since the operating system will not actually terminate the process. To avoid possible interference such as this, use the -Xnohup
command-line option. When this option is used with BEA JRockit, the JVM does not watch for or process CTRL_LOGOFF_EVENT
or SIGHUP
events.
If you specify -Xnohup
, be aware of the following:
System.exit()
when BEA JRockit is to be terminated.If you are running BEA JRockit on either a 32- or 64-bit Linux machine, two additional configuration options allow you to enable core dumps on Red Hat AS and to select one of two thread libraries for any Linux version. This information is described below.
If you are using Red Hat AS and want to ensure that a core/javacore file is created in the working directory in the event BEA JRockit crashes, you need to enable core dumps. To do this, set the ulimit -c
value to something greater than zero, but no greater than a value your filesystem can accommodate; for example, ulimit -c 10000000
. These values are measured in blocks, with each block equaling one kilobyte. You can set the ulimit
value either from the command line, in the *.profile
file, or in a shell script.
The Native POSIX Thread Library (NPTL) is a thread library option available for use instead of LinuxThreads with Red Hat Enterprise Linux 3.0. If you want to disable NPTL and use LinuxThreads, set LD_ASSUME_KERNEL=2.4.1
in your environment.