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 [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.

Option Type 1.3.1 1.4.0 1.4.1 1.4.2 1.5.0 1.6.0 Description
-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 , e.g. -agentlib:hprof see also, -agentlib:jdwp=help and -agentlib:hprof=help
-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  
  • HotSpot Performance Tuning
-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.
  • Big Heaps and Intimate Shared Memory (ISM)
  • Tuning Garbage Collection with the 1.4.2 Java[tm] Virtual Machine
-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)
  • Java HotSpot VM Options
-XX:AltStackSize= intx 1.3.1 1.4.0 1.4.1 1.4.2     Alternate signal stack size (in Kbytes, Solaris Only)
  • Java HotSpot VM Options
-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.
  • The Java HotSpot Virtual Machine Client Compiler
-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  
  • Java Developer Connection Bug Parade
-XX:+BytecodeVerificationRemote bool 1.3.1 1.4.0 1.4.1 1.4.2 1.5.0 1.6.0  
  • Java Developer Connection Bug Parade
-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  
  • Java Developer Connection Bug Parade
-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
  • Java HotSpot VM Options
-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.
  • Java Developer Connection Bug Parade
-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
  • 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= 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.
  • 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:+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        
  • Java Developer Connection Bug Parade
-XX:+CMSParallelRemarkEnabled bool center
  • java中堆(heap)和堆栈(stack)有什么区别
    2011-05-10 14:29 617
    stack 和 heep 都是内存的一部分 stack 空间 ...
  • JVM & Memory (5) final
    2011-05-10 14:25 673
    先说tuning,gc有两个指标,一个是frequentcy( ...
  • JVM & Memory (4) gc
    2011-05-10 14:22 671
    不同的JVM实现对堆结构的设计有所不同,这里先说说共性的,然后 ...
  • JVM & Memory (3) thread
    2011-05-10 14:21 735
    以下继续探讨,说说jvm� ...
  • JVM & Memory (2) java.exe
    2011-05-10 14:20 718
    上篇说到了关于java heap� ...
  • JVM & Memory (1) paging
    2011-05-10 14:19 718
    近期看了一些有关JVM和内存的资料,为了避免遗忘,特在这里作一 ...
  • JDK TOOLS
    2011-05-10 14:15 517
    以下这几种工具(存在于 ...
  • jvm日志分析工具应用
    2011-05-10 14:14 2311
    涛涛学习笔记之gc日志分析工具 测试环境:xp+weblog ...
  • JVM优化配置
    2011-05-10 13:56 661
    OOM 这个缩写就是Java程� ...
  • 高手详细介绍JVM是什么?
    2011-05-10 13:52 569
    首先这里澄清两个概念:JVM实例和JVM执行引擎实例,JVM实 ...
  • JVM监控工具介绍
    2011-03-22 14:25 635
    ...
  • 正确认识java JVM与c/c++的执行效率
    2011-03-22 10:43 1091
    认为Java 不能写JVM是完全错误的。JNode是一个用 ...
  • Java虚拟机(JVM)参数配置说明
    2011-03-22 10:26 663
    Java虚拟机(JVM)参数配置说明   ...
  • 解析 Java 类和对象的初始化过程
    2011-03-21 23:40 667
    解析 Java 类和对象的初始化过程 由一个单态模式引出的问 ...
  • JDK的概念、组成及JDK常用包
    2011-03-18 22:09 704
    JDK概述 JDK (Java Development ...
  • 安装JDK后JRE与JVM联系浅谈
    2011-03-18 22:08 649
    安装JDK后JRE、JVM之间的� ...
  • 详细介绍什么是Java虚拟机
    2011-03-18 22:07 536
    本文由浅入深,先从什么是Java虚拟机、Java虚拟机 ...
  • 认识Java虚拟机及其性能
    2011-03-18 22:04 539
    Java虚拟机(Java virtual ...
  • JVM GC调整优化过程全揭秘
    2011-03-18 22:03 575
    JVM GC调整优化是以个极为复杂的过程,由于各个程序具备 ...
  • Java虚拟机的研究与实现(图文)
    2011-03-18 21:59 759
    引言 Java 虚拟机本质是就是一个程序,当它在命令行 ...
Global site tag (gtag.js) - Google Analytics

你可能感兴趣的:(JVM,CMS,JNI,Solaris,J2SE)