IBM User Guide for Java V7 on Windows > Reference > Command-line options > JVM command-line options



-Xshareclasses

Enables class sharing.

-Xshareclasses:<suboptions>

This option can take a number of suboptions, some of which are cache utilities. Cache utilities perform the required operation on the specified cache, without starting the VM. You can combine multiple suboptions, separated by commas, but the cache utilities are mutually exclusive.

You can use the following suboptions with the -Xshareclasses option:

cacheDir=<directory>
Sets the directory in which cache data is read and written. By default, <directory> is the user's C:\Documents and Settings\<username>\Local Settings\Application Data\javasharedresources directory on Windows or /tmp/javasharedresources on Linux, AIX, z/OS, and IBM i. You must have sufficient permissions in <directory>. The JVM writes persistent cache files directly into the directory specified. Persistent cache files can be safely moved and deleted from the file system. Nonpersistent caches are stored in shared memory and have control files that describe the location of the memory. Control files are stored in a javasharedresources subdirectory of the cacheDir specified. Do not move or delete control files in this directory. The listAllCaches utility, the destroyAll utility, and the expire suboption work only in the scope of a given cacheDir.
cacheRetransformed
Enables caching of classes that have been transformed using the JVMTI RetransformClasses function. See JVMTI redefinition and retransformation of classes for more information.
destroy (Utility option)
Destroys a cache specified by the name, cacheDir, and nonpersistent suboptions. A cache can be destroyed only if all JVMs using it have shut down and the user has sufficient permissions.
destroyAll (Utility option)
Tries to destroy all caches available using the specified cacheDir and nonpersistent suboptions. A cache can be destroyed only if all JVMs using it have shut down and the user has sufficient permissions.
disableBCI
Turns off BCI support. This option can be used to override -XX:ShareClassesEnableBCI. For more information, see -XX command-line options.
enableBCI

Allows a JVMTI ClassFileLoadHook event to be triggered every time, for classes loaded from the cache. This mode also prevents caching of classes modified by JVMTI agents. For more information about this option, see Using the JVMTI ClassFileLoadHook with cached classes. This option is incompatible with the cacheRetransformed option. Using the two options together causes the JVM to end with an error message, unless -Xshareclasses:nonfatal is specified. In this case, the JVM continues without using shared classes.

This mode stores more data into the cache, and creates a Raw Class Data area by default. See the rcdSize= suboption. When using this suboption, the cache size might need to be increased with -Xscmx<size>.

A cache created without the enableBCI suboption cannot be reused with the enableBCI suboption. Attempting to do so causes the JVM to end with an error message, unless -Xshareclasses:nonfatal is specified. In this case, the JVM continues without using shared classes. A cache created with the enableBCI suboption can be reused without specifying this suboption. In this case, the JVM detects that the cache was created with the enableBCI suboption and uses the cache in this mode.

expire=<time in minutes> (Utility option)
Destroys all caches that have been unused for the time specified before loading shared classes. This option is not a utility option because it does not cause the JVM to exit. On NTFS file systems, the expire option is accurate to the nearest hour.
groupAccess
Sets operating system permissions on a new cache to allow group access to the cache. Group access can be set only when permitted by the operating system umask setting. The default is user access only.
help
Lists all the command-line options.
listAllCaches (Utility option)
Lists all the compatible and incompatible caches that exist in the specified cache directory. If you do not specify cacheDir, the default directory is used. Summary information, such as Java™ version and current usage, is displayed for each cache.
mprotect=[all | default | none]
By default, the memory pages containing the cache are protected at all times, unless a specific page is being updated. This protection helps prevent accidental or deliberate corruption to the cache. The cache header is not protected by default because this protection has a small performance cost. Specifying

all ensures that all the cache pages are protected, including the header. Specifying

none disables the page protection.

