These java
options control the dynamic just-in-time (JIT) compilation performed by the Java HotSpot VM.
-XX:+AggressiveOpts
Enables the use of aggressive performance optimization features. By default, this option is disabled and experimental performance features aren’t used.
-XX:AllocateInstancePrefetchLines=lines
Sets the number of lines to prefetch ahead of the instance allocation pointer. By default, the number of lines to prefetch is set to 1:
-XX:AllocateInstancePrefetchLines=1
Only the Java HotSpot Server VM supports this option.
-XX:AllocatePrefetchDistance=size
Sets the size (in bytes) of the prefetch distance for object allocation. Memory about to be written with the value of new objects is prefetched up to this distance starting from the address of the last allocated object. Each Java thread has its own allocation point.
Negative values denote that prefetch distance is chosen based on the platform. Positive values are bytes to prefetch. Append the letter k
or K
to indicate kilobytes, m
or M
to indicate megabytes, or g
or G
to indicate gigabytes. The default value is set to -1.
The following example shows how to set the prefetch distance to 1024 bytes:
-XX:AllocatePrefetchDistance=1024
Only the Java HotSpot Server VM supports this option.
-XX:AllocatePrefetchInstr=instruction
Sets the prefetch instruction to prefetch ahead of the allocation pointer. Only the Java HotSpot Server VM supports this option. Possible values are from 0 to 3. The actual instructions behind the values depend on the platform. By default, the prefetch instruction is set to 0:
-XX:AllocatePrefetchInstr=0
Only the Java HotSpot Server VM supports this option.
-XX:AllocatePrefetchLines=lines
Sets the number of cache lines to load after the last object allocation by using the prefetch instructions generated in compiled code. The default value is 1 if the last allocated object was an instance, and 3 if it was an array.
The following example shows how to set the number of loaded cache lines to 5:
-XX:AllocatePrefetchLines=5
Only the Java HotSpot Server VM supports this option.
-XX:AllocatePrefetchStepSize=size
Sets the step size (in bytes) for sequential prefetch instructions. Append the letter k
or K
to indicate kilobytes, m
or M
to indicate megabytes, g
or G
to indicate gigabytes. By default, the step size is set to 16 bytes:
-XX:AllocatePrefetchStepSize=16
Only the Java HotSpot Server VM supports this option.
-XX:AllocatePrefetchStyle=style
Sets the generated code style for prefetch instructions. The style
argument is an integer from 0 to 3:
0
Don’t generate prefetch instructions.
1
Execute prefetch instructions after each allocation. This is the default parameter.
2
Use the thread-local allocation block (TLAB) watermark pointer to determine when prefetch instructions are executed.
3
Use BIS instruction on SPARC for allocation prefetch.
Only the Java HotSpot Server VM supports this option.
-XX:+BackgroundCompilation
Enables background compilation. This option is enabled by default. To disable background compilation, specify -XX:-BackgroundCompilation
(this is equivalent to specifying -Xbatch
).
-XX:CICompilerCount=threads
Sets the number of compiler threads to use for compilation. By default, the number of threads is set to 2 for the server JVM, to 1 for the client JVM, and it scales to the number of cores if tiered compilation is used. The following example shows how to set the number of threads to 2:
-XX:CICompilerCount=2
-XX:CompileCommand=command,method[,option]
Specifies a command to perform on a method. For example, to exclude the indexOf()
method of the String
class from being compiled, use the following:
-XX:CompileCommand=exclude,java/lang/String.indexOf
Note that the full class name is specified, including all packages and subpackages separated by a slash (/
). For easier cut-and-paste operations, it’s also possible to use the method name format produced by the -XX:+PrintCompilation
and -XX:+LogCompilation
options:
-XX:CompileCommand=exclude,java.lang.String::indexOf
If the method is specified without the signature, then the command isapplied to all methods with the specified name. However, you can also specify the signature of the method in the class file format. In this case, you should enclose the arguments in quotation marks, because otherwise the shell treats the semicolon as a command end. For example, if you want to exclude only the indexOf(String)
method of the String
class from being compiled, use the following:
-XX:CompileCommand="exclude,java/lang/String.indexOf,(Ljava/lang/String;)I"
You can also use the asterisk (*) as a wildcard for class and method names. For example, to exclude all indexOf()
methods in all classes from being compiled, use the following:
-XX:CompileCommand=exclude,*.indexOf
The commas and periods are aliases for spaces, making it easier to pass compiler commands through a shell. You can pass arguments to -XX:CompileCommand
using spaces as separators by enclosing the argument in quotation marks:
-XX:CompileCommand="exclude java/lang/String indexOf"
Note that after parsing the commands passed on the command line using the -XX:CompileCommand
options, the JIT compiler then reads commands from the .hotspot_compiler
file. You can add commands to this file or specify a different file using the -XX:CompileCommandFile
option.
To add several commands, either specify the -XX:CompileCommand
option multiple times, or separate each argument with the new line separator (\n
). The following commands are available:
break
Sets a breakpoint when debugging the JVM to stop at the beginning of compilation of the specified method.
compileonly
Excludes all methods from compilation except for the specified method. As an alternative, you can use the -XX:CompileOnly
option, which lets you specify several methods.
dontinline
Prevents inlining of the specified method.
exclude
Excludes the specified method from compilation.
help
Prints a help message for the -XX:CompileCommand
option.
inline
Attempts to inline the specified method.
log
Excludes compilation logging (with the -XX:+LogCompilation
option) for all methods except for the specified method. By default, logging is performed for all compiled methods.
option
Passes a JIT compilation option to the specified method in place of the last argument (option
). The compilation option is set at the end, after the method name. For example, to enable the BlockLayoutByFrequency
option for the append()
method of the StringBuffer
class, use the following:
-XX:CompileCommand=option,java/lang/StringBuffer.append,BlockLayoutByFrequency
You can specify multiple compilation options, separated by commas or spaces.
print
Prints generated assembler code after compilation of the specified method.
quiet
Instructs not to print the compile commands. By default, the commands that you specify with the -XX:CompileCommand
option are printed; for example, if you exclude from compilation the indexOf()
method of the String
class, then the following is printed to standard output:
CompilerOracle: exclude java/lang/String.indexOf
You can suppress this by specifying the -XX:CompileCommand=quiet
option before other -XX:CompileCommand
options.
-XX:CompileCommandFile=filename
Sets the file from which JIT compiler commands are read. By default, the .hotspot_compiler
file is used to store commands performed by the JIT compiler.
Each line in the command file represents a command, a class name, and a method name for which the command is used. For example, this line prints assembly code for the toString()
method of the String
class:
print java/lang/String toString
If you’re using commands for the JIT compiler to perform on methods, then see the -XX:CompileCommand
option.
-XX:CompileOnly=methods
Sets the list of methods (separated by commas) to which compilation should be restricted. Only the specified methods are compiled. Specify each method with the full class name (including the packages and subpackages). For example, to compile only the length()
method of the String
class and the size()
method of the List
class, use the following:
-XX:CompileOnly=java/lang/String.length,java/util/List.size
Note that the full class name is specified, including all packages and subpackages separated by a slash (/
). For easier cut and paste operations, it’s also possible to use the method name format produced by the -XX:+PrintCompilation
and -XX:+LogCompilation
options:
-XX:CompileOnly=java.lang.String::length,java.util.List::size
Although wildcards aren’t supported, you can specify only the class or package name to compile all methods in that class or package, as well as specify just the method to compile methods with this name in any class:
-XX:CompileOnly=java/lang/String -XX:CompileOnly=java/lang -XX:CompileOnly=.length
-XX:CompileThreshold=invocations
Sets the number of interpreted method invocations before compilation. By default, in the server JVM, the JIT compiler performs 10,000 interpreted method invocations to gather information for efficient compilation. For the client JVM, the default setting is 1,500 invocations. This option is ignored when tiered compilation is enabled; see the option -XX:-TieredCompilation
. The following example shows how to set the number of interpreted method invocations to 5,000:
-XX:CompileThreshold=5000
You can completely disable interpretation of Java methods before compilation by specifying the -Xcomp
option.
-XX:CompileThresholdScaling=scale
Provides unified control of first compilation. This option controls when methods are first compiled for both the tiered and the nontiered modes of operation. The CompileThresholdScaling
option has an integer value between 0 and +Inf and scales the thresholds corresponding to the current mode of operation (both tiered and nontiered). Setting CompileThresholdScaling
to a value less than 1.0 results in earlier compilation while values greater than 1.0 delay compilation. Setting CompileThresholdScaling
to 0 is equivalent to disabling compilation.
-XX:+DoEscapeAnalysis
Enables the use of escape analysis. This option is enabled by default. To disable the use of escape analysis, specify -XX:-DoEscapeAnalysis
. Only the Java HotSpot Server VM supports this option.
-XX:InitialCodeCacheSize=size
Sets the initial code cache size (in bytes). Append the letter k
or K
to indicate kilobytes, m
or M
to indicate megabytes, or g
or G
to indicate gigabytes. The default value is set to 500 KB. The initial code cache size shouldn’t be less than the system's minimal memory page size. The following example shows how to set the initial code cache size to 32 KB:
-XX:InitialCodeCacheSize=32k
-XX:+Inline
Enables method inlining. This option is enabled by default to increase performance. To disable method inlining, specify -XX:-Inline
.
-XX:InlineSmallCode=size
Sets the maximum code size (in bytes) for compiled methods that should be inlined. Append the letter k
or K
to indicate kilobytes, m
or M
to indicate megabytes, or g
or G
to indicate gigabytes. Only compiled methods with the size smaller than the specified size is inlined. By default, the maximum code size is set to 1000 bytes:
-XX:InlineSmallCode=1000
-XX:+LogCompilation
Enables logging of compilation activity to a file named hotspot.log
in the current working directory. You can specify a different log file path and name using the -XX:LogFile
option.
By default, this option is disabled and compilation activity isn’t logged. The -XX:+LogCompilation
option has to be used together with the -XX:UnlockDiagnosticVMOptions
option that unlocks diagnostic JVM options.
You can enable verbose diagnostic output with a message printed to the console every time a method is compiled by using the -XX:+PrintCompilation
option.
-XX:MaxInlineSize=size
Sets the maximum bytecode size (in bytes) of a method to be inlined. Append the letter k
or K
to indicate kilobytes, m
or M
to indicate megabytes, or g
or G
to indicate gigabytes. By default, the maximum bytecode size is set to 35 bytes:
-XX:MaxInlineSize=35
-XX:MaxNodeLimit=nodes
Sets the maximum number of nodes to be used during single method compilation. By default, the maximum number of nodes is set to 65,000:
-XX:MaxNodeLimit=65000
-XX:NonNMethodCodeHeapSize=size
Sets the size in bytes of the code segment containing nonmethod code.
A nonmethod code segment containing nonmethod code, such as compiler buffers and the bytecode interpreter. This code type stays in the code cache forever. This flag is used only if —XX:SegmentedCodeCache
is enabled.
—XX:NonProfiledCodeHeapSize=size
Sets the size in bytes of the code segment containing nonprofiled methods. This flag is used only if —XX:SegmentedCodeCache
is enabled.
-XX:MaxTrivialSize=size
Sets the maximum bytecode size (in bytes) of a trivial method to be inlined. Append the letter k
or K
to indicate kilobytes, m
or M
to indicate megabytes, or g
or G
to indicate gigabytes. By default, the maximum bytecode size of a trivial method is set to 6 bytes:
-XX:MaxTrivialSize=6
-XX:+OptimizeStringConcat
Enables the optimization of String
concatenation operations. This option is enabled by default. To disable the optimization of String
concatenation operations, specify -XX:-OptimizeStringConcat
. Only the Java HotSpot Server VM supports this option.
-XX:+PrintAssembly
Enables printing of assembly code for bytecoded and native methods by using the external hsdis-<arch>.so
or .dll
library. For 64-bit VM on Windows, it’s hsdis-amd64.dll
. This let’s you to see the generated code, which may help you to diagnose performance issues.
By default, this option is disabled and assembly code isn’t printed. The -XX:+PrintAssembly
option has to be used together with the -XX:UnlockDiagnosticVMOptions
option that unlocks diagnostic JVM options.
-XX:ProfiledCodeHeapSize=size
Sets the size in bytes of the code segment containing profiled methods. This flag is used only if —XX:SegmentedCodeCache
is enabled.
-XX:+PrintCompilation
Enables verbose diagnostic output from the JVM by printing a message to the console every time a method is compiled. This let’s you to see which methods actually get compiled. By default, this option is disabled and diagnostic output isn’t printed.
You can also log compilation activity to a file by using the -XX:+LogCompilation
option.
-XX:+PrintInlining
Enables printing of inlining decisions. This let’s you to see which methods are getting inlined.
By default, this option is disabled and inlining information isn’t printed. The -XX:+PrintInlining
option has to be used together with the -XX:+UnlockDiagnosticVMOptions
option that unlocks diagnostic JVM options.
-XX:ReservedCodeCacheSize=size
Sets the maximum code cache size (in bytes) for JIT-compiled code. Append the letter k
or K
to indicate kilobytes, m
or M
to indicate megabytes, or g
or G
to indicate gigabytes. The default maximum code cache size is 240 MB; if you disable tiered compilation with the option -XX:-TieredCompilation
, then the default size is 48 MB. This option has a limit of 2 GB; otherwise, an error is generated. The maximum code cache size shouldn’t be less than the initial code cache size; see the option -XX:InitialCodeCacheSize
. This option is equivalent to -Xmaxjitcodesize
.
-XX:RTMAbortRatio=abort_ratio
Specifies the RTM abort ratio is specified as a percentage (%) of all executed RTM transactions. If a number of aborted transactions becomes greater than this ratio, then the compiled code is deoptimized. This ratio is used when the -XX:+UseRTMDeopt
option is enabled. The default value of this option is 50. This means that the compiled code is deoptimized if 50% of all transactions are aborted.
-XX:+SegmentedCodeCache
Enables segmentation of the code cache. Without the —XX:+SegmentedCodeCache
, the code cache consists of one large segment. With —XX:+SegmentedCodeCache
, we have separate segments for nonmethod, profiled method, and nonprofiled method code. These segments aren’t resized at runtime. The feature is enabled by default if tiered compilation is enabled (-XX:+TieredCompilation
) and -XX:ReservedCodeCacheSize
>= 240 MB. The advantages are better control of the memory footprint, reduced code fragmentation, and better iTLB/iCache behavior due to improved locality. iTLB/iCache is a CPU-specific term meaning Instruction Translation Lookaside Buffer (ITLB). ICache is an instruction cache in theCPU. The implementation of the code cache can be found in the file: /share/vm/code/codeCache.cpp
.
-XX:StartAggressiveSweepingAt=percent
Forces stack scanning of active methods to aggressively remove unused code when only the given percentage of the code cache is free. The default value is 10%.
-XX:RTMRetryCount=number_of_retries
Specifies the number of times that the RTM locking code is retried, when it is aborted or busy, before falling back to the normal locking mechanism. The default value for this option is 5. The -XX:UseRTMLocking
option must be enabled.
-XX:-TieredCompilation
Disables the use of tiered compilation. By default, this option is enabled. Only the Java HotSpot Server VM supports this option.
-XX:+UseAES
Enables hardware-based AES intrinsics for Intel, AMD, and SPARC hardware. Intel Westmere (2010 and newer), AMD Bulldozer (2011 and newer), and SPARC (T4 and newer) are the supported hardware. The -XX:+UseAES
is used in conjunction with UseAESIntrinsics. Flags that control intrinsics now require the option -XX:+UnlockDiagnosticVMOptions
.
-XX:+UseAESIntrinsics
Enables -XX:+UseAES
and -XX:+UseAESIntrinsics
flags by default and are supported only for the Java HotSpot Server VM. To disable hardware-based AES intrinsics, specify -XX:-UseAES -XX:-UseAESIntrinsics
. For example, to enable hardware AES, use the following flags:
-XX:+UseAES -XX:+UseAESIntrinsics
Flags that control intrinsics now require the option -XX:+UnlockDiagnosticVMOptions
. To support UseAES and UseAESIntrinsics flags, use the -server
option to select the Java HotSpot Server VM. These flags aren’t supported on Client VM.
-XX:+UseCMoveUnconditionally
Generates CMove (scalar and vector) instructions regardless of profitability analysis.
-XX:+UseCodeCacheFlushing
Enables flushing of the code cache before shutting down the compiler. This option is enabled by default. To disable flushing of the code cache before shutting down the compiler, specify -XX:-UseCodeCacheFlushing
.
-XX:+UseCondCardMark
Enables checking if the card is already marked before updating the card table. This option is disabled by default. It should be used only on machines with multiple sockets, where it increases the performance of Java applications that rely on concurrent operations. Only the Java HotSpot Server VM supports this option.
-XX:+UseCountedLoopSafepoints
Keeps safepoints in counted loops. Its default value is false.
-XX:+UseFMA
Enables hardware-based FMA intrinsics for hardware where FMA instructions are available (such as, Intel, SPARC, and ARM64). FMA intrinsics are generated for the java.lang.Math.fma(a, b, c)
methods that calculate the value of (a * b + c
) expressions.
-XX:+UseRTMDeopt
Autotunes RTM locking depending on the abort ratio. This ratio is specified by the -XX:RTMAbortRatio
option. If the number of aborted transactions exceeds the abort ratio, then the method containing the lock is deoptimized and recompiled with all locks as normal locks. This option is disabled by default. The -XX:+UseRTMLocking
option must be enabled.
-XX:+UseRTMLocking
Generates Restricted Transactional Memory (RTM) locking code for all inflated locks, with the normal locking mechanism as the fallback handler. This option is disabled by default. Options related to RTM are available only for the Java HotSpot Server VM on x86 CPUs that support Transactional Synchronization Extensions (TSX).
RTM is part of Intel's TSX, which is an x86 instruction set extension and facilitates the creation of multithreaded applications. RTM introduces the new instructions XBEGIN
, XABORT
, XEND
, and XTEST
. The XBEGIN
and XEND
instructions enclose a set of instructions to run as a transaction. If no conflict is found when running the transaction, then the memory and register modifications are committed together at the XEND
instruction. The XABORT
instruction can be used to explicitly abort a transaction and the XEND
instruction checks if a set of instructions is being run in a transaction.
A lock on a transaction is inflated when another thread tries to access the same transaction, thereby blocking the thread that didn’t originally request access to the transaction. RTM requires that a fallback set of operations be specified in case a transaction aborts or fails. An RTM lock is a lock that has been delegated to the TSX's system.
RTM improves performance for highly contended locks with low conflict in a critical region (which is code that must not be accessed by more than one thread concurrently). RTM also improves the performance of coarse-grain locking, which typically doesn’t perform well in multithreaded applications. (Coarse-grain locking is the strategy of holding locks for long periods to minimize the overhead of taking and releasing locks, while fine-grained locking is the strategy of trying to achieve maximum parallelism by locking only when necessary and unlocking as soon as possible.) Also, for lightly contended locks that are used by different threads, RTM can reduce false cache line sharing, also known as cache line ping-pong. This occurs when multiple threads from different processors are accessing different resources, but the resources share the same cache line. As a result, the processors repeatedly invalidate the cache lines of other processors, which forces them to read from main memory instead of their cache.
-XX:+UseSHA
Enables hardware-based intrinsics for SHA crypto hash functions for SPARC hardware. The UseSHA
option is used in conjunction with the UseSHA1Intrinsics
, UseSHA256Intrinsics
, and UseSHA512Intrinsics
options.
The UseSHA
and UseSHA*Intrinsics
flags are enabled by default, and are supported only for Java HotSpot Server VM 64-bit on SPARC T4 and newer.
This feature is applicable only when using the sun.security.provider.Sun
provider for SHA operations. Flags that control intrinsics now require the option -XX:+UnlockDiagnosticVMOptions
.
To disable all hardware-based SHA intrinsics, specify the -XX:-UseSHA
. To disable only a particular SHA intrinsic, use the appropriate corresponding option. For example: -XX:-UseSHA256Intrinsics
.
-XX:+UseSHA1Intrinsics
Enables intrinsics for SHA-1 crypto hash function. Flags that control intrinsics now require the option-XX:+UnlockDiagnosticVMOptions
.
-XX:+UseSHA256Intrinsics
Enables intrinsics for SHA-224 and SHA-256 crypto hash functions. Flags that control intrinsics now require the option-XX:+UnlockDiagnosticVMOptions
.
-XX:+UseSHA512Intrinsics
Enables intrinsics for SHA-384 and SHA-512 crypto hash functions. Flags that control intrinsics now require the option-XX:+UnlockDiagnosticVMOptions
.
-XX:+UseSuperWord
Enables the transformation of scalar operations into superword operations. Superword is a vectorization optimization. This option is enabled by default. To disable the transformation of scalar operations into superword operations, specify -XX:-UseSuperWord
. Only the Java HotSpot Server VM supports this option.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4