Precompiling files provided by IBM

You can precompile files provided by IBM®, for example , to achieve a compromise between performance and predictability.

About this task

The precompilation is similar to the task of precompiling your application jars but an additional requirement applies at run time; you must ensure that your boot class path is specified correctly to use these files instead of the files in the JRE. You can do this with the -Xshareclasses option, which instructs the JVM to look first in the specified class cache ahead of the default class path locations.
Note: When using shared class caches, the name of the cache must not exceed 53 characters.

Precompile for use with the application:

Procedure
  1. From a shell prompt, enter: cd $JAVA_HOME/lib where $JAVA_HOME is your Java™ home directory.
  2. Run the admincache tool. At a shell prompt, enter:
    admincache -Xgcpolicy:metronome -populate -cacheName myCache rt.jar 

    This command populates the cache called myCache with the results of precompiling the IBM-provided file called rt.jar.

  3. Run your application specifying the -Xshareclasses option to specify the cache name. To run your application, enter:
    java -Xgcpolicy:metronome -Xnojit -Xshareclasses:name=myCache
             -classpath:$APP_HOME/main.jar:$APP_HOME/util.jar …


© Copyright IBM Corporation 2005, 2010. All Rights Reserved.
© Copyright Sun Microsystems, Inc. 1997, 2007, 901 San Antonio Rd., Palo Alto, CA 94303 USA. All rights reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
This information center is powered by Eclipse technology. (http://www.eclipse.org/)