A Collection of JVM Options

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 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
-client bool1.3.11.4.01.4.11.4.21.5.01.6.0Use Client HotSpot VM. Must be first option.
-server bool1.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.
-cp path1.3.11.4.01.4.11.4.21.5.01.6.0set search path for application classes and resources
-classpath path1.3.11.4.01.4.11.4.21.5.01.6.0set search path for application classes and resources
-version bool1.3.11.4.01.4.11.4.21.5.01.6.0print product version and exit
-showversion bool1.3.11.4.01.4.11.4.21.5.01.6.0print product version and continue
-fullversion bool1.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
-d32 bool 1.4.01.4.11.4.21.5.01.6.0use a 32-bit data model if available
-d64 bool 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
-esa bool 1.4.01.4.11.4.21.5.01.6.0enable system assertions
-enablesystemassertions bool 1.4.01.4.11.4.21.5.01.6.0enable system assertions
-dsa bool 1.4.01.4.11.4.21.5.01.6.0disable system assertions
-disablesystemassertions bool 1.4.01.4.11.4.21.5.01.6.0disable system assertions
-Dname=value nv1.3.11.4.01.4.11.4.21.5.01.6.0set a system property
-jre-restrict-search bool    1.5.01.6.0include user private JREs in the version search
-jre-no-restrict-search bool    1.5.01.6.0exclude user private JREs in the version search
-Xt boolOOOOOOturn on instruction tracing
-Xtm boolOOOOOOturn on method tracing
-Xbootclasspath[/a|/p]:<path> list1.3.11.4.01.4.11.4.21.5.01.6.0set, append to, or prepend to boot class path
-Xdebug bool1.3.11.4.01.4.11.4.21.5.01.6.0enable remote debugging
-Xfuture bool1.3.11.4.01.4.11.4.21.5.01.6.0enable strictest checks, anticipating future default
-Xcheck:jni bool1.3.11.4.01.4.11.4.21.5.01.6.0perform additional checks for JNI functions
-Xshare:off bool     1.6.0do not attempt to use shared class data
-Xshare:auto bool     1.6.0use shared class data if possible (default)
-Xshare:on bool     1.6.0require using shared class data, otherwise fail.
-Xnoclassgc bool1.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
-Xrs bool1.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
-Xsqnopause bool1.3.11.4.01.4.11.4.21.5.01.6.0do not pause for user interaction on SIGQUIT
-Xoptimize bool1.3.11.4.01.4.11.4.21.5.01.6.0Use optimizing JIT compiler (SPARC only). Replaced by -server in later VMs
-Xmixed bool1.3.11.4.01.4.11.4.21.5.01.6.0mixed mode execution (default)
-Xint bool1.3.11.4.01.4.11.4.21.5.01.6.0interpreted mode execution only
-Xincgc bool1.3.11.4.01.4.11.4.21.5.01.6.0Incremental GC
-Xconcgc bool  1.4.11.4.21.5.01.6.0Concurrent GC. Replaced by -XX:+UseConcMarkSweepGC (available beginning with J2SE 1.4.1)
-Xprof bool1.3.11.4.01.4.11.4.21.5.01.6.0Precursor to -Xrunprof.
-Xaprof path1.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.
-Xcomp bool1.3.11.4.01.4.11.4.21.5.01.6.0Forces HotSpot to compile 100% of the code with maximum optimization.
-Xbatch bool1.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.
-Xconcurrentio bool1.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.
-Xgenconfig bool     1.6.01.2 option only
-Xverifyheap boolOOOOO 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:+AdjustConcurrency bool1.3.11.4.01.4.11.4.21.5.01.6.0 
-XX:+AggressiveHeap bool1.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.
-XX:+AggressiveOpts bool     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:+AllowJNIEnvProxy bool     1.6.0 
-XX:+AllowUserSignalHandlers bool1.3.11.4.01.4.11.4.21.5.01.6.0Do not complain if the application installs signal handlers (Solaris Only)
-XX:AltStackSize=<value> intx1.3.11.4.01.4.11.4.2  Alternate signal stack size (in Kbytes, Solaris Only)
-XX:+AlwaysActAsServerClassMachine bool     1.6.0 
-XX:+AlwaysCompileLoopMethods bool1.3.11.4.01.4.11.4.21.5.01.6.0 
-XX:AlwaysInflate=<value> intx     1.6.0 
-XX:+AlwaysPreTouch bool     1.6.0 
-XX:+AlwaysTenure bool  1.4.11.4.21.5.01.6.0 
-XX:AppendRatio=<value> intx    1.5.01.6.0 
-XX:+BackgroundCompilation bool1.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.
-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:+BindCMSThreadToCPU bool     1.6.0 
-XX:+BindGCTaskThreadsToCPUs bool  1.4.11.4.21.5.01.6.0 
-XX:+BindScavengeThreads bool1.3.1      
-XX:+BlockOffsetArrayUseUnallocatedBlock bool  1.4.11.4.21.5.01.6.0 
-XX:+BytecodeVerificationLocal bool1.3.11.4.01.4.11.4.21.5.01.6.0 
-XX:+BytecodeVerificationRemote bool1.3.11.4.01.4.11.4.21.5.01.6.0 
-XX:+CheckJNICalls bool1.3.11.4.01.4.11.4.21.5.01.6.0 
-XX:+CheckUnsafeOps bool 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 
-XX:+CICompilerCountPerCPU bool   1.4.21.5.01.6.0 
-XX:+CIDynamicCompilePriority bool1.3.11.4.01.4.1    
-XX:+CIMaxPriority bool 1.4.01.4.1    
-XX:+CITime bool 1.4.01.4.11.4.21.5.01.6.0Time spent in JIT Compiler
-XX:+ClassUnloading bool1.3.11.4.01.4.11.4.21.5.01.6.0 
-XX:ClearFPUAtPark=<value> intx     1.6.0 
-XX:+ClipInlining bool1.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:+CMSAbortSemantics bool     1.6.0 
-XX:CMSBitMapYieldQuantum=<value> uintx   1.4.21.5.0  
-XX:CMSBootstrapOccupancy=<value> intx    1.5.01.6.0 
-XX:+CMSClassUnloadingEnabled bool  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.
-XX:+CMSCompactWhenClearAllSoftRefs bool  1.4.11.4.21.5.01.6.0 
-XX:+CMSConcurrentMTEnabled bool     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
-XX:CMSIncrementalDutyCycle=<value> uintx   1.4.21.5.01.6.0 
-XX:CMSIncrementalDutyCycleMin=<value> uintx   1.4.21.5.01.6.0 
-XX:+CMSIncrementalMode bool   1.4.21.5.01.6.0 
-XX:CMSIncrementalOffset=<value> uintx   1.4.21.5.01.6.0 
-XX:+CMSIncrementalPacing bool   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.
-XX:+CMSLoopWarn bool  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:+CMSNoWarning bool 1.4.01.4.1    
-XX:+CMSParallelRemarkEnabled bool
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值