A Collection of JVM Options
A Collection of JVM Optionscompiled 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 jvm-options-list@sun.com .
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.
OptionType1.3.11.4.01.4.11.4.21.5.01.6.0Description-clientbool1.3.11.4.01.4.11.4.21.5.01.6.0Use Client HotSpot VM. Must be first option.-serverbool1.3.11.4.01.4.11.4.21.5.01.6.0Use Server HotSpot VM. Must be first option.-verbose[:class|gc|jni]bool1.3.11.4.01.4.11.4.21.5.01.6.0enable output of various pieces of the VM. specifying options twice may produce more detailed output.-cppath1.3.11.4.01.4.11.4.21.5.01.6.0set search path for application classes and resources-classpathpath1.3.11.4.01.4.11.4.21.5.01.6.0set search path for application classes and resources-versionbool1.3.11.4.01.4.11.4.21.5.01.6.0print product version and exit-showversionbool1.3.11.4.01.4.11.4.21.5.01.6.0print product version and continue-fullversionbool1.3.11.4.01.4.11.4.21.5.01.6.0print full java version and exit-agentlib:<libname>[=<options>]nv 1.6.0load native agent library <libname>, e.g. -agentlib:hprof see also, -agentlib:jdwp=help and -agentlib:hprof=help -agentpath:<pathname>[=<options>]nv 1.6.0load native agent library by full pathname-javaagent:<jarpath>[=<options>]nv 1.6.0load Java programming language agent, see java.lang.instrument-d32bool 1.4.01.4.11.4.21.5.01.6.0use a 32-bit data model if available-d64bool 1.4.01.4.11.4.21.5.01.6.0use a 64-bit data model if available-ea[:packagename...|:classname]list 1.4.01.4.11.4.21.5.01.6.0enable assertions-enableassertions[:packagename...|:classname]list 1.4.01.4.11.4.21.5.01.6.0enable assertions-da[:packagename...|:classname]list 1.4.01.4.11.4.21.5.01.6.0disable assertions-disableassertions[:packagename...|:classname]list 1.4.01.4.11.4.21.5.01.6.0disable assertions-esabool 1.4.01.4.11.4.21.5.01.6.0enable system assertions-enablesystemassertionsbool 1.4.01.4.11.4.21.5.01.6.0enable system assertions-dsabool 1.4.01.4.11.4.21.5.01.6.0disable system assertions-disablesystemassertionsbool 1.4.01.4.11.4.21.5.01.6.0disable system assertions-Dname=valuenv1.3.11.4.01.4.11.4.21.5.01.6.0set a system property-jre-restrict-searchbool 1.5.01.6.0include user private JREs in the version search-jre-no-restrict-searchbool 1.5.01.6.0exclude user private JREs in the version search-XtboolOOOOOOturn on instruction tracing-XtmboolOOOOOOturn on method tracing-Xbootclasspath:<path>list1.3.11.4.01.4.11.4.21.5.01.6.0set, append to, or prepend to boot class path-Xdebugbool1.3.11.4.01.4.11.4.21.5.01.6.0enable remote debugging-Xfuturebool1.3.11.4.01.4.11.4.21.5.01.6.0enable strictest checks, anticipating future default-Xcheck:jnibool1.3.11.4.01.4.11.4.21.5.01.6.0perform additional checks for JNI functions-Xshare:offbool 1.6.0do not attempt to use shared class data-Xshare:autobool 1.6.0use shared class data if possible (default)-Xshare:onbool 1.6.0require using shared class data, otherwise fail.-Xnoclassgcbool1.3.11.4.01.4.11.4.21.5.01.6.0disable class garbage collection-Xss<size>size1.3.11.4.01.4.11.4.21.5.01.6.0set maximum native stack size for any thread-Xoss<size>size1.3.11.4.01.4.11.4.21.5.01.6.0set 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>size1.3.11.4.01.4.11.4.21.5.01.6.0set initial Java heap size-Xmx<size>size1.3.11.4.01.4.11.4.21.5.01.6.0set maximum Java heap size-Xmn<size>size 1.4.01.4.11.4.21.5.01.6.0Size of young generation-Xrsbool1.3.11.4.01.4.11.4.21.5.01.6.0reduce the use of OS signals-Xrunhprof[:help]|[:option=value, ...]list1.3.11.4.0 1.4.21.5.01.6.0perform heap or cpu profiling-Xmaxjitcodesize<size>size1.3.11.4.01.4.11.4.21.5.01.6.0set the maximum size (in bytes) for the JIT code area-Xsqnopausebool1.3.11.4.01.4.11.4.21.5.01.6.0do not pause for user interaction on SIGQUIT-Xoptimizebool1.3.11.4.01.4.11.4.21.5.01.6.0Use optimizing JIT compiler (SPARC only). Replaced by -server in later VMs-Xmixedbool1.3.11.4.01.4.11.4.21.5.01.6.0mixed mode execution (default)-Xintbool1.3.11.4.01.4.11.4.21.5.01.6.0interpreted mode execution only-Xincgcbool1.3.11.4.01.4.11.4.21.5.01.6.0Incremental GC-Xconcgcbool 1.4.11.4.21.5.01.6.0Concurrent GC. Replaced by -XX:+UseConcMarkSweepGC (available beginning with J2SE 1.4.1)-Xprofbool1.3.11.4.01.4.11.4.21.5.01.6.0Precursor to -Xrunprof.-Xaprofpath1.3.11.4.01.4.11.4.21.5.01.6.0Simple allocation profiler. unstable. debug only.-Xloggc:<file>path 1.4.01.4.11.4.21.5.01.6.0Log garbage collection actions to a specified file.-Xcompbool1.3.11.4.01.4.11.4.21.5.01.6.0Forces HotSpot to compile 100% of the code with maximum optimization.-Xbatchbool1.3.11.4.01.4.11.4.21.5.01.6.0Forces 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.-Xconcurrentiobool1.3.11.4.01.4.11.4.21.5.01.6.0The 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.-Xgenconfigbool 1.6.01.2 option only-XverifyheapboolOOOOO 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=<value>uintx 1.4.11.4.21.5.01.6.0 -XX:AdaptiveSizeDecrementScaleFactor=<value>uintx 1.5.01.6.0 -XX:AdaptiveSizePolicyCollectionCostMargin=<value>uintx 1.5.01.6.0 -XX:AdaptiveSizePolicyFootprintThreshold=<value>uintx 1.5.0 -XX:AdaptiveSizePolicyInitializingSteps=<value>uintx 1.5.01.6.0 -XX:AdaptiveSizePolicyWeight=<value>uintx 1.4.11.4.21.5.01.6.0 -XX:AdaptiveSizeThroughPutPolicy=<value>uintx 1.5.01.6.0 -XX:AdaptiveTimeWeight=<value>uintx 1.4.11.4.21.5.01.6.0 -XX:+AdjustConcurrencybool1.3.11.4.01.4.11.4.21.5.01.6.0
[*]HotSpot Performance Tuning
-XX:+AggressiveHeapbool1.3.11.4.01.4.11.4.21.5.01.6.0This 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.
[*]Big Heaps and Intimate Shared Memory (ISM)
[*]Tuning Garbage Collection with the 1.4.2 Java Virtual Machine
-XX:+AggressiveOptsbool 1.6.0 -XX:AliasLevel=<value>intx1.3.11.4.01.4.11.4.21.5.01.6.0 -XX:AllocatePrefetchDistance=<value>intx 1.6.0 -XX:AllocatePrefetchInstr=<value>intx 1.6.0 -XX:AllocatePrefetchLines=<value>intx 1.6.0 -XX:AllocatePrefetchStepSize=<value>intx 1.6.0 -XX:AllocatePrefetchStyle=<value>intx 1.6.0 -XX:+AllowJNIEnvProxybool 1.6.0 -XX:+AllowUserSignalHandlersbool1.3.11.4.01.4.11.4.21.5.01.6.0Do not complain if the application installs signal handlers (Solaris Only)
[*]Java HotSpot VM Options
-XX:AltStackSize=<value>intx1.3.11.4.01.4.11.4.2 Alternate signal stack size (in Kbytes, Solaris Only)
[*]Java HotSpot VM Options
-XX:+AlwaysActAsServerClassMachinebool 1.6.0 -XX:+AlwaysCompileLoopMethodsbool1.3.11.4.01.4.11.4.21.5.01.6.0 -XX:AlwaysInflate=<value>intx 1.6.0 -XX:+AlwaysPreTouchbool 1.6.0 -XX:+AlwaysTenurebool 1.4.11.4.21.5.01.6.0 -XX:AppendRatio=<value>intx 1.5.01.6.0 -XX:+BackgroundCompilationbool1.3.11.4.01.4.11.4.21.5.01.6.0Enables or disables JIT compilation in the background. When enabled, interpreted methods are still executed until background compilation is complete.
[*]The Java HotSpot Virtual Machine Client Compiler
-XX:BaseFootPrintEstimate=<value>uintx 1.4.11.4.21.5.01.6.0 -XX:BCEATraceLevel=<value>intx 1.6.0 -XX:BiasedLockingBulkRebiasThreshold=<value>intx 1.6.0 -XX:BiasedLockingBulkRevokeThreshold=<value>intx 1.6.0 -XX:BiasedLockingDecayTime=<value>intx 1.6.0 -XX:BiasedLockingStartupDelay=<value>intx 1.6.0 -XX:+BindCMSThreadToCPUbool 1.6.0 -XX:+BindGCTaskThreadsToCPUsbool 1.4.11.4.21.5.01.6.0 -XX:+BindScavengeThreadsbool1.3.1 -XX:+BlockOffsetArrayUseUnallocatedBlockbool 1.4.11.4.21.5.01.6.0 -XX:+BytecodeVerificationLocalbool1.3.11.4.01.4.11.4.21.5.01.6.0
[*]Java Developer Connection Bug Parade
-XX:+BytecodeVerificationRemotebool1.3.11.4.01.4.11.4.21.5.01.6.0
[*]Java Developer Connection Bug Parade
-XX:+CheckJNICallsbool1.3.11.4.01.4.11.4.21.5.01.6.0 -XX:+CheckUnsafeOpsbool 1.4.01.4.11.4.21.5.0 -XX:CICompilerCount=<value>intx1.3.11.4.01.4.11.4.21.5.01.6.0
[*]Java Developer Connection Bug Parade
-XX:+CICompilerCountPerCPUbool 1.4.21.5.01.6.0 -XX:+CIDynamicCompilePrioritybool1.3.11.4.01.4.1 -XX:+CIMaxPrioritybool 1.4.01.4.1 -XX:+CITimebool 1.4.01.4.11.4.21.5.01.6.0Time spent in JIT Compiler
[*]Java HotSpot VM Options
-XX:+ClassUnloadingbool1.3.11.4.01.4.11.4.21.5.01.6.0 -XX:ClearFPUAtPark=<value>intx 1.6.0 -XX:+ClipInliningbool1.3.11.4.01.4.11.4.21.5.01.6.0 -XX:CMSAbortablePrecleanMinWorkPerIteration=<value>uintx 1.5.01.6.0 -XX:CMSAbortablePrecleanWaitMillis=<value>intx 1.5.01.6.0 -XX:+CMSAbortSemanticsbool 1.6.0 -XX:CMSBitMapYieldQuantum=<value>uintx 1.4.21.5.0 -XX:CMSBootstrapOccupancy=<value>intx 1.5.01.6.0 -XX:+CMSClassUnloadingEnabledbool 1.4.11.4.21.5.01.6.0It has been reported that for 1.5, this apparently needs to be combined with -XX:+CMSPermGenSweepingEnabled in order to take effect.
[*]Java Developer Connection Bug Parade
-XX:+CMSCompactWhenClearAllSoftRefsbool 1.4.11.4.21.5.01.6.0 -XX:+CMSConcurrentMTEnabledbool 1.6.0 -XX:CMSDictionaryChoice=<value>intx 1.4.0 -XX:CMSExpAvgFactor=<value>uintx 1.4.21.5.01.6.0 -XX:CMSFullGCsBeforeCompaction=<value>uintx 1.4.11.4.21.5.01.6.0Parameter 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
[*]Improving Java Application Performance and Scalability by Reducing Garbage Collection Times and Sizing Memory Using JDK 1.4.1
[*]Frequently Asked Questions about Garbage Collection in the HotspotTM JavaTM Virtual Machine
-XX:CMSIncrementalDutyCycle=<value>uintx 1.4.21.5.01.6.0 -XX:CMSIncrementalDutyCycleMin=<value>uintx 1.4.21.5.01.6.0 -XX:+CMSIncrementalModebool 1.4.21.5.01.6.0 -XX:CMSIncrementalOffset=<value>uintx 1.4.21.5.01.6.0 -XX:+CMSIncrementalPacingbool 1.4.21.5.01.6.0 -XX:CMSIncrementalSafetyFactor=<value>uintx 1.4.21.5.01.6.0 -XX:CMSIndexedFreeListReplenish=<value>uintx 1.4.11.4.21.5.01.6.0 -XX:CMSInitiatingOccupancyFraction=<value>intx 1.4.11.4.21.5.01.6.0Sets 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.
[*]Improving Java Application Performance and Scalability by Reducing Garbage Collection Times and Sizing Memory Using JDK 1.4.1
[*]Frequently Asked Questions about Garbage Collection in the HotspotTM JavaTM Virtual Machine
[*]Turbo-charging Java HotSpot Virtual Machine
-XX:+CMSLoopWarnbool 1.4.11.4.21.5.01.6.0 -XX:CMSMarkStackSize=<value>uintx 1.4.01.4.11.4.21.5.01.6.0 -XX:CMSMarkStackSizeMax=<value>uintx 1.5.01.6.0 -XX:CMSMaxAbortablePrecleanLoops=<value>uintx 1.5.01.6.0 -XX:CMSMaxAbortablePrecleanTime=<value>intx 1.5.01.6.0 -XX:+CMSNoWarningbool 1.4.01.4.1
[*]Java Developer Connection Bug Parade
-XX:+CMSParallelRemarkEnabledboolcenter
页:
[1]