Skip to main content


developerWorks  >   Java™ technology  >   IBM Developer kits  >   AIX  >   SDK Guide  >  

AIX

developerWorks


SDK Guide

IBM 64-bit SDK for AIX platforms, Java Technology Edition

SDK Guide

Version 6

Copyright International Business Machines Corporation 2003, 2008. All rights reserved.
US Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

Contents

| | | | | |

Preface

This user guide provides general information about the IBM(R) 64-bit SDK for AIX(R), Java(TM) Technology Edition, Version 6 and specific information about any differences in the IBM implementation compared with the Sun implementation.

Read this user guide in conjunction with the more extensive documentation on the Sun Web site: http://java.sun.com.

The software that is contained in this release can be used only on AIX Version 5.3 or later. It is not supported, and does not work, on earlier versions of the AIX operating system. See AIX Environment for further details of requirements on the AIX operating system for this release.

Useful Web sites include:

The Diagnostics Guide provides more detailed information about the IBM Virtual Machine for Java.

This user guide is part of a release and is applicable only to that particular release. Make sure that you have the user guide appropriate to the release you are using.

The terms "Runtime Environment" and "Java Virtual Machine" are used interchangeably throughout this user guide.

|Technical changes made for this version of the user |guide, other than minor or obvious ones, are indicated by blue chevrons when |viewing in an Information Center, in red with vertical bars to the left of |the changes when viewing in HTML or in a color-printed copy, or by vertical |bars to the left of the changes when viewing as a PDF.

The Program Code is not designed or intended for use in real-time applications such as (but not limited to) the online control of aircraft, air traffic, aircraft navigation, or aircraft communications; or in the design, construction, operation, or maintenance of any nuclear facility.

Overview

The IBM SDK is a development environment for writing and running applets and applications that conform to the Java 6 Core Application Program Interface (API).

Version compatibility

In general, any applet or application that ran with a previous version of the SDK should run correctly with the IBM 64-bit SDK for AIX, v6. Classes compiled with this release are not guaranteed to work on previous releases.

For information about compatibility issues between releases, see the Sun web site at:

http://java.sun.com/javase/6/webnotes/compatibility.html

http://java.sun.com/j2se/5.0/compatibility.html

http://java.sun.com/j2se/1.4/compatibility.html

http://java.sun.com/j2se/1.3/compatibility.html

If you are using the SDK as part of another product (for example, IBM WebSphere(R) Application Server), and you upgrade from a previous level of the SDK, perhaps v5.0, serialized classes might not be compatible. However, classes are compatible between service refreshes.

Migrating from other IBM JVMs

From Version 5.0, the IBM Runtime Environment for AIX contains new versions of the IBM Virtual Machine for Java and the Just-In-Time (JIT) compiler.

If you are migrating from an older IBM Runtime Environment, note that:

  • The JVM shared library libjvm.so is now stored in jre/lib/ppc64/j9vm and jre/lib/ppc64/classic.
  • From Version 5.0 onwards, the JVM Monitoring Interface (JVMMI) is no longer available. You must rewrite JVMMI applications to use the JVM Tool Interface (JVMTI) instead. The JVMTI is not functionally the equivalent of JVMMI. For information about JVMTI, see http://java.sun.com/javase/6/docs/technotes/guides/jvmti/ and the Diagnostics Guide.
  • From Version 5.0 onwards, the implementation of JNI conforms to the JNI specification, but differs from the Version 1.4.2 implementation. It returns copies of objects rather than pinning the objects. This difference can expose errors in JNI application code. For information about debugging JNI code, see -Xcheck:jni in Appendix A. Nonstandard options.
  • From Version 5.0 onwards, the format and content of garbage collector verbose logs obtained using -verbose:gc have changed. The data is now formatted as XML. The data content reflects the changes to the implementation of garbage collection in the JVM, and most of the statistics that are output have changed. You must change any programs that process the verbose GC output so that they will work with the new format and data. See the Diagnostics Guide for an example of the new verbose GC data.
  • SDK 1.4 versions of the IBM JRE included JVM specific classes in a file called core.jar. From Version 5.0 onwards, these are included in a file called vm.jar.
  • From Version 6, JVM classes are held in multiple JAR files in the jre/lib directory. This replaces the single rt.jar and core.jar from earlier releases.
  • For additional industry compatibility information, see Sun's Java 6 Compatibility Documentation: http://java.sun.com/javase/6/webnotes/compatibility.html
  • For additional deprecated API information, see Sun's Java 6 Deprecated API List: http://java.sun.com/javase/6/docs/api/deprecated-list.html
  • Tracing class dependencies, invoked using -verbose:Xclassdep, is not supported. If you specify -verbose:Xclassdep, the JVM will issue an error message and will not start.

