A Collection of JVM Options
compiled by: Joseph D. Mocker (Sun Microsystems, Inc.)
revision: 28.Aug.2007
This document is a compilation of all the JVM options for various versions of the JVM on primarily SPARC/Solaris Platform. The descriptions for each option are taken mostly verbatim from the reference documents.
The JavaTM HotSpot VM Options page makes some good points regarding the different types of options, which should be followed when reading this document as well. To paraphrase:
- Standard options recognized by the Java HotSpot VM are described on the Java Application Launcher reference pages.
- Options that begin with -X are non-standard (not guaranteed to be supported on all VM implementations), and are subject to change without notice in subsequent releases of the Java 2 SDK.
- Because the -XX options have specific system requirements for correct operation and may require privileged access to system configuration parameters, they are not recommended for casual use. These options are also subject to change without notice.
Please submit any comments, corrections, additions to [email protected] .
Caveats: I am not associated with any Java Platform development group, I simply put this list together from the various reference sources I could find and without referring to any source code. I have done my best to ensure the options are valid for representative JVMs, however I have not tested every version of every JVM so it is quite possible that options may not be valid in all cases.
-client | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | Use Client HotSpot VM. Must be first option. |
-server | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | Use Server HotSpot VM. Must be first option. |
-verbose[:class|gc|jni] | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | enable output of various pieces of the VM. specifying options twice may produce more detailed output. |
-cp | path | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | set search path for application classes and resources |
-classpath | path | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | set search path for application classes and resources |
-version | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | print product version and exit |
-showversion | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | print product version and continue |
-fullversion | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | print full java version and exit |
-agentlib: |
nv | 1.6.0 | load native agent library |
|||||
-agentpath: |
nv | 1.6.0 | load native agent library by full pathname | |||||
-javaagent: |
nv | 1.6.0 | load Java programming language agent, see java.lang.instrument | |||||
-d32 | bool | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | use a 32-bit data model if available | |
-d64 | bool | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | use a 64-bit data model if available | |
-ea[:packagename...|:classname] | list | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | enable assertions | |
-enableassertions[:packagename...|:classname] | list | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | enable assertions | |
-da[:packagename...|:classname] | list | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | disable assertions | |
-disableassertions[:packagename...|:classname] | list | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | disable assertions | |
-esa | bool | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | enable system assertions | |
-enablesystemassertions | bool | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | enable system assertions | |
-dsa | bool | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | disable system assertions | |
-disablesystemassertions | bool | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | disable system assertions | |
-Dname=value | nv | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | set a system property |
-jre-restrict-search | bool | 1.5.0 | 1.6.0 | include user private JREs in the version search | ||||
-jre-no-restrict-search | bool | 1.5.0 | 1.6.0 | exclude user private JREs in the version search | ||||
-Xt | bool | O | O | O | O | O | O | turn on instruction tracing |
-Xtm | bool | O | O | O | O | O | O | turn on method tracing |
-Xbootclasspath[/a|/p]: |
list | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | set, append to, or prepend to boot class path |
-Xdebug | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | enable remote debugging |
-Xfuture | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | enable strictest checks, anticipating future default |
-Xcheck:jni | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | perform additional checks for JNI functions |
-Xshare:off | bool | 1.6.0 | do not attempt to use shared class data | |||||
-Xshare:auto | bool | 1.6.0 | use shared class data if possible (default) | |||||
-Xshare:on | bool | 1.6.0 | require using shared class data, otherwise fail. | |||||
-Xnoclassgc | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | disable class garbage collection |
-Xss |
size | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | set maximum native stack size for any thread |
-Xoss |
size | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | set maximum Java stack size for any thread. Note: This option is useless with HotSpot as HotSpot doesn't have separate native and Java stacks. |
-Xms |
size | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | set initial Java heap size |
-Xmx |
size | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | set maximum Java heap size |
-Xmn |
size | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | Size of young generation | |
-Xrs | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | reduce the use of OS signals |
-Xrunhprof[:help]|[:option=value, ...] | list | 1.3.1 | 1.4.0 | 1.4.2 | 1.5.0 | 1.6.0 | perform heap or cpu profiling | |
-Xmaxjitcodesize |
size | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | set the maximum size (in bytes) for the JIT code area |
-Xsqnopause | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | do not pause for user interaction on SIGQUIT |
-Xoptimize | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | Use optimizing JIT compiler (SPARC only). Replaced by -server in later VMs |
-Xmixed | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | mixed mode execution (default) |
-Xint | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | interpreted mode execution only |
-Xincgc | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | Incremental GC |
-Xconcgc | bool | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | Concurrent GC. Replaced by -XX:+UseConcMarkSweepGC (available beginning with J2SE 1.4.1) | ||
-Xprof | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | Precursor to -Xrunprof. |
-Xaprof | path | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | Simple allocation profiler. unstable. debug only. |
-Xloggc: |
path | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | Log garbage collection actions to a specified file. | |
-Xcomp | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | Forces HotSpot to compile 100% of the code with maximum optimization. |
-Xbatch | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | Forces HotSpot to compile methods in the foreground. Normally method compilation is moved from the foreground to a background process if they take long. This allows allows the interpreted version to continue to run until the compiled version is complete. This option prevents background compiling. |
-Xconcurrentio | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | The main feature turned on with -Xconcurrentio is to use LWP based synchronization instead of thread based synchronization. We have found certain applications to speed up by over 40%. In 1.4, LWP based synchronization is the default, but -Xconcurrentio can still help since it turns on some other internal options. |
-Xgenconfig | bool | 1.6.0 | 1.2 option only | |||||
-Xverifyheap | bool | O | O | O | O | O | Verify heap integrity. Replaced by -XX:+VerifyBeforeGC -XX:+VerifyAfterGC -XX:+VerifyTLE (-XX:+VerifyTLAB in J2SE 1.4) -XX:+VerifyBeforeScavenge -XX:+VerifyAfterScavenge (all debug only) | |
-XX:AdaptivePermSizeWeight= |
uintx | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | |||
-XX:AdaptiveSizeDecrementScaleFactor= |
uintx | 1.5.0 | 1.6.0 | |||||
-XX:AdaptiveSizePolicyCollectionCostMargin= |
uintx | 1.5.0 | 1.6.0 | |||||
-XX:AdaptiveSizePolicyFootprintThreshold= |
uintx | 1.5.0 | ||||||
-XX:AdaptiveSizePolicyInitializingSteps= |
uintx | 1.5.0 | 1.6.0 | |||||
-XX:AdaptiveSizePolicyWeight= |
uintx | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | |||
-XX:AdaptiveSizeThroughPutPolicy= |
uintx | 1.5.0 | 1.6.0 | |||||
-XX:AdaptiveTimeWeight= |
uintx | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | |||
-XX:+AdjustConcurrency | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | |
|
||||||||
-XX:+AggressiveHeap | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | This option instructs the JVM to push memory use to the limit: the overall heap is more than 3850MB, the allocation area of each thread is 256K, the memory management policy defers collection as long as possible, and (beginning with J2SE 1.3.1_02) some GC activity is done in parallel. |
|
||||||||
-XX:+AggressiveOpts | bool | 1.6.0 | ||||||
-XX:AliasLevel= |
intx | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | |
-XX:AllocatePrefetchDistance= |
intx | 1.6.0 | ||||||
-XX:AllocatePrefetchInstr= |
intx | 1.6.0 | ||||||
-XX:AllocatePrefetchLines= |
intx | 1.6.0 | ||||||
-XX:AllocatePrefetchStepSize= |
intx | 1.6.0 | ||||||
-XX:AllocatePrefetchStyle= |
intx | 1.6.0 | ||||||
-XX:+AllowJNIEnvProxy | bool | 1.6.0 | ||||||
-XX:+AllowUserSignalHandlers | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | Do not complain if the application installs signal handlers (Solaris Only) |
|
||||||||
-XX:AltStackSize= |
intx | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | Alternate signal stack size (in Kbytes, Solaris Only) | ||
|
||||||||
-XX:+AlwaysActAsServerClassMachine | bool | 1.6.0 | ||||||
-XX:+AlwaysCompileLoopMethods | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | |
-XX:AlwaysInflate= |
intx | 1.6.0 | ||||||
-XX:+AlwaysPreTouch | bool | 1.6.0 | ||||||
-XX:+AlwaysTenure | bool | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | |||
-XX:AppendRatio= |
intx | 1.5.0 | 1.6.0 | |||||
-XX:+BackgroundCompilation | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | Enables or disables JIT compilation in the background. When enabled, interpreted methods are still executed until background compilation is complete. |
|
||||||||
-XX:BaseFootPrintEstimate= |
uintx | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | |||
-XX:BCEATraceLevel= |
intx | 1.6.0 | ||||||
-XX:BiasedLockingBulkRebiasThreshold= |
intx | 1.6.0 | ||||||
-XX:BiasedLockingBulkRevokeThreshold= |
intx | 1.6.0 | ||||||
-XX:BiasedLockingDecayTime= |
intx | 1.6.0 | ||||||
-XX:BiasedLockingStartupDelay= |
intx | 1.6.0 | ||||||
-XX:+BindCMSThreadToCPU | bool | 1.6.0 | ||||||
-XX:+BindGCTaskThreadsToCPUs | bool | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | |||
-XX:+BindScavengeThreads | bool | 1.3.1 | ||||||
-XX:+BlockOffsetArrayUseUnallocatedBlock | bool | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | |||
-XX:+BytecodeVerificationLocal | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | |
|
||||||||
-XX:+BytecodeVerificationRemote | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | |
|
||||||||
-XX:+CheckJNICalls | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | |
-XX:+CheckUnsafeOps | bool | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | |||
-XX:CICompilerCount= |
intx | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | |
|
||||||||
-XX:+CICompilerCountPerCPU | bool | 1.4.2 | 1.5.0 | 1.6.0 | ||||
-XX:+CIDynamicCompilePriority | bool | 1.3.1 | 1.4.0 | 1.4.1 | ||||
-XX:+CIMaxPriority | bool | 1.4.0 | 1.4.1 | |||||
-XX:+CITime | bool | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | Time spent in JIT Compiler | |
|
||||||||
-XX:+ClassUnloading | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | |
-XX:ClearFPUAtPark= |
intx | 1.6.0 | ||||||
-XX:+ClipInlining | bool | 1.3.1 | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | |
-XX:CMSAbortablePrecleanMinWorkPerIteration= |
uintx | 1.5.0 | 1.6.0 | |||||
-XX:CMSAbortablePrecleanWaitMillis= |
intx | 1.5.0 | 1.6.0 | |||||
-XX:+CMSAbortSemantics | bool | 1.6.0 | ||||||
-XX:CMSBitMapYieldQuantum= |
uintx | 1.4.2 | 1.5.0 | |||||
-XX:CMSBootstrapOccupancy= |
intx | 1.5.0 | 1.6.0 | |||||
-XX:+CMSClassUnloadingEnabled | bool | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | It has been reported that for 1.5, this apparently needs to be combined with -XX:+CMSPermGenSweepingEnabled in order to take effect. | ||
|
||||||||
-XX:+CMSCompactWhenClearAllSoftRefs | bool | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | |||
-XX:+CMSConcurrentMTEnabled | bool | 1.6.0 | ||||||
-XX:CMSDictionaryChoice= |
intx | 1.4.0 | ||||||
-XX:CMSExpAvgFactor= |
uintx | 1.4.2 | 1.5.0 | 1.6.0 | ||||
-XX:CMSFullGCsBeforeCompaction= |
uintx | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | Parameter that affects compaction of the old generation. If at least this number of concurrent collections has not succeeded between full collection, do a compaction on full collections. If 0, always do compactions on full collections when UseCMSCompactAtFullCollection is true | ||
|
||||||||
-XX:CMSIncrementalDutyCycle= |
uintx | 1.4.2 | 1.5.0 | 1.6.0 | ||||
-XX:CMSIncrementalDutyCycleMin= |
uintx | 1.4.2 | 1.5.0 | 1.6.0 | ||||
-XX:+CMSIncrementalMode | bool | 1.4.2 | 1.5.0 | 1.6.0 | ||||
-XX:CMSIncrementalOffset= |
uintx | 1.4.2 | 1.5.0 | 1.6.0 | ||||
-XX:+CMSIncrementalPacing | bool | 1.4.2 | 1.5.0 | 1.6.0 | ||||
-XX:CMSIncrementalSafetyFactor= |
uintx | 1.4.2 | 1.5.0 | 1.6.0 | ||||
-XX:CMSIndexedFreeListReplenish= |
uintx | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | |||
-XX:CMSInitiatingOccupancyFraction= |
intx | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | Sets the threshold percentage of the used heap in the old generation at which the CMS collection takes place. For example, if set to 60, the CMS collector will be initiated every time the old generation becomes 60% full. By default, this threshold is calculated at run time, and the CMS collector might be triggered only when the old generation heap is about 80-90% full. Tuning this value can improve performance in many cases. Since the CMS collector does not suspend the mutators as it sweeps and frees memory, setting this switch can ensure that enough free memory is available for object promotion from the young generation as more data is allocated by the application. Sometimes, if this switch is not tuned, CMS collection might not be able to keep up and may fail, eventually triggering the default stop-the-world mark-compact collector. Available from J2SE1.4.1. | ||
|
||||||||
-XX:+CMSLoopWarn | bool | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | |||
-XX:CMSMarkStackSize= |
uintx | 1.4.0 | 1.4.1 | 1.4.2 | 1.5.0 | 1.6.0 | ||
-XX:CMSMarkStackSizeMax= |
uintx | 1.5.0 | 1.6.0 | |||||
-XX:CMSMaxAbortablePrecleanLoops= |
uintx | 1.5.0 | 1.6.0 | |||||
-XX:CMSMaxAbortablePrecleanTime= |
intx | 1.5.0 | 1.6.0 | |||||
-XX:+CMSNoWarning | bool | 1.4.0 | 1.4.1 | |||||
|
||||||||
-XX:+CMSParallelRemarkEnabled | bool | center
|