JVM command-line options

JVM command-line options, with descriptions.

List of command-line options

Note: This list is not exhaustive. It is a list of useful IBM® JVM options. Options that include -X are specific to the IBM JVM.
-agentlib
Specifies whether debugging support is enabled in the JVM.

For more information, see Debugging a Java application. For more information about the Java™ Platform Debugger Architecture (JPDA), see Oracle Technology Network Java website.

-Xcompressedrefs

Java 1.7.1 sets compressed references by default. This setting instructs the virtual machine (VM) to store all references to objects, classes, threads, and monitors as 32-bit values, rather than 64-bit values. The use of compressed references improves the performance of many applications because objects are smaller, resulting in less frequent garbage collection, and improved memory cache usage. However, this is at the expense of a large initial allocation of 31-bit storage.

Before Java 1.7.1, the use of compressed references was optional. To balance the use of -Xcompressedrefs in a JVM server, and to offset the large initial 31-bit storage allocation, a JVM server automatically sets the -XXnosuballoc32bitmem option. The effect of this option is to avoid a large initial allocation in favor of incremental allocations as required. For many applications, this behavior is an adequate balance between performance and storage use. For applications that use many references, reducing the available 31-bit storage (or if operating within a 31-bit storage constrained environment) then the use of -Xnocompressedrefs might be preferable - consider using this option if you are constrained on 31-bit storage.

-Xnocompressedrefs
The use of -Xnocompressedrefs might be preferable for applications that use many references that reduce the available 31-bit storage (or if operating within a 31-bit storage constrained environment).
-Xms
Specifies the initial size of the heap. Specify storage sizes in multiples of 1024 bytes. Use the letter K to indicate KB, the letter M to indicate MB, and the letter G to indicate GB. For example, to specify 6,291,456 bytes as the initial size of the heap, code -Xms in one of the following ways:
-Xms6144K
-Xms6M

Specify size as a number of KB or MB. For information, see JVM command-line options in IBM SDK.

-Xmso

Sets the initial stack size for operating system threads.

For more information about the -Xmso JVM option and the default value, see -Xmso.

-Xmx
Specifies the maximum size of the heap. This fixed amount of storage is allocated by the JVM during JVM initialization.

Specify size as a number of KB or MB.

-Xscmx
Specifies the size of the shared class cache. The minimum size is 4 KB: the maximum and default sizes are platform-dependent.

Specify size as a number of KB or MB. For information, see JVM command-line options in IBM SDK.

-Xshareclasses
Specify this option to enable class data sharing in a shared class cache. The JVM connects to an existing cache or creates a cache if one does not exist. You can have multiple caches and you can specify the correct cache by adding a suboption to the -Xshareclasses option. For more information, see Class data sharing between JVMs in IBM SDK.
-XX:[+|-]EnableCPUMonitor

This defaults to -XX:-EnableCPUMonitor when running in a JVM server, however, if you want to use the enhanced JMX CPU-monitoring capabilities, it should be set to -XX:+EnableCPUMonitor. Enabling this option will incur an increased CPU usage.