AIX environment

The IBM 64-bit SDK for AIX, v6, runs on AIX v5.3 |Maintenance Package AIX 5300-07 or |later, or AIX v6.1.

To test whether this Java v6 SDK is supported on a specific System p(TM) system, at the system prompt type:

lscfg -p | fgrep Architecture

You should receive the reply:

Model Architecture: chrp

Only "Common Hardware Reference Platform" (chrp) systems are supported by this SDK.

The environment variable LDR_CNTRL=MAXDATA is not supported for 64-bit processes. Only use LDR_CNTRL=MAXDATA on 32-bit processes.

If you are using one of the supported non-UTF8 CJK locales, you must install one of the following filesets (the install images are available on the AIX base CDs; updates are available from the AIX fix distribution Web site:

X11.fnt.ucs.ttf (for ja_JP or Ja_JP)
X11.fnt.ucs.ttf_CN (for zh_CN or Zh_CN)
X11.fnt.ucs.ttf_KR (for ko_KR)
X11.fnt.ucs.ttf_TW (for zh_TW or Zh_TW)

Contents of the SDK and Runtime Environment

The SDK contains several development tools and a Java Runtime Environment (JRE). This section describes the contents of the SDK tools and the Runtime Environment.

Applications written entirely in Java must have no dependencies on the IBM SDK's directory structure (or files in those directories). Any dependency on the SDK's directory structure (or the files in those directories) might result in application portability problems.

The documentation package is designed to be extracted into the SDK software installation directory. If you download the compressed version, be sure to preserve the path names when you extract the files from the archive.

Contents of the Runtime Environment

A list of classes, tools, and other files that you can use with the standard Runtime Environment.

  • Core Classes - These are the compiled class files for the platform and must remain zipped for the compiler and interpreter to access them. Do not modify these classes; instead, create subclasses and override where you need to.
  • Trusted root certificates from certificate signing authorities - These certificates are used to validate the identity of signed material. The IBM Runtime Environment for Java contains an expired GTE CyberTrust Certificate for compatibility reasons. This certificate will be removed for Version 7 of the SDK. See http://www.ibm.com/support/docview.wss?uid=swg21225464 for more information.
  • JRE tools - The following tools are part of the Runtime Environment and are in the /usr/java6_64/jre/bin directory unless otherwise specified.
    ikeyman (iKeyman GUI utility)
    Allows you to manage keys, certificates, and certificate requests. For more information see the accompanying Security Guide and http://download.boulder.ibm.com/ibmdl/pub/software/dw/jdk/security/50/GSK7c_SSL_IKM_Guide.pdf. The SDK also provides a command-line version of this utility.
    java (Java Interpreter)
    Runs Java classes. The Java Interpreter runs programs that are written in the Java programming language.
    javaw (Java Interpreter)
    Runs Java classes in the same way as the java command does, but does not use a console window.
    jcontrol (Java Control Panel)
    Configures your Runtime Environment.
    jextract (Dump extractor)
    Converts a system-produced dump into a common format that can be used by jdmpview. For more information, see jdmpview.
    keytool (Key and Certificate Management Tool)
    Manages a keystore (database) of private keys and their associated X.509 certificate chains that authenticate the corresponding public keys.
    kinit
    Obtains and caches Kerberos ticket-granting tickets.
    klist
    Displays entries in the local credentials cache and key table.
    ktab
    Manages the principal names and service keys stored in a local key table.
    pack200
    Transforms a JAR file into a compressed pack200 file using the Java gzip compressor.
    policytool (Policy File Creation and Management Tool)
    Creates and modifies the external policy configuration files that define your installation's Java security policy.
    rmid (RMI activation system daemon)
    Starts the activation system daemon so that objects can be registered and activated in a Java virtual machine (JVM).
    rmiregistry (Java remote object registry)
    Creates and starts a remote object registry on the specified port of the current host.
    tnameserv (Common Object Request Broker Architecture (CORBA) transient naming service)
    Starts the CORBA transient naming service.
    unpack200
    Transforms a packed file produced by pack200 into a JAR file.

Contents of the SDK

A list of tools and reference information that is included with the standard SDK.

The following tools are part of the SDK and are located in the /usr/java6_64/bin directory:
appletviewer (Java Applet Viewer)
Tests and runs applets outside a Web browser.
apt (Annotation Processing Tool)
Finds and executes annotation processors based on the annotations present in the set of specified source files being examined.
ControlPanel (Java Control Panel)
Configures your Runtime Environment.
extcheck (Extcheck utility)
Detects version conflicts between a target jar file and currently-installed extension jar files.
idlj (IDL to Java Compiler)
Generates Java bindings from a given IDL file.
ikeycmd (iKeyman command-line utility)
Allows you to manage keys, certificates, and certificate requests from the command line. For more information see the accompanying Security Guide and http://www.ibm.com/developerworks/java/jdk/security.
jar (Java Archive Tool)
Combines multiple files into a single Java Archive (JAR) file.
jarsigner (JAR Signing and Verification Tool)
Generates signatures for JAR files and verifies the signatures of signed JAR files.
java (Java Interpreter)
Runs Java classes. The Java Interpreter runs programs that are written in the Java programming language.
javac (Java Compiler)
Compiles programs that are written in the Java programming language into bytecodes (compiled Java code).
javadoc (Java Documentation Generator)
Generates HTML pages of API documentation from Java source files.
javah (C Header and Stub File Generator)
Enables you to associate native methods with code written in the Java programming language.
javap (Class File Disassembler)
Disassembles compiled files and can print a representation of the bytecodes.
javaw (Java Interpreter)
Runs Java classes in the same way as the java command does, but does not use a console window.
jconsole (JConsole Monitoring and Management Tool)
Monitors local and remote JVMs using a GUI. JMX-compliant.
jdb (Java Debugger)
Helps debug your Java programs.
jdmpview (Cross-platform dump formatter)
Analyzes dumps. For more information, see the Diagnostics Guide.
keytool (Key and Certificate Management Tool)
Manages a keystore (database) of private keys and their associated X.509 certificate chains that authenticate the corresponding public keys.
native2ascii (Native-To-ASCII Converter)
Converts a native encoding file to an ASCII file that contains characters encoded in either Latin-1 or Unicode, or both.
policytool (Policy File Creation and Management Tool)
Creates and modifies the external policy configuration files that define your installation's Java security policy.
rmic (Java Remote Method Invocation (RMI) Stub Converter)
Generates stubs, skeletons, and ties for remote objects. Includes RMI over Internet Inter-ORB Protocol (RMI-IIOP) support.
rmid (RMI activation system daemon)
Starts the activation system daemon so that objects can be registered and activated in a Java virtual machine (JVM).
rmiregistry (Java remote object registry)
Creates and starts a remote object registry on the specified port of the current host.
schemagen
Creates a schema file for each namespace referenced in your Java classes.
serialver (Serial Version Command)
Returns the serialVersionUID for one or more classes in a format that is suitable for copying into an evolving class.
tnameserv (Common Object Request Broker Architecture (CORBA) transient naming service)
Starts the CORBA transient naming service.
wsgen
Generates JAX-WS portable artifacts used in JAX-WS web services.
wsimport
Generates JAX-WS portable artifacts from a WSDL file.
xjc
Compiles XML Schema files.
Include Files
C headers for JNI programs.
User Guide
This file.
copyright
The copyright notice for the SDK for AIX software.
License

The License file, /usr/swlag/<locale>/Java6_64.la, contains the license agreement for the SDK for AIX software (where <locale> is the name of your locale, for example en). To view or print the license agreement, open the file in a Web browser.

Installation

The IBM 64-bit SDK for AIX, v6 complete release consists of several installp image files (packages). Each installp image file or package contains one or more related filesets. You can install the packages using the smit or smitty system management tools. Alternatively, you can use the installp command.

This package is required:

  • Java6_64.sdk (license, base SDK and dt.jar)

These packages are optional:

  • Java6_64.samples (demos)
  • Java6_64.source (src.jar)
  • Java6_64.msg.$LANG (Localized messages)

$LANG is one of the following locales. These packages do not include any files but pull in required Unicode TrueType fonts, if not already installed, for these locales:

  • Zh_CN
  • zh_CN
  • ko_KR
  • Ja_JP
  • ja_JP
  • Zh_TW
  • zh_TW

The SDK is installed in the directory:

/usr/java6_64/

The following user-configurable files are installed to /etc/java6_64/ to support a configuration where the files are not shared:

  • jre/lib/jaxp.properties
  • jre/lib/logging.properties
  • jre/lib/management/jmxremote.access
  • jre/lib/management/jmxremote.password.template
  • jre/lib/management/management.properties
  • jre/lib/management/snmp.acl
  • jre/lib/management/snmp.acl.template
  • jre/lib/security/java.policy
  • jre/lib/security/java.security
  • jre/lib/xalan.properties
  • jre/lib/xerces.properties

There are symbolic links in /usr/java6_64/ pointing to the files in /etc/java6_64/.

| | |

Relocation

|
|

By default, the SDK is installed in /usr/java6_64/. |To install the SDK in another directory, use the AIX relocation commands.

|

Delete any .toc files in the directory containing |your installp images or PTFs before using the AIX relocation commands.

|

| |

Commands

|

See the AIX man pages for more information |about the command-line options for these commands.

|
|
installp_r
|
Install command. To install the SDK: |
installp_r -a -Y -R /<Install Path>/ -d '.' Java6_64.sdk
To |remove the SDK: |
installp_r -u  -R /<Install Path>/ Java6_64.sdk
|
|
lsutil
|
List the user-defined installation paths. |
lsutil
|
|
lslpp_r
|
Find details of installed products. |
lslpp_r -R /<Install Path>/ -S [A|O]
|
|
rmusil
|
Remove existing user-defined installation paths. |
rmusil -R /<Install Path>/
|
|

Upgrading the SDK

If you are upgrading the SDK from a previous release, back up all the configuration files and security policy files before you start the upgrade.

After the upgrade, you might have to restore or reconfigure these files because they might have been overwritten during the upgrade process. Check the syntax of the new files before restoring the original files because the format or options for the files might have changed.

Verification

To help ensure that the verification process behaves consistently, first:

unset LIBPATH
unset CLASSPATH
unset JAVA_COMPILER
unset JAVA_HOME
export PATH=/usr/java6_64/jre/bin:/usr/java6_64/bin:$PATH
Remember: JAVA_HOME is used in V1.1.x releases. It is not required to set JAVA_HOME in this release.

If you issue the command:

java -version

you should see:

java version "1.6.0-internal" Java(TM) SE Runtime Environment (build 20070405_01)
IBM J9 VM (build 2.4, J2RE 1.6.0 IBM J9 2.4 AIX ppc64-64 jvmap6460-20070326_12091
(JIT enabled) J9VM - 20070326_12091_bHdSMr JIT  - dev_20070326_1800 GC   -
20070319_AA)

where dates, times, and specific build numbers may be different.

When verification is complete, log on again and review for possible conflicts any values that you might have assigned to these variables.

Setting the path

If you alter the PATH environment variable, you will override any existing Java launchers in your path.

The PATH environment variable enables AIX to find programs and utilities, such as javac, java, and javadoc, from any current directory. To display the current value of your PATH, type the following at a command prompt:

echo $PATH

To add the Java launchers to your path:

  1. Edit the shell startup file in your home directory (typically .bashrc, depending on your shell) and add the absolute paths to the PATH environment variable; for example:
    export PATH=/usr/java6_64/bin:/usr/java6_64/jre/bin:$PATH
  2. Log on again or run the updated shell script to activate the new PATH environment variable.

After setting the path, you can run a tool by typing its name at a command prompt from any directory. For example, to compile the file Myfile.Java, at a command prompt, type:

javac Myfile.Java

Setting the class path

The class path tells the SDK tools, such as java, javac, and javadoc, where to find the Java class libraries.

You need to set the class path explicitly only if:

  • You require a different library or class file, such as one that you develop, and it is not in the current directory.
  • You change the location of the bin and lib directories and they no longer have the same parent directory.
  • You plan to develop or run applications using different runtime environments on the same system.

To display the current value of your CLASSPATH environment variable, type the following command at a shell prompt:

  echo $CLASSPATH

If you develop and run applications that use different runtime environments, including other versions that you have installed separately, you must set the CLASSPATH and PATH explicitly for each application. If you run multiple applications simultaneously and use different runtime environments, each application must run in its own shell prompt.

Running Java applications

Java applications can be started using the java launcher or through JNI. Settings are passed to a Java application using command-line arguments, environment variables, and properties files.

The java and javaw commands

An overview of the java and javaw commands.

Purpose

The java and javaw tools launch a Java application by starting a Java Runtime Environment and loading a specified class.

The javaw command is identical to java, except that javaw has no associated console window. Use javaw when you do not want a command prompt window to be displayed. The javaw launcher displays a dialog box with error information if a launch fails.

Usage

The JVM searches for the initial class (and other classes that are used) in three sets of locations: the bootstrap class path, the installed extensions, and the user class path. The arguments that you specify after the class name or jar file name are passed to the main function.

The java and javaw commands have the following syntax:

java [ options ] <class> [ arguments ... ]
java [ options ] -jar <file.jar> [ arguments ... ]
javaw [ options ] <class> [ arguments ... ]
javaw [ options ] -jar <file.jar> [ arguments ... ]

Parameters

[options]
Command-line options to be passed to the runtime environment.
<class>
Startup class. The class must contain a main() method.
<file.jar>
Name of the jar file to invoke. It is used only with the -jar option. The named jar file must contain class and resource files for the application, with the startup class indicated by the Main-Class manifest header.
[arguments ...]
Command-line arguments to be passed to the main() function of the startup class.

Obtaining version information

You obtain The IBM build and version number for your Java installation using the -version option. You can also obtain version information for all jar files on the class path by using the -Xjarversion option.

  1. Open a shell prompt.
  2. Type the following command:
    java -version
    You will see information similar to:
    java version "1.6.0-internal"
    Java(TM) SE Runtime Environment (build pap6460-20070913_01)
    IBM J9 VM (build 2.4, J2RE 1.6.0 IBM J9 2.4 AIX ppc64-64 jvmap6460-20070905_13799 (JIT enabled)
    J9VM - 20070905_013799_bHdSMR
    JIT  - r9_20070903_1330
    GC   - 20070830_AA)
    Exact build dates and versions will change.

You can also list the version information for all available jar files on the class path, the boot class path, and in the extensions directory. Type the following command:

java -Xjarversion

You will see information similar to:

...
/usr/java6_64/jre/lib/ext/ibmpkcs11impl.jar  VERSION: 1.0 build_20070125
/usr/java6_64/jre/lib/ext/dtfjview.jar
/usr/java6_64/jre/lib/ext/xmlencfw.jar  VERSION: 1.00, 20061011  LEVEL: -20061011

...

The information available varies for each jar file and is taken from the Implementation-Version and Build-Level properties in the manifest of the jar file.

Specifying Java options and system properties

You can specify Java options and system properties on the command line, by using an options file, or by using an environment variable.

These methods of specifying Java options are listed in order of precedence:

  1. By specifying the option or property on the command line. For example:
    java -Dmysysprop1=tcpip -Dmysysprop2=wait -Xdisablejavadump MyJavaClass
  2. By creating a file that contains the options, and specifying it on the command line using -Xoptionsfile=<file>.
  3. By creating an environment variable called IBM_JAVA_OPTIONS containing the options. For example:
    export IBM_JAVA_OPTIONS="-Dmysysprop1=tcpip -Dmysysprop2=wait -Xdisablejavadump"

Rightmost options on the command line have precedence over leftmost options; for example, if you specify:

java -Xint -Xjit myClass

The -Xjit option takes precedence.

Standard options

The definitions for the standard options.

See Appendix A. Nonstandard options for information about nonstandard (-X) options.

-agentlib:<libname>[=<options>]
Loads a native agent library <libname>; for example -agentlib:hprof. For more information, specify -agentlib:jdwp=help and -agentlib:hprof=help on the command line.
-agentpath:libname[=<options>]
Loads a native agent library by full path name.
-cp <directories and zip or jar files separated by :>
Sets the search path for application classes and resources. If -classpath and -cp are not used and the CLASSPATH environment variable is not set, the user class path is, by default, the current directory (.).
-classpath <directories and zip or jar files separated by :>
Sets the search path for application classes and resources. If -classpath and -cp are not used and the CLASSPATH environment variable is not set, the user class path is, by default, the current directory (.).
-D<property name>=<value>
Sets a system property.
-help or -?
Prints a usage message.
-javaagent:<jarpath>[=<options>]
Load a Java programming language agent. For more information, see the java.lang.instrument API documentation.
-jre-restrict-search
Include user private JREs in the version search.
-no-jre-restrict-search
Exclude user private JREs in the version search.
-showversion
Prints product version and continues.
-verbose:<option>
Enables verbose output. The available options are:
class
Writes an entry to stderr for each class that is loaded.
gc
Writes verbose garbage collection information to stderr. Use -Xverbosegclog to control the output. See the Diagnostics Guide for more information.
jni
Writes information to stderr describing the JNI services called by the application and JVM.
sizes
Writes information to stderr describing the active memory usage settings.
stack
Writes information to stderr describing the Java and C stack usage for each thread.
-version
Prints product version.
-version:<value>
Requires the specified version to run, for example "1.5".
-X
Prints help on nonstandard options.

Globalization of the java command

The java and javaw launchers accept arguments and class names containing any character that is in the character set of the current locale. You can also specify any Unicode character in the class name and arguments by using Java escape sequences.

To do this, use the -Xargencoding command-line option.

-Xargencoding
Use argument encoding. To specify a Unicode character, use escape sequences in the form \u####, where # is a hexadecimal digit (0 to 9, A to F).
-Xargencoding:utf8
Use UTF8 encoding.
-Xargencoding:latin
Use ISO8859_1 encoding.

For example, to specify a class called HelloWorld using Unicode encoding for both capital letters, use this command:

java -Xargencoding '\u0048ello\u0057orld'

The java and javaw commands provide translated messages. These messages differ based on the locale in which Java is running. The detailed error descriptions and other debug information that is returned by java is in English.

Working with the LIBPATH environment variable

The LIBPATH environment variable tells AIX applications, such as the JVM, where to find shared libraries when they are located in a different directory from the directory that is specified in the header section of the program.

For example, the header section of the java command is as follows:

> dump -X64 -H /usr/java6_64/jre/bin/java
/usr/java6_64/jre/bin/java:

                        ***Loader Section***
                      Loader Header Information
VERSION#         #SYMtableENT     #RELOCent        LENidSTR
0x00000001       0x0000003f       0x0000006d       0x00000090

#IMPfilID        OFFidSTR         LENstrTBL        OFFstrTBL
0x00000006       0x00000b24       0x00000099       0x00000bb4


                        ***Import File Strings***
INDEX  PATH                          BASE            MEMBER
0     /usr/lib:/lib

1                                    libc.a          shr.o
2                                    libC.a          shr.o
3                                    libpthreads.a   shr_comm.o
4                                    libpthreads.a   shr_xpg5.o
5                                    libbsd.a        shr.o

Index 0 (in bold above) contains the list of directories that are searched for shared objects if LIBPATH is not specified. If LIBPATH is set, the specified directories are searched for shared objects before those listed in Index 0 of the header.

The shared libraries for the SDK are in /usr/java6_64/jre/lib/ppc64/ and /usr/java6_64/jre/lib/ppc64/j9vm. The SDK's Java launcher programs (for example, java, javac, jar) automatically search these directories. If Java is installed as an AIX file set, the parent directory is /usr/java6_64/, but packages that bundle Java might use different directories. This path is already set by the Java launcher programs such as java, javac, or jar.

Set the LIBPATH if either of the following conditions applies:

  • You are using other shared libraries (including JNI native libraries you use or develop). Set the LIBPATH to include the directory or directories that contain your libraries.
  • You are using the JNI Invocation API to call Java code from you C/C++ application. Set the LIBPATH to include the directories that contain the JVM libraries in addition to those that contain your own libraries.

Controlling page sizes with the LDR_CNTRL environment variable

The POWER4(TM) and later PowerPC(R) processors support the use of 16 MB large pages in addition to the default 4 KB pages. The POWER5+(TM) and later PowerPC processors add support for two new page sizes, 64 KB and 16 GB.

AIX v5.2 and later operating systems support 16 MB pages. AIX v5.3 maintenance package 5300-04 and later operating systems add support for the 64 KB and 16 GB page sizes. The 16 MB and 16 GB pages require AIX system configuration changes. For information on using 16MB pages with AIX, see http://www.ibm.com/servers/aix/whitepapers/large_page.html. For information about using either 64 KB or 16 GB pages with AIX , see http://www.ibm.com/servers/aix/whitepapers/multiple_page.pdf. Note that the default AIX page size is 4 KB.

The LDR_CNTRL=LARGE_PAGE_DATA environment variable can be used under the AIX v5.2 and later operating systems to control the use of 16 MB pages for the native data area and native heap of a program. The native data/heap normally uses 4 KB pages. You can override that default and use 16 MB large pages, if they are available, by setting LDR_CNTRL=LARGE_PAGE_DATA=Y. Using large pages for the native data/heap might improve the performance of Java applications that require a large amount of native heap space. In particular, the native heap is used for machine code generated by the just-in-time compiler and Java applications with a large number of compiled methods might benefit from using 16 MB pages for the native heap.

AIX v5.3 maintenance package 5300-04 adds new LDR_CNTRL variants that independently control the use of different page sizes for the text (TEXTPSIZE), stack (STACKPSIZE) and native data/heap (DATAPSIZE) areas. An example of the use of these variants is:

LDR_CNTRL=TEXTPSIZE=4K@STACKPSIZE=64K@DATAPSIZE=64K

This example uses 4 KB pages for text, 64 KB pages for stack and 64 KB pages for the native data and native heap areas. A DATAPSIZE setting will override any LARGE_PAGE_DATA setting.

The new 64 KB pages are general-purpose and most workloads will see a benefit by using 64 KB pages for text, stack, native data, and the Java heap. The 16 GB pages are intended only for use in very high performance environments.

Note: Use the -Xlp option variants to request that the JVM allocates the Java heap with a specific size of pages.

For more information about using the LDR_CNTRL environment variables and on configuring AIX support for large pages, see http://www.ibm.com/servers/aix/whitepapers/large_page.html for AIX v5.2 information on 16 MB pages, and http://www.ibm.com/servers/aix/whitepapers/multiple_page.pdf for information on AIX v5.3 support of 64 KB and 16 GB pages.

The Just-In-Time (JIT) compiler

The IBM Just-In-Time (JIT) compiler dynamically generates machine code for frequently used bytecode sequences in Java applications and applets during their execution. The JIT v6 compiler delivers new optimizations as a result of compiler research, improves optimizations implemented in previous versions of the JIT, and provides better hardware exploitation.

Both the IBM SDK and Runtime Environment include the JIT, which is enabled by default in user applications and SDK tools. Normally, you do not invoke the JIT explicitly; the compilation of Java bytecode to machine code occurs transparently. You can disable the JIT to help isolate a problem. If a problem occurs when executing a Java application or an applet, you can disable the JIT to help isolate the problem. Disabling the JIT is a temporary measure only; the JIT is required to optimize performance.

The Stack Execution Disable (SED) feature in the AIX 5300-03 Recommended Maintenance package stops code from executing in data areas (Power4 and later). For more information about this feature and how it affects the SDK, see AIX Stack Execution Disable.

For more information about the JIT, see the Diagnostics Guide.

Disabling the JIT

The JIT can be disabled in a number of different ways. Both command-line options override the JAVA_COMPILER environment variable.

Turning off the JIT is a temporary measure that can help isolate problems when debugging Java applications.

  • Set the JAVA_COMPILER environment variable to NONE or the empty string before running the java application. Type the following at a shell prompt:
    export JAVA_COMPILER=NONE
  • Use the -D option on the JVM command line to set the java.compiler property to NONE or the empty string. Type the following at a shell prompt:
    java -Djava.compiler=NONE <class>
  • Use the -Xint option on the JVM command line. Type the following at a shell prompt:
    java -Xint <class>

Enabling the JIT

The JIT is enabled by default. You can explicitly enable the JIT in a number of different ways. Both command-line options override the JAVA_COMPILER environment variable.

  • Set the JAVA_COMPILER environment variable to jitc before running the Java application. At a shell prompt, enter:
    export JAVA_COMPILER=jitc
    If the JAVA_COMPILER environment variable is an empty string, the JIT remains disabled. To disable the environment variable, at the shell prompt, enter:
    unset JAVA_COMPILER
  • Use the -D option on the JVM command line to set the java.compiler property to jitc. At a shell prompt, enter:
    java -Djava.compiler=jitc <class>
  • Use the -Xjit option on the JVM command line. Do not specify the -Xint option at the same time. At a shell prompt, enter:
    java -Xjit <class>

Determining whether the JIT is enabled

You can determine the status of the JIT using the -version option.

Run the java launcher with the -version option. Enter the following at a shell prompt:

java -version

If the JIT is not in use, a message is displayed that includes the following:

(JIT disabled)

If the JIT is in use, a message is displayed that includes the following:

(JIT enabled)

For more information about the JIT, see the Diagnostics Guide.

Specifying garbage collection policy

The Garbage Collector manages the memory used by Java and by applications running within the JVM.

When the Garbage Collector receives a request for storage, unused memory in the heap is set aside in a process called "allocation". The Garbage Collector also checks for areas of memory that are no longer referenced, and releases them for reuse. This is known as "collection".

The collection phase can be triggered by a memory allocation fault, which occurs when no space is left for a storage request, or by an explicit System.gc() call.

Garbage collection can significantly affect application performance, so the IBM virtual machine provides various methods of optimizing the way garbage collection is carried out, potentially reducing the effect on your application.

For more detailed information about garbage collection, see the Diagnostics Guide.

Garbage collection options

The -Xgcpolicy options control the behavior of the Garbage Collector. They make trade-offs between throughput of the application and overall system, and the pause times that are caused by garbage collection.

The format of the option and its values is:

-Xgcpolicy:optthruput
(Default and recommended value.) Delivers very high throughput to applications, but at the cost of occasional pauses.
-Xgcpolicy:gencon
Requests the combined use of concurrent and generational GC to help minimize the time that is spent in any garbage collection pause.
-Xgcpolicy:subpool
Uses an improved object allocation algorithm to achieve better performance when allocating objects on the heap. This option might improve performance on large SMP systems.
| | |

More effective heap usage using compressed references

|
|

Many Java application workloads depend upon the Java heap |size. The IBM SDK |for Java can |use compressed references on 64-bit platforms to decrease the size of Java objects |and make more effective use of the available space.

|

The IBM SDK |for Java 64-bit |stores object references as 64-bit values. When the same application is run |on a 32-bit JVM and a 64-bit JVM, the 64-bit JVM requires a larger heap because |the references within the Java objects are larger. Using the -Xcompressedrefs command-line |option stores object references as 32-bit values and maintains the 32-bit |object size.

|

Using the -Xcompressedrefs option on a 64-bit JVM |limits the size of the Java heap to a total size similar to the |32-bit JVM, depending on platform and machine configuration.

|

Use -Xcompressedrefs on x86-based hardware, which |offers a larger set of registers when running 64-bit code, with Java applications |that do not need more memory than a 32-bit JVM can provide. Also consider |using -Xcompressedrefs for applications that use a lot |of native memory and need the rest of the JVM to run in a small footprint.

|

-Xcompressedrefs is not recommended for non-x86-based |hardware running applications that have enough space in the Java heap |provided by the 32-bit JVM. Also, applications that need more memory than |can be provided by the 32-bit JVM, cannot use -Xcompressedrefs and |must use the full 64-bit JVM.

|

See the Diagnostic |Guide for more detailed information about compressed references.

Pause time

When an application's attempt to create an object cannot be satisfied immediately from the available space in the heap, the Garbage Collector is responsible for identifying unreferenced objects (garbage), deleting them, and returning the heap to a state in which the immediate and subsequent allocation requests can be satisfied quickly.

Such garbage collection cycles introduce occasional unexpected pauses in the execution of application code. Because applications grow in size and complexity, and heaps become correspondingly larger, this garbage collection pause time tends to grow in size and significance.

The default garbage collection value, -Xgcpolicy:optthruput, delivers very high throughput to applications, but at the cost of these occasional pauses, which can vary from a few milliseconds to many seconds, depending on the size of the heap and the quantity of garbage.

The subpool option of -Xgcpolicy provides additional throughput optimization for large SMP systems (24- to 64-way).

Pause time reduction

The JVM uses two techniques to reduce pause times: concurrent garbage collection and generational garbage collection.

The -Xgcpolicy:optavgpause command-line option requests the use of concurrent garbage collection to reduce significantly the time that is spent in garbage collection pauses. Concurrent GC reduces the pause time by performing some garbage collection activities concurrently with normal program execution to minimize the disruption caused by the collection of the heap. The -Xgcpolicy:optavgpause option also limits the effect of increasing the heap size on the length of the garbage collection pause. The -Xgcpolicy:optavgpause option is most useful for configurations that have large heaps. With the reduced pause time, you might experience some reduction of throughput to your applications.

During concurrent garbage collection, a significant amount of time is wasted identifying relatively long-lasting objects that cannot then be collected. If garbage collection concentrates on only the objects that are most likely to be recyclable, you can further reduce pause times for some applications. Generational GC reduces pause times by dividing the heap into two generations: the "new" and the "tenure" areas. Objects are placed in one of these areas depending on their age. The new area is the smaller of the two and contains new objects; the tenure is larger and contains older objects. Objects are first allocated to the new area; if they have active references for long enough, they are promoted to the tenure area.

Generational GC depends on most objects not lasting long. Generational GC reduces pause times by concentrating the effort to reclaim storage on the new area because it has the most recyclable space. Rather than occasional but lengthy pause times to collect the entire heap, the new area is collected more frequently and, if the new area is small enough, pause times are comparatively short. However, generational GC has the drawback that, over time, the tenure area might become full. To minimize the pause time when this situation occurs, use a combination of concurrent GC and generational GC. The -Xgcpolicy:gencon option requests the combined use of concurrent and generational GC to help minimize the time that is spent in any garbage collection pause.

Environments with very full heaps

If the Java heap becomes nearly full, and very little garbage can be reclaimed, requests for new objects might not be satisfied quickly because no space is immediately available.

If the heap is operated at near-full