Java HotSpot VM Options
来源:互联网 发布:php用echo输出表格 编辑:程序博客网 时间:2024/05/22 01:51
Users of JDKs older than 1.3.0 who wish to port to a Java HotSpot VM, should see Java HotSpot Equivalents of Exact VM flags.
Categories of Java HotSpot VM Options
Standard options recognized by the Java HotSpot VM are described on the Java Application Launcher reference pages forWindows,Solaris andLinux. This document deals exclusively with non-standard options recognized by the Java HotSpot VM:
- 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 JDK. - Options that are specified with
-XX
are not stable and are not recommended for casual use. These options are subject to change without notice.
Some Useful -XX Options
Default values are listed for Java SE 6 for Solaris Sparc with -server. Some options may vary per architecture/OS/JVM version. Platforms with a differing default value are listed in the description.
- Boolean options are turned on with
-XX:+<option>
and turned off with-XX:-<option>
. - Numeric options are set with
-XX:<option>=<number>
. Numbers can include 'm' or 'M' for megabytes, 'k' or 'K' for kilobytes, and 'g' or 'G' for gigabytes (for example, 32k is the same as 32768). - String options are set with
-XX:<option>=<string>
, are usually used to specify a file, a path, or a list of commands
Flags marked as manageable are dynamically writeable through the JDK management interface (com.sun.management.HotSpotDiagnosticMXBean API) and also through JConsole. InMonitoring and Managing Java SE 6 Platform Applications, Figure 3 shows an example. The manageable flags can also be set through jinfo -flag.
The options below are loosely grouped into three categories.
- Behavioral options change the basic behavior of the VM.
- Performance tuning options are knobs which can be used to tune VM performance.
- Debugging options generally enable tracing, printing, or output of VM information.
Behavioral Options
Back to Options
Performance Options
-XX:AllocatePrefetchLines=1Number of cache lines to load after the last object allocation using prefetch instructions generated in JIT compiled code. Default values are 1 if the last allocated object was an instance and 3 if it was an array.
-XX:AllocatePrefetchStyle=1Generated code style for prefetch instructions.
0 - no prefetch instructions are generate*d*,
1 - execute prefetch instructions after each allocation,
2 - use TLAB allocation watermark pointer to gate when prefetch instructions are executed.
-XX:+UseCompressedStringsUse a byte[] for Strings which can be represented as pure ASCII. (Introduced in Java 6 Update 21 Performance Release)
-XX:+OptimizeStringConcatOptimize String concatenation operations where possible. (Introduced in Java 6 Update 20)
Back to Options
Debugging Options
< cmd args>"Run user-defined commands when an OutOfMemoryError is first thrown. (Introduced in 1.4.2 update 12, 6)-XX:-PrintClassHistogramPrint a histogram of class instances on Ctrl-Break.Manageable. (Introduced in 1.4.2.) The jmap -histo command provides equivalent functionality.-XX:-PrintConcurrentLocksPrint java.util.concurrent locks in Ctrl-Break thread dump.Manageable. (Introduced in 6.) The jstack -l command provides equivalent functionality.-XX:-PrintCommandLineFlagsPrint flags that appeared on the command line. (Introduced in 5.0.)-XX:-PrintCompilationPrint message when a method is compiled.-XX:-PrintGCPrint messages at garbage collection. Manageable.-XX:-PrintGCDetailsPrint more details at garbage collection.Manageable. (Introduced in 1.4.0.)-XX:-PrintGCTimeStampsPrint timestamps at garbage collection.Manageable (Introduced in 1.4.0.)-XX:-PrintTenuringDistributionPrint tenuring age information.-XX:-TraceClassLoadingTrace loading of classes.-XX:-TraceClassLoadingPreorderTrace all classes loaded in order referenced (not loaded). (Introduced in 1.4.2.)-XX:-TraceClassResolutionTrace constant pool resolutions. (Introduced in 1.4.2.)-XX:-TraceClassUnloadingTrace unloading of classes.-XX:-TraceLoaderConstraintsTrace recording of loader constraints. (Introduced in 6.)-XX:+PerfSaveDataToFileSaves jvmstat binary data on exit.-XX:ParallelGCThreads=Sets the number of garbage collection threads in the young and old parallel garbage collectors. The default value varies with the platform on which the JVM is running.-XX:+UseCompressedOopsEnables the use of compressed pointers (object references represented as 32 bit offsets instead of 64-bit pointers) for optimized 64-bit performance with Java heap sizes less than 32gb.-XX:+AlwaysPreTouchPre-touch the Java heap during JVM initialization. Every page of the heap is thus demand-zeroed during initialization rather than incrementally during application execution.-XX:AllocatePrefetchDistance=Sets the prefetch distance for object allocation. Memory about to be written with the value of new objects is prefetched into cache at this distance (in bytes) beyond the address of the last allocated object. Each Java thread has its own allocation point. The default value varies with the platform on which the JVM is running.-XX:InlineSmallCode=Inline a previously compiled method only if its generated native code size is less than this. The default value varies with the platform on which the JVM is running.-XX:MaxInlineSize=35Maximum bytecode size of a method to be inlined.-XX:FreqInlineSize=Maximum bytecode size of a frequently executed method to be inlined. The default value varies with the platform on which the JVM is running.-XX:LoopUnrollLimit=Unroll loop bodies with server compiler intermediate representation node count less than this value. The limit used by the server compiler is a function of this value, not the actual value. The default value varies with the platform on which the JVM is running.-XX:InitialTenuringThreshold=7Sets the initial tenuring threshold for use in adaptive GC sizing in the parallel young collector. The tenuring threshold is the number of times an object survives a young collection before being promoted to the old, or tenured, generation.-XX:MaxTenuringThreshold=Sets the maximum tenuring threshold for use in adaptive GC sizing. The current largest value is 15. The default value is 15 for the parallel collector and is 4 for CMS.
- Java HotSpot VM Options
- Java HotSpot VM Options
- Java HotSpot VM Options
- Java HotSpot VM Options
- Java HotSpot VM Options
- Java HotSpot VM Options
- Java HotSpot VM Options
- Java HotSpot VM Options
- Java HotSpot VM 参数
- Java HotSpot VM 簡介
- Java HotSpot VM 簡介
- Java Hotspot VM [顶]
- Java HotSpot VM
- Java VM Options
- Java HotSpot Client VM 和 Java HotSpot Server VM
- Java HotSpot Client VM 和 Java HotSpot Server VM
- JAVA HOTSPOT VM参数大全
- Java HotSpot VM命名参数选项详解
- UVA113
- Android网络编程(上)--- URL与HttpURLConnection
- 三十分钟掌握STL (3)
- HDU 4869 Turn the pokers(思维+组合公式+快速幂)
- UVA621
- Java HotSpot VM Options
- uva10954 - Add All(multiset函数)
- 指针变量
- 为何Android Auto未来会是行业规则改变者
- cocos2dx 网络编程(CCHttpRequest和CURL两个方式)
- Hibernate配置连接池
- poj 3273 二分
- bash编程入门
- 阶段一:2014/7/23 c中的register