Java HotSpot VM Options
来源:互联网 发布:诺基亚6220c软件 编辑:程序博客网 时间:2024/05/22 07:03
Java HotSpot VM Options
Java HotSpot VM Options
At a Glance
Core
Database
Desktop
Accessibility
Security
Tools
Web Services
Real-Time
Overview
Basic
CORBA
HotSpot VM
JNDI
Mntr-Mgmt
Tools APIs
XML
Please note that this page only applies to JDK 7 and earlier releases. For JDK 8 please see the Windows, Solaris, Linux and Mac OS X reference pages.
This document provides information on typical command-line options and environment variables that can affect the performance characteristics of the Java HotSpot Virtual Machine. Unless otherwise noted, all information in this document pertains to both the Java HotSpot Client VM and the Java HotSpot Server VM.
Categories of Java HotSpot VM Options
Standard options recognized by the Java HotSpot VM are described on the Java Application Launcher reference pages for Windows and Solaris & Linux. 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 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>
.Disa - 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. In Monitoring 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 categories.
- Behavioral options change the basic behavior of the VM.
- Garbage First (G1) Garbage Collection Options
- 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
Garbage First (G1) Garbage Collection 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 -histocommand provides equivalent functionality.-XX:-PrintConcurrentLocksPrint java.util.concurrent locks in Ctrl-Break thread dump. Manageable. (Introduced in 6.) The jstack -lcommand 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:-PrintAdaptiveSizePolicyEnables printing of information about adaptive generation sizing.-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:+PerfDataSaveToFileSaves jvmstat binary data on exit.-XX:ParallelGCThreads=nSets 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=nSets 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=nInline 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=nMaximum 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=nUnroll 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=nSets 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.-Xloggc:<filename>Log GC verbose output to specified file. The verbose output is controlled by the normal verbose GC flags.-XX:-UseGCLogFileRotationEnabled GC log rotation, requires -Xloggc.-XX:NumberOfGClogFiles=1Set the number of files to use when rotating logs, must be >= 1. The rotated log files will use the following naming scheme, <filename>.0, <filename>.1, ..., <filename>.n-1.-XX:GCLogFileSize=8KThe size of the log file at which point the log will be rotated, must be >= 8K.
- 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命名参数选项详解
- java中的Object...是什么意思详解。
- 单机数据库更改数据文件redo控制文件的位置
- HDOJ 1072 Nightmare
- HDU 1016 Prime Ring Problem dfs
- java8中map的新方法--replace
- Java HotSpot VM Options
- openjudge SDAU 约瑟夫环问题
- HDU 4148Length of S(n)(兴爷版)
- Android动态加载—so文件
- 谈谈iOS 的加密技术
- IOS RunLoop浅析 三
- 标识符
- TCP连接状态详解及TIME_WAIT过多的解决方法
- SQLite