modified=<modified context>
Used when a JVMTI agent is installed that might modify bytecode at run time. If you do not specify this suboption and a bytecode modification agent is installed, classes are safely shared with an extra performance cost. The <modified context> is a descriptor chosen by the user; for example, myModification1. This option partitions the cache, so that only JVMs using context myModification1 can share the same classes. For instance, if you run an application with a modification context and then run it again with a different modification context, all classes are stored twice in the cache. See Dealing with runtime bytecode modification for more information.
name=<name>
Connects to a cache of a given name, creating the cache if it does not exist. This option is also used to indicate the cache that is to be modified by cache utilities; for example, destroy. Use the listAllCaches utility to show which named caches are currently available. If you do not specify a name, the default name "sharedcc_%u" is used. "%u" in the cache name inserts the current user name.
noaot
Disables caching and loading of AOT code.
noBootclasspath
Disables the storage of classes loaded by the bootstrap class loader in the shared classes cache. Often used with the SharedClassURLFilter API to control exactly which classes are cached. See Using the SharedClassHelper API for more information about shared class filtering.
none
Added to the end of a command line, disables class data sharing. This suboption overrides class sharing arguments found earlier on the command line.
nonfatal
Allows the JVM to start even if class data sharing fails. Normal behavior for the JVM is to refuse to start if class data sharing fails. If you select nonfatal and the shared classes cache fails to initialize, the JVM attempts to connect to the cache in read-only mode. If this attempt fails, the JVM starts without class data sharing.
nonpersistent
Uses a nonpersistent cache. The cache is lost when the operating system shuts down. Nonpersistent and persistent caches can have the same name. You must always use the nonpersistent suboption when running utilities such as destroy on a nonpersistent cache.
persistent (default for Windows and Linux platforms)
Uses a persistent cache. The cache is created on disk, which persists beyond operating system restarts. Nonpersistent and persistent caches can have the same name.
printAllStats (Utility option)
Displays detailed information about the contents of the cache specified in the name=<name> suboption. If the name is not specified, statistics are displayed about the default cache. Every class is listed in chronological order with a reference to the location from which it was loaded. See printAllStats utility for more information.
printStats[=<data_types>] (Utility option)
Displays summary information for the cache specified by the name, cacheDir, and nonpersistent suboptions. The most useful information displayed is how full the cache is and how many classes it contains. Stale classes are classes that have been updated on the file system and which the cache has therefore marked "stale". Stale classes are not purged from the cache and can be reused.

Specify one or more data types, separated by a plus symbol (+), to additionally see more detailed information about the cache content. Data types include AOT data, class paths and ROMMethods. See printStats utility for more information.

rcdSize=nnn

Controls the size of the Raw Class Data Area. The number of bytes passed to rcdSize must always be less than the total cache size. This value is always rounded down to the nearest multiple of the system page size. For example, these variations specify a Raw Class Data Area with a size of 1 MB:

-Xshareclasses:enableBCI,rcdSize=1048576
-Xshareclasses:enableBCI,rcdSize=1024k
-Xshareclasses:enableBCI,rcdSize=1m

If rcdSize is not used, and enableBCI is used, the JVM chooses a default Raw Class Data Area size.

If rcdSize is used, memory is reserved in the cache regardless of whether enableBCI is used.

If neither rcdSize or enableBCI is used, nothing is reserved in the cache for the Raw Class Data Area.

readonly
Opens an existing cache with read-only permissions. The JVM does not create a new cache with this suboption. Opening a cache read-only prevents the JVM from making any updates to the cache. It also allows the JVM to connect to caches created by other users or groups without requiring write access. By default, this suboption is not specified.
reset
Causes a cache to be destroyed and then re-created when the JVM starts up. This option can be added to the end of a command line as -Xshareclasses:reset.
silent
Disables all shared class messages, including error messages. Unrecoverable error messages, which prevent the JVM from initializing, are displayed.
verbose
Gives detailed output on the cache I/O activity, listing information about classes being stored and found. Each class loader is given a unique ID (the bootstrap loader is always 0) and the output shows the class loader hierarchy at work, where class loaders must ask their parents for a class before they can load it themselves. It is typical to see many failed requests; this behavior is expected for the class loader hierarchy. The standard option -verbose:class also enables class sharing verbose output if class sharing is enabled.
verboseAOT
Enables verbose output when compiled AOT code is being found or stored in the cache. AOT code is generated heuristically. You might not see any AOT code generated at all for a small application. You can disable AOT caching using the noaot suboption. See the IBM JVM Messages Guide for a list of the messages produced: IBM JVM Messages
verboseHelper
Enables verbose output for the Java Helper API. This output shows you how the Helper API is used by your class loader.
verboseIO
Gives detailed output on the cache I/O activity, listing information about classes being stored and found. Each class loader is given a unique ID (the bootstrap loader is always 0) and the output shows the class loader hierarchy at work, where class loaders must ask their parents for a class before they can load it themselves. It is typical to see many failed requests; this behavior is expected for the class loader hierarchy.


Parent: JVM command-line options








Error 404 - Not Found

Error 404 - Not Found

The document you are looking for may have been removed or re-named. Please contact the web site owner for further assistance.