2 .\" Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
6 .\" Date: 03 March 2015
7 .\" SectDesc: Basic Tools
10 .\" Part Number: E38209-04
14 .TH "java" "1" "03 March 2015" "JDK 8" "Basic Tools"
15 .\" -----------------------------------------------------------------
16 .\" * Define some portability stuff
17 .\" -----------------------------------------------------------------
18 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19 .\" http://bugs.debian.org/507673
20 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
21 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24 .\" -----------------------------------------------------------------
25 .\" * set default formatting
26 .\" -----------------------------------------------------------------
27 .\" disable hyphenation
29 .\" disable justification (adjust text to left margin only)
31 .\" -----------------------------------------------------------------
32 .\" * MAIN CONTENT STARTS HERE *
33 .\" -----------------------------------------------------------------
35 java \- Launches a Java application\&.
42 \fBjava\fR [\fIoptions\fR] \fIclassname\fR [\fIargs\fR]
52 \fBjava\fR [\fIoptions\fR] \fB\-jar\fR \fIfilename\fR [\fIargs\fR]
60 Command\-line options separated by spaces\&. See Options\&.
65 The name of the class to be launched\&.
70 The name of the Java Archive (JAR) file to be called\&. Used only with the
77 The arguments passed to the
79 method separated by spaces\&.
85 command starts a Java application\&. It does this by starting the Java Runtime Environment (JRE), loading the specified class, and calling that class\*(Aqs
87 method\&. The method must be declared
90 \fIstatic\fR, it must not return any value, and it must accept a
92 array as a parameter\&. The method declaration has the following form:
98 \fBpublic static void main(String[] args)\fR
107 command can be used to launch a JavaFX application by loading a class that either has a
109 method or that extends
110 \fBjavafx\&.application\&.Application\fR\&. In the latter case, the launcher constructs an instance of the
114 method, and then calls the
115 \fBstart(javafx\&.stage\&.Stage)\fR
118 By default, the first argument that is not an option of the
120 command is the fully qualified name of the class to be called\&. If the
122 option is specified, its argument is the name of the JAR file containing class and resource files for the application\&. The startup class must be indicated by the
124 manifest header in its source code\&.
126 The JRE searches for the startup class (and other classes used by the application) in three sets of locations: the bootstrap class path, the installed extensions, and the user\(cqs class path\&.
128 Arguments after the class file name or the JAR file name are passed to the
135 command supports a wide range of options that can be divided into the following categories:
156 Non\-Standard Options
167 Advanced Runtime Options
178 Advanced JIT Compiler Options
189 Advanced Serviceability Options
200 Advanced Garbage Collection Options
203 Standard options are guaranteed to be supported by all implementations of the Java Virtual Machine (JVM)\&. They are used for common actions, such as checking the version of the JRE, setting the class path, enabling verbose output, and so on\&.
205 Non\-standard options are general purpose options that are specific to the Java HotSpot Virtual Machine, so they are not guaranteed to be supported by all JVM implementations, and are subject to change\&. These options start with
208 Advanced options are not recommended for casual use\&. These are developer options used for tuning specific areas of the Java HotSpot Virtual Machine operation that often have specific system requirements and may require privileged access to system configuration parameters\&. They are also not guaranteed to be supported by all JVM implementations, and are subject to change\&. Advanced options start with
211 To keep track of the options that were deprecated or removed in the latest release, there is a section named Deprecated and Removed Options at the end of the document\&.
213 Boolean options are used to either enable a feature that is disabled by default or disable a feature that is enabled by default\&. Such options do not require a parameter\&. Boolean
215 options are enabled using the plus sign (\fB\-XX:+\fR\fIOptionName\fR) and disabled using the minus sign (\fB\-XX:\-\fR\fIOptionName\fR)\&.
217 For options that require an argument, the argument may be separated from the option name by a space, a colon (:), or an equal sign (=), or the argument may directly follow the option (the exact syntax differs for each option)\&. If you are expected to specify the size in bytes, you can use no suffix, or use the suffix
229 for gigabytes (GB)\&. For example, to set the size to 8 GB, you can specify either
234 as the argument\&. If you are expected to specify the percentage, use a number from 0 to 1 (for example, specify
237 .SS "Standard Options"
239 These are the most commonly used options that are supported by all implementations of the JVM\&.
241 \-agentlib:\fIlibname\fR[=\fIoptions\fR]
243 Loads the specified native agent library\&. After the library name, a comma\-separated list of options specific to the library can be used\&.
247 is specified, then the JVM attempts to load the library named
249 in the location specified by the
250 \fBLD_LIBRARY_PATH\fR
251 system variable (on OS X this variable is
252 \fBDYLD_LIBRARY_PATH\fR)\&.
254 The following example shows how to load the heap profiling tool (HPROF) library and get sample CPU information every 20 ms, with a stack depth of 3:
260 \fB\-agentlib:hprof=cpu=samples,interval=20,depth=3\fR
266 The following example shows how to load the Java Debug Wire Protocol (JDWP) library and listen for the socket connection on port 8000, suspending the JVM before the main class loads:
272 \fB\-agentlib:jdwp=transport=dt_socket,server=y,address=8000\fR
278 For more information about the native agent libraries, refer to the following:
289 \fBjava\&.lang\&.instrument\fR
290 package description at http://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package\-summary\&.html
301 Agent Command Line Options in the JVM Tools Interface guide at http://docs\&.oracle\&.com/javase/8/docs/platform/jvmti/jvmti\&.html#starting
305 \-agentpath:\fIpathname\fR[=\fIoptions\fR]
307 Loads the native agent library specified by the absolute path name\&. This option is equivalent to
309 but uses the full path and file name of the library\&.
314 Selects the Java HotSpot Client VM\&. The 64\-bit version of the Java SE Development Kit (JDK) currently ignores this option and instead uses the Server JVM\&.
316 For default JVM selection, see Server\-Class Machine Detection at
317 http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/server\-class\&.html
320 \-D\fIproperty\fR=\fIvalue\fR
322 Sets a system property value\&. The
324 variable is a string with no spaces that represents the name of the property\&. The
326 variable is a string that represents the value of the property\&. If
328 is a string with spaces, then enclose it in quotation marks (for example
329 \fB\-Dfoo="foo bar"\fR)\&.
334 Runs the application in a 32\-bit environment\&. If a 32\-bit environment is not installed or is not supported, then an error will be reported\&. By default, the application is run in a 32\-bit environment unless a 64\-bit system is used\&.
339 Runs the application in a 64\-bit environment\&. If a 64\-bit environment is not installed or is not supported, then an error will be reported\&. By default, the application is run in a 32\-bit environment unless a 64\-bit system is used\&.
341 Currently only the Java HotSpot Server VM supports 64\-bit operation, and the
343 option is implicit with the use of
346 option is ignored with the use of
347 \fB\-d64\fR\&. This is subject to change in a future release\&.
350 \-disableassertions[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
352 \-da[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
354 Disables assertions\&. By default, assertions are disabled in all packages and classes\&.
357 \fB\-disableassertions\fR
358 (\fB\-da\fR) disables assertions in all packages and classes\&. With the
361 \fB\&.\&.\&.\fR, the switch disables assertions in the specified package and any subpackages\&. If the argument is simply
362 \fB\&.\&.\&.\fR, then the switch disables assertions in the unnamed package in the current working directory\&. With the
364 argument, the switch disables assertions in the specified class\&.
367 \fB\-disableassertions\fR
368 (\fB\-da\fR) option applies to all class loaders and to system classes (which do not have a class loader)\&. There is one exception to this rule: if the option is provided with no arguments, then it does not apply to system classes\&. This makes it easy to disable assertions in all classes except for system classes\&. The
369 \fB\-disablesystemassertions\fR
370 option enables you to disable assertions in all system classes\&.
372 To explicitly enable assertions in specific packages or classes, use the
373 \fB\-enableassertions\fR
374 (\fB\-ea\fR) option\&. Both options can be used at the same time\&. For example, to run the
376 application with assertions enabled in package
377 \fBcom\&.wombat\&.fruitbat\fR
378 (and any subpackages) but disabled in class
379 \fBcom\&.wombat\&.fruitbat\&.Brickbat\fR, use the following command:
385 \fBjava \-ea:com\&.wombat\&.fruitbat\&.\&.\&. \-da:com\&.wombat\&.fruitbat\&.Brickbat MyClass\fR
393 \-disablesystemassertions
397 Disables assertions in all system classes\&.
400 \-enableassertions[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
402 \-ea[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
404 Enables assertions\&. By default, assertions are disabled in all packages and classes\&.
407 \fB\-enableassertions\fR
408 (\fB\-ea\fR) enables assertions in all packages and classes\&. With the
411 \fB\&.\&.\&.\fR, the switch enables assertions in the specified package and any subpackages\&. If the argument is simply
412 \fB\&.\&.\&.\fR, then the switch enables assertions in the unnamed package in the current working directory\&. With the
414 argument, the switch enables assertions in the specified class\&.
417 \fB\-enableassertions\fR
418 (\fB\-ea\fR) option applies to all class loaders and to system classes (which do not have a class loader)\&. There is one exception to this rule: if the option is provided with no arguments, then it does not apply to system classes\&. This makes it easy to enable assertions in all classes except for system classes\&. The
419 \fB\-enablesystemassertions\fR
420 option provides a separate switch to enable assertions in all system classes\&.
422 To explicitly disable assertions in specific packages or classes, use the
423 \fB\-disableassertions\fR
424 (\fB\-da\fR) option\&. If a single command contains multiple instances of these switches, then they are processed in order before loading any classes\&. For example, to run the
426 application with assertions enabled only in package
427 \fBcom\&.wombat\&.fruitbat\fR
428 (and any subpackages) but disabled in class
429 \fBcom\&.wombat\&.fruitbat\&.Brickbat\fR, use the following command:
435 \fBjava \-ea:com\&.wombat\&.fruitbat\&.\&.\&. \-da:com\&.wombat\&.fruitbat\&.Brickbat MyClass\fR
443 \-enablesystemassertions
447 Enables assertions in all system classes\&.
454 Displays usage information for the
456 command without actually running the JVM\&.
461 Executes a program encapsulated in a JAR file\&. The
463 argument is the name of a JAR file with a manifest that contains a line in the form
464 \fBMain\-Class:\fR\fIclassname\fR
465 that defines the class with the
466 \fBpublic static void main(String[] args)\fR
467 method that serves as your application\*(Aqs starting point\&.
471 option, the specified JAR file is the source of all user classes, and other class path settings are ignored\&.
473 For more information about JAR files, see the following resources:
494 The Java Archive (JAR) Files guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jar/index\&.html
505 Lesson: Packaging Programs in JAR Files at
507 http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.html
511 \-javaagent:\fIjarpath\fR[=\fIoptions\fR]
513 Loads the specified Java programming language agent\&. For more information about instrumenting Java applications, see the
514 \fBjava\&.lang\&.instrument\fR
515 package description in the Java API documentation at http://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package\-summary\&.html
518 \-jre\-restrict\-search
520 Includes user\-private JREs in the version search\&.
523 \-no\-jre\-restrict\-search
525 Excludes user\-private JREs from the version search\&.
530 Selects the Java HotSpot Server VM\&. The 64\-bit version of the JDK supports only the Server VM, so in that case the option is implicit\&.
532 For default JVM selection, see Server\-Class Machine Detection at
533 http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/server\-class\&.html
538 Displays version information and continues execution of the application\&. This option is equivalent to the
540 option except that the latter instructs the JVM to exit after displaying version information\&.
543 \-splash:\fIimgname\fR
545 Shows the splash screen with the image specified by
546 \fIimgname\fR\&. For example, to show the
550 directory when starting your application, use the following option:
556 \fB\-splash:images/splash\&.gif\fR
566 Displays information about each loaded class\&.
571 Displays information about each garbage collection (GC) event\&.
576 Displays information about the use of native methods and other Java Native Interface (JNI) activity\&.
581 Displays version information and then exits\&. This option is equivalent to the
583 option except that the latter does not instruct the JVM to exit after displaying version information\&.
586 \-version:\fIrelease\fR
588 Specifies the release version to be used for running the application\&. If the version of the
590 command called does not meet this specification and an appropriate implementation is found on the system, then the appropriate implementation will be used\&.
594 argument specifies either the exact version string, or a list of version strings and ranges separated by spaces\&. A
596 is the developer designation of the version number in the following form:
597 \fB1\&.\fR\fIx\fR\fB\&.0_\fR\fIu\fR
600 is the major version number, and
602 is the update version number)\&. A
604 is made up of a version string followed by a plus sign (\fB+\fR) to designate this version or later, or a part of a version string followed by an asterisk (\fB*\fR) to designate any version string with a matching prefix\&. Version strings and ranges can be combined using a space for a logical
606 combination, or an ampersand (\fB&\fR) for a logical
608 combination of two version strings/ranges\&. For example, if running the class or JAR file requires either JRE 6u13 (1\&.6\&.0_13), or any JRE 6 starting from 6u10 (1\&.6\&.0_10), specify the following:
614 \fB\-version:"1\&.6\&.0_13 1\&.6* & 1\&.6\&.0_10+"\fR
620 Quotation marks are necessary only if there are spaces in the
624 For JAR files, the preference is to specify version requirements in the JAR file manifest rather than on the command line\&.
626 .SS "Non\-Standard Options"
628 These options are general purpose options that are specific to the Java HotSpot Virtual Machine\&.
632 Displays help for all available
639 Disables background compilation\&. By default, the JVM compiles the method as a background task, running the method in interpreter mode until the background compilation is finished\&. The
641 flag disables background compilation so that compilation of all methods proceeds as a foreground task until completed\&.
643 This option is equivalent to
644 \fB\-XX:\-BackgroundCompilation\fR\&.
647 \-Xbootclasspath:\fIpath\fR
649 Specifies a list of directories, JAR files, and ZIP archives separated by colons (:) to search for boot class files\&. These are used in place of the boot class files included in the JDK\&.
651 Do not deploy applications that use this option to override a class in
652 \fBrt\&.jar\fR, because this violates the JRE binary code license\&.
655 \-Xbootclasspath/a:\fIpath\fR
657 Specifies a list of directories, JAR files, and ZIP archives separated by colons (:) to append to the end of the default bootstrap class path\&.
659 Do not deploy applications that use this option to override a class in
660 \fBrt\&.jar\fR, because this violates the JRE binary code license\&.
663 \-Xbootclasspath/p:\fIpath\fR
665 Specifies a list of directories, JAR files, and ZIP archives separated by colons (:) to prepend to the front of the default bootstrap class path\&.
667 Do not deploy applications that use this option to override a class in
668 \fBrt\&.jar\fR, because this violates the JRE binary code license\&.
673 Performs additional checks for Java Native Interface (JNI) functions\&. Specifically, it validates the parameters passed to the JNI function and the runtime environment data before processing the JNI request\&. Any invalid data encountered indicates a problem in the native code, and the JVM will terminate with an irrecoverable error in such cases\&. Expect a performance degradation when this option is used\&.
678 Forces compilation of methods on first invocation\&. By default, the Client VM (\fB\-client\fR) performs 1,000 interpreted method invocations and the Server VM (\fB\-server\fR) performs 10,000 interpreted method invocations to gather information for efficient compilation\&. Specifying the
680 option disables interpreted method invocations to increase compilation performance at the expense of efficiency\&.
682 You can also change the number of interpreted method invocations before compilation using the
683 \fB\-XX:CompileThreshold\fR
689 Does nothing\&. Provided for backward compatibility\&.
694 Shows additional diagnostic messages\&.
699 Enables strict class\-file format checks that enforce close conformance to the class\-file format specification\&. Developers are encouraged to use this flag when developing new code because the stricter checks will become the default in future releases\&.
704 Runs the application in interpreted\-only mode\&. Compilation to native code is disabled, and all bytecode is executed by the interpreter\&. The performance benefits offered by the just in time (JIT) compiler are not present in this mode\&.
709 Displays more detailed JVM version information than the
711 option, and then exits\&.
714 \-Xloggc:\fIfilename\fR
716 Sets the file to which verbose GC events information should be redirected for logging\&. The information written to this file is similar to the output of
718 with the time elapsed since the first GC event preceding each logged event\&. The
722 if both are given with the same
732 \fB\-Xloggc:garbage\-collection\&.log\fR
740 \-Xmaxjitcodesize=\fIsize\fR
742 Specifies the maximum code cache size (in bytes) for JIT\-compiled code\&. Append the letter
746 to indicate kilobytes,
750 to indicate megabytes,
754 to indicate gigabytes\&. The default maximum code cache size is 240 MB; if you disable tiered compilation with the option
755 \fB\-XX:\-TieredCompilation\fR, then the default size is 48 MB:
761 \fB\-Xmaxjitcodesize=240m\fR
767 This option is equivalent to
768 \fB\-XX:ReservedCodeCacheSize\fR\&.
773 Executes all bytecode by the interpreter except for hot methods, which are compiled to native code\&.
778 Sets the initial and maximum size (in bytes) of the heap for the young generation (nursery)\&. Append the letter
782 to indicate kilobytes,
786 to indicate megabytes,
790 to indicate gigabytes\&.
792 The young generation region of the heap is used for new objects\&. GC is performed in this region more often than in other regions\&. If the size for the young generation is too small, then a lot of minor garbage collections will be performed\&. If the size is too large, then only full garbage collections will be performed, which can take a long time to complete\&. Oracle recommends that you keep the size for the young generation between a half and a quarter of the overall heap size\&.
794 The following examples show how to set the initial and maximum size of young generation to 256 MB using various units:
810 option to set both the initial and maximum size of the heap for the young generation, you can use
812 to set the initial size and
813 \fB\-XX:MaxNewSize\fR
814 to set the maximum size\&.
819 Sets the initial size (in bytes) of the heap\&. This value must be a multiple of 1024 and greater than 1 MB\&. Append the letter
823 to indicate kilobytes,
827 to indicate megabytes,
831 to indicate gigabytes\&.
833 The following examples show how to set the size of allocated memory to 6 MB using various units:
847 If you do not set this option, then the initial size will be set as the sum of the sizes allocated for the old generation and the young generation\&. The initial size of the heap for the young generation can be set using the
856 Specifies the maximum size (in bytes) of the memory allocation pool in bytes\&. This value must be a multiple of 1024 and greater than 2 MB\&. Append the letter
860 to indicate kilobytes,
864 to indicate megabytes,
868 to indicate gigabytes\&. The default value is chosen at runtime based on system configuration\&. For server deployments,
872 are often set to the same value\&. See the section "Ergonomics" in
873 \fIJava SE HotSpot Virtual Machine Garbage Collection Tuning Guide\fR
874 at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gctuning/index\&.html\&.
876 The following examples show how to set the maximum allowed size of allocated memory to 80 MB using various units:
892 option is equivalent to
893 \fB\-XX:MaxHeapSize\fR\&.
898 Disables garbage collection (GC) of classes\&. This can save some GC time, which shortens interruptions during the application run\&.
902 at startup, the class objects in the application will be left untouched during GC and will always be considered live\&. This can result in more memory being permanently occupied which, if not used carefully, will throw an out of memory exception\&.
907 Profiles the running program and sends profiling data to standard output\&. This option is provided as a utility that is useful in program development and is not intended to be used in production systems\&.
912 Reduces the use of operating system signals by the JVM\&.
914 Shutdown hooks enable orderly shutdown of a Java application by running user cleanup code (such as closing database connections) at shutdown, even if the JVM terminates abruptly\&.
916 The JVM catches signals to implement shutdown hooks for unexpected termination\&. The JVM uses
920 to initiate the running of shutdown hooks\&.
922 The JVM uses a similar mechanism to implement the feature of dumping thread stacks for debugging purposes\&. The JVM uses
924 to perform thread dumps\&.
926 Applications embedding the JVM frequently need to trap signals such as
929 \fBSIGTERM\fR, which can lead to interference with the JVM signal handlers\&. The
931 option is available to address this issue\&. When
933 is used, the signal masks for
938 are not changed by the JVM, and signal handlers for these signals are not installed\&.
940 There are two consequences of specifying
952 thread dumps are not available\&.
963 User code is responsible for causing shutdown hooks to run, for example, by calling
964 \fBSystem\&.exit()\fR
965 when the JVM is to be terminated\&.
971 Sets the class data sharing (CDS) mode\&. Possible
973 arguments for this option include the following:
977 Use CDS if possible\&. This is the default value for Java HotSpot 32\-Bit Client VM\&.
982 Require the use of CDS\&. Print an error message and exit if class data sharing cannot be used\&.
987 Do not use CDS\&. This is the default value for Java HotSpot 32\-Bit Server VM, Java HotSpot 64\-Bit Client VM, and Java HotSpot 64\-Bit Server VM\&.
992 Manually generate the CDS archive\&. Specify the application class path as described in "Setting the Class Path "\&.
994 You should regenerate the CDS archive with each new JDK release\&.
998 \-XshowSettings:\fIcategory\fR
1000 Shows settings and continues\&. Possible
1002 arguments for this option include the following:
1006 Shows all categories of settings\&. This is the default value\&.
1011 Shows settings related to locale\&.
1016 Shows settings related to system properties\&.
1021 Shows the settings of the JVM\&.
1027 Sets the thread stack size (in bytes)\&. Append the letter
1039 to indicate GB\&. The default value depends on the platform:
1043 \h'-04'\(bu\h'+03'\c
1049 Linux/ARM (32\-bit): 320 KB
1054 \h'-04'\(bu\h'+03'\c
1060 Linux/i386 (32\-bit): 320 KB
1065 \h'-04'\(bu\h'+03'\c
1071 Linux/x64 (64\-bit): 1024 KB
1076 \h'-04'\(bu\h'+03'\c
1082 OS X (64\-bit): 1024 KB
1087 \h'-04'\(bu\h'+03'\c
1093 Oracle Solaris/i386 (32\-bit): 320 KB
1098 \h'-04'\(bu\h'+03'\c
1104 Oracle Solaris/x64 (64\-bit): 1024 KB
1107 The following examples set the thread stack size to 1024 KB in different units:
1121 This option is equivalent to
1122 \fB\-XX:ThreadStackSize\fR\&.
1127 Use alternative signals instead of
1131 for JVM internal signals\&. This option is equivalent to
1132 \fB\-XX:+UseAltSigs\fR\&.
1135 \-Xverify:\fImode\fR
1137 Sets the mode of the bytecode verifier\&. Bytecode verification helps to troubleshoot some problems, but it also adds overhead to the running application\&. Possible
1139 arguments for this option include the following:
1143 Do not verify the bytecode\&. This reduces startup time and also reduces the protection provided by Java\&.
1148 Verify those classes that are not loaded by the bootstrap class loader\&. This is the default behavior if you do not specify the
1155 Verify all classes\&.
1158 .SS "Advanced Runtime Options"
1160 These options control the runtime behavior of the Java HotSpot VM\&.
1162 \-XX:+CheckEndorsedAndExtDirs
1164 Enables the option to prevent the
1166 command from running a Java application if it uses the endorsed\-standards override mechanism or the extension mechanism\&. This option checks if an application is using one of these mechanisms by checking the following:
1170 \h'-04'\(bu\h'+03'\c
1177 \fBjava\&.ext\&.dirs\fR
1179 \fBjava\&.endorsed\&.dirs\fR
1180 system property is set\&.
1185 \h'-04'\(bu\h'+03'\c
1193 directory exists and is not empty\&.
1198 \h'-04'\(bu\h'+03'\c
1206 directory contains any JAR files other than those of the JDK\&.
1211 \h'-04'\(bu\h'+03'\c
1217 The system\-wide platform\-specific extension directory contains any JAR files\&.
1221 \-XX:+DisableAttachMechanism
1223 Enables the option that disables the mechanism that lets tools attach to the JVM\&. By default, this option is disabled, meaning that the attach mechanism is enabled and you can use tools such as
1230 \-XX:ErrorFile=\fIfilename\fR
1232 Specifies the path and file name to which error data is written when an irrecoverable error occurs\&. By default, this file is created in the current working directory and named
1233 \fBhs_err_pid\fR\fIpid\fR\fB\&.log\fR
1236 is the identifier of the process that caused the error\&. The following example shows how to set the default log file (note that the identifier of the process is specified as
1243 \fB\-XX:ErrorFile=\&./hs_err_pid%p\&.log\fR
1249 The following example shows how to set the error log to
1250 \fB/var/log/java/java_error\&.log\fR:
1256 \fB\-XX:ErrorFile=/var/log/java/java_error\&.log\fR
1262 If the file cannot be created in the specified directory (due to insufficient space, permission problem, or another issue), then the file is created in the temporary directory for the operating system\&. The temporary directory is
1266 \-XX:+FailOverToOldVerifier
1268 Enables automatic failover to the old verifier when the new type checker fails\&. By default, this option is disabled and it is ignored (that is, treated as disabled) for classes with a recent bytecode version\&. You can enable it for classes with older versions of the bytecode\&.
1271 \-XX:+FlightRecorder
1273 Enables the use of the Java Flight Recorder (JFR) during the runtime of the application\&. This is a commercial feature that works in conjunction with the
1274 \fB\-XX:+UnlockCommercialFeatures\fR
1281 \fBjava \-XX:+UnlockCommercialFeatures \-XX:+FlightRecorder\fR
1287 If this option is not provided, Java Flight Recorder can still be enabled in a running JVM by providing the appropriate
1289 diagnostic commands\&.
1292 \-XX:\-FlightRecorder
1294 Disables the use of the Java Flight Recorder (JFR) during the runtime of the application\&. This is a commercial feature that works in conjunction with the
1295 \fB\-XX:+UnlockCommercialFeatures\fR
1302 \fBjava \-XX:+UnlockCommercialFeatures \-XX:\-FlightRecorder\fR
1308 If this option is provided, Java Flight Recorder cannot be enabled in a running JVM\&.
1311 \-XX:FlightRecorderOptions=\fIparameter\fR=\fIvalue\fR
1313 Sets the parameters that control the behavior of JFR\&. This is a commercial feature that works in conjunction with the
1314 \fB\-XX:+UnlockCommercialFeatures\fR
1315 option\&. This option can be used only when JFR is enabled (that is, the
1316 \fB\-XX:+FlightRecorder\fR
1317 option is specified)\&.
1319 The following list contains all available JFR parameters:
1321 defaultrecording={true|false}
1323 Specifies whether the recording is a continuous background recording or if it runs for a limited time\&. By default, this parameter is set to
1325 (recording runs for a limited time)\&. To make the recording run continuously, set the parameter to
1331 Specifies whether JFR should write a continuous recording to disk\&. By default, this parameter is set to
1333 (continuous recording to disk is disabled)\&. To enable it, set the parameter to
1334 \fBtrue\fR, and also set
1335 \fBdefaultrecording=true\fR\&.
1338 dumponexit={true|false}
1340 Specifies whether a dump file of JFR data should be generated when the JVM terminates in a controlled manner\&. By default, this parameter is set to
1342 (dump file on exit is not generated)\&. To enable it, set the parameter to
1343 \fBtrue\fR, and also set
1344 \fBdefaultrecording=true\fR\&.
1346 The dump file is written to the location defined by the
1347 \fBdumponexitpath\fR
1351 dumponexitpath=\fIpath\fR
1353 Specifies the path and name of the dump file with JFR data that is created when the JVM exits in a controlled manner if you set the
1354 \fBdumponexit=true\fR
1355 parameter\&. Setting the path makes sense only if you also set
1356 \fBdefaultrecording=true\fR\&.
1358 If the specified path is a directory, the JVM assigns a file name that shows the creation date and time\&. If the specified path includes a file name and if that file already exists, the JVM creates a new file by appending the date and time stamp to the specified file name\&.
1361 globalbuffersize=\fIsize\fR
1363 Specifies the total amount of primary memory (in bytes) used for data retention\&. Append
1366 \fBK\fR, to specify the size in KB,
1370 to specify the size in MB,
1374 to specify the size in GB\&. By default, the size is set to 462848 bytes\&.
1377 loglevel={quiet|error|warning|info|debug|trace}
1379 Specify the amount of data written to the log file by JFR\&. By default, it is set to
1385 Specifies the maximum age of disk data to keep for the default recording\&. Append
1387 to specify the time in seconds,
1393 for days (for example, specifying
1395 means 30 seconds)\&. By default, the maximum age is set to 15 minutes (\fB15m\fR)\&.
1397 This parameter is valid only if you set the
1402 maxchunksize=\fIsize\fR
1404 Specifies the maximum size (in bytes) of the data chunks in a recording\&. Append
1407 \fBK\fR, to specify the size in KB,
1411 to specify the size in MB,
1415 to specify the size in GB\&. By default, the maximum size of data chunks is set to 12 MB\&.
1420 Specifies the maximum size (in bytes) of disk data to keep for the default recording\&. Append
1423 \fBK\fR, to specify the size in KB,
1427 to specify the size in MB,
1431 to specify the size in GB\&. By default, the maximum size of disk data is not limited, and this parameter is set to 0\&.
1433 This parameter is valid only if you set the
1438 repository=\fIpath\fR
1440 Specifies the repository (a directory) for temporary disk storage\&. By default, the system\(cqs temporary directory is used\&.
1443 samplethreads={true|false}
1445 Specifies whether thread sampling is enabled\&. Thread sampling occurs only if the sampling event is enabled along with this parameter\&. By default, this parameter is enabled\&.
1450 Specifies the path and name of the event settings file (of type JFC)\&. By default, the
1452 file is used, which is located in
1453 \fBJAVA_HOME/jre/lib/jfr\fR\&.
1456 stackdepth=\fIdepth\fR
1458 Stack depth for stack traces by JFR\&. By default, the depth is set to 64 method calls\&. The maximum is 2048, minimum is 1\&.
1461 threadbuffersize=\fIsize\fR
1463 Specifies the per\-thread local buffer size (in bytes)\&. Append
1466 \fBK\fR, to specify the size in KB,
1470 to specify the size in MB,
1474 to specify the size in GB\&. Higher values for this parameter allow more data gathering without contention to flush it to the global storage\&. It can increase application footprint in a thread\-rich environment\&. By default, the local buffer size is set to 5 KB\&.
1477 You can specify values for multiple parameters by separating them with a comma\&. For example, to instruct JFR to write a continuous recording to disk, and set the maximum size of data chunks to 10 MB, specify the following:
1483 \fB\-XX:FlightRecorderOptions=defaultrecording=true,disk=true,maxchunksize=10M\fR
1491 \-XX:LargePageSizeInBytes=\fIsize\fR
1493 On Solaris, sets the maximum size (in bytes) for large pages used for Java heap\&. The
1495 argument must be a power of 2 (2, 4, 8, 16, \&.\&.\&.)\&. Append the letter
1499 to indicate kilobytes,
1503 to indicate megabytes,
1507 to indicate gigabytes\&. By default, the size is set to 0, meaning that the JVM chooses the size for large pages automatically\&.
1509 The following example illustrates how to set the large page size to 4 megabytes (MB):
1515 \fB\-XX:LargePageSizeInBytes=4m\fR
1523 \-XX:MaxDirectMemorySize=\fIsize\fR
1525 Sets the maximum total size (in bytes) of the New I/O (the
1527 package) direct\-buffer allocations\&. Append the letter
1531 to indicate kilobytes,
1535 to indicate megabytes,
1539 to indicate gigabytes\&. By default, the size is set to 0, meaning that the JVM chooses the size for NIO direct\-buffer allocations automatically\&.
1541 The following examples illustrate how to set the NIO size to 1024 KB in different units:
1547 \fB\-XX:MaxDirectMemorySize=1m\fR
1548 \fB\-XX:MaxDirectMemorySize=1024k\fR
1549 \fB\-XX:MaxDirectMemorySize=1048576\fR
1557 \-XX:NativeMemoryTracking=\fImode\fR
1559 Specifies the mode for tracking JVM native memory usage\&. Possible
1561 arguments for this option include the following:
1565 Do not track JVM native memory usage\&. This is the default behavior if you do not specify the
1566 \fB\-XX:NativeMemoryTracking\fR
1572 Only track memory usage by JVM subsystems, such as Java heap, class, code, and thread\&.
1577 In addition to tracking memory usage by JVM subsystems, track memory usage by individual
1578 \fBCallSite\fR, individual virtual memory region and its committed regions\&.
1582 \-XX:ObjectAlignmentInBytes=\fIalignment\fR
1584 Sets the memory alignment of Java objects (in bytes)\&. By default, the value is set to 8 bytes\&. The specified value should be a power of two, and must be within the range of 8 and 256 (inclusive)\&. This option makes it possible to use compressed pointers with large Java heap sizes\&.
1586 The heap size limit in bytes is calculated as:
1588 \fB4GB * ObjectAlignmentInBytes\fR
1590 Note: As the alignment value increases, the unused space between objects will also increase\&. As a result, you may not realize any benefits from using compressed pointers with large Java heap sizes\&.
1593 \-XX:OnError=\fIstring\fR
1595 Sets a custom command or a series of semicolon\-separated commands to run when an irrecoverable error occurs\&. If the string contains spaces, then it must be enclosed in quotation marks\&.
1597 The following example shows how the
1599 option can be used to run the
1601 command to create the core image, and the debugger is started to attach to the process in case of an irrecoverable error (the
1603 designates the current process):
1609 \fB\-XX:OnError="gcore %p;dbx \- %p"\fR
1617 \-XX:OnOutOfMemoryError=\fIstring\fR
1619 Sets a custom command or a series of semicolon\-separated commands to run when an
1620 \fBOutOfMemoryError\fR
1621 exception is first thrown\&. If the string contains spaces, then it must be enclosed in quotation marks\&. For an example of a command string, see the description of the
1626 \-XX:+PerfDataSaveToFile
1629 jstat(1) binary data when the Java application exits\&. This binary data is saved in a file named
1630 \fBhsperfdata_\fR\fI<pid>\fR, where
1632 is the process identifier of the Java application you ran\&. Use
1634 to display the performance data contained in this file as follows:
1640 \fBjstat \-class file:///\fR\fB\fI<path>\fR\fR\fB/hsperfdata_\fR\fB\fI<pid>\fR\fR
1641 \fBjstat \-gc file:///\fR\fB\fI<path>\fR\fR\fB/hsperfdata_\fR\fB\fI<pid>\fR\fR
1648 \-XX:+PrintCommandLineFlags
1650 Enables printing of ergonomically selected JVM flags that appeared on the command line\&. It can be useful to know the ergonomic values set by the JVM, such as the heap space size and the selected garbage collector\&. By default, this option is disabled and flags are not printed\&.
1653 \-XX:+PrintNMTStatistics
1655 Enables printing of collected native memory tracking data at JVM exit when native memory tracking is enabled (see
1656 \fB\-XX:NativeMemoryTracking\fR)\&. By default, this option is disabled and native memory tracking data is not printed\&.
1659 \-XX:+RelaxAccessControlCheck
1661 Decreases the amount of access control checks in the verifier\&. By default, this option is disabled, and it is ignored (that is, treated as disabled) for classes with a recent bytecode version\&. You can enable it for classes with older versions of the bytecode\&.
1664 \-XX:+ResourceManagement
1666 Enables the use of Resource Management during the runtime of the application\&.
1668 This is a commercial feature that requires you to also specify the
1669 \fB\-XX:+UnlockCommercialFeatures\fR
1672 \fBjava \-XX:+UnlockCommercialFeatures \-XX:+ResourceManagement\fR
1675 \-XX:ResourceManagementSampleInterval=\fIvalue\fR (milliseconds)
1677 Sets the parameter that controls the sampling interval for Resource Management measurements, in milliseconds\&.
1679 This option can be used only when Resource Management is enabled (that is, the
1680 \fB\-XX:+ResourceManagement\fR
1681 option is specified)\&.
1684 \-XX:SharedArchiveFile=\fIpath\fR
1686 Specifies the path and name of the class data sharing (CDS) archive file
1689 \-XX:SharedClassListFile=\fIfile_name\fR
1691 Specifies the text file that contains the names of the class files to store in the class data sharing (CDS) archive\&. This file contains the full name of one class file per line, except slashes (\fB/\fR) replace dots (\fB\&.\fR)\&. For example, to specify the classes
1692 \fBjava\&.lang\&.Object\fR
1694 \fBhello\&.Main\fR, create a text file that contains the following two lines:
1700 \fBjava/lang/Object\fR
1707 The class files that you specify in this text file should include the classes that are commonly used by the application\&. They may include any classes from the application, extension, or bootstrap class paths\&.
1710 \-XX:+ShowMessageBoxOnError
1712 Enables displaying of a dialog box when the JVM experiences an irrecoverable error\&. This prevents the JVM from exiting and keeps the process active so that you can attach a debugger to it to investigate the cause of the error\&. By default, this option is disabled\&.
1715 \-XX:StartFlightRecording=\fIparameter\fR=\fIvalue\fR
1717 Starts a JFR recording for the Java application\&. This is a commercial feature that works in conjunction with the
1718 \fB\-XX:+UnlockCommercialFeatures\fR
1719 option\&. This option is equivalent to the
1721 diagnostic command that starts a recording during runtime\&. You can set the following parameters when starting a JFR recording:
1723 compress={true|false}
1725 Specifies whether to compress the JFR recording log file (of type JFR) on the disk using the
1727 file compression utility\&. This parameter is valid only if the
1729 parameter is specified\&. By default it is set to
1731 (recording is not compressed)\&. To enable compression, set the parameter to
1735 defaultrecording={true|false}
1737 Specifies whether the recording is a continuous background recording or if it runs for a limited time\&. By default, this parameter is set to
1739 (recording runs for a limited time)\&. To make the recording run continuously, set the parameter to
1745 Specifies the delay between the Java application launch time and the start of the recording\&. Append
1747 to specify the time in seconds,
1753 for days (for example, specifying
1755 means 10 minutes)\&. By default, there is no delay, and this parameter is set to 0\&.
1758 dumponexit={true|false}
1760 Specifies whether a dump file of JFR data should be generated when the JVM terminates in a controlled manner\&. By default, this parameter is set to
1762 (dump file on exit is not generated)\&. To enable it, set the parameter to
1765 The dump file is written to the location defined by the
1775 \fB\-XX:StartFlightRecording=name=test,filename=D:\etest\&.jfr,dumponexit=true\fR
1784 Specifies the duration of the recording\&. Append
1786 to specify the time in seconds,
1792 for days (for example, specifying
1794 means 5 hours)\&. By default, the duration is not limited, and this parameter is set to 0\&.
1799 Specifies the path and name of the JFR recording log file\&.
1802 name=\fIidentifier\fR
1804 Specifies the identifier for the JFR recording\&. By default, it is set to
1805 \fBRecording x\fR\&.
1810 Specifies the maximum age of disk data to keep for the default recording\&. Append
1812 to specify the time in seconds,
1818 for days (for example, specifying
1820 means 30 seconds)\&. By default, the maximum age is set to 15 minutes (\fB15m\fR)\&.
1825 Specifies the maximum size (in bytes) of disk data to keep for the default recording\&. Append
1828 \fBK\fR, to specify the size in KB,
1832 to specify the size in MB,
1836 to specify the size in GB\&. By default, the maximum size of disk data is not limited, and this parameter is set to 0\&.
1841 Specifies the path and name of the event settings file (of type JFC)\&. By default, the
1843 file is used, which is located in
1844 \fBJAVA_HOME/jre/lib/jfr\fR\&.
1847 You can specify values for multiple parameters by separating them with a comma\&. For example, to save the recording to test\&.jfr in the current working directory, and instruct JFR to compress the log file, specify the following:
1853 \fB\-XX:StartFlightRecording=filename=test\&.jfr,compress=true\fR
1861 \-XX:ThreadStackSize=\fIsize\fR
1863 Sets the thread stack size (in bytes)\&. Append the letter
1867 to indicate kilobytes,
1871 to indicate megabytes,
1875 to indicate gigabytes\&. The default value depends on the platform:
1879 \h'-04'\(bu\h'+03'\c
1885 Linux/ARM (32\-bit): 320 KB
1890 \h'-04'\(bu\h'+03'\c
1896 Linux/i386 (32\-bit): 320 KB
1901 \h'-04'\(bu\h'+03'\c
1907 Linux/x64 (64\-bit): 1024 KB
1912 \h'-04'\(bu\h'+03'\c
1918 OS X (64\-bit): 1024 KB
1923 \h'-04'\(bu\h'+03'\c
1929 Oracle Solaris/i386 (32\-bit): 320 KB
1934 \h'-04'\(bu\h'+03'\c
1940 Oracle Solaris/x64 (64\-bit): 1024 KB
1943 The following examples show how to set the thread stack size to 1024 KB in different units:
1949 \fB\-XX:ThreadStackSize=1m\fR
1950 \fB\-XX:ThreadStackSize=1024k\fR
1951 \fB\-XX:ThreadStackSize=1048576\fR
1957 This option is equivalent to
1961 \-XX:+TraceClassLoading
1963 Enables tracing of classes as they are loaded\&. By default, this option is disabled and classes are not traced\&.
1966 \-XX:+TraceClassLoadingPreorder
1968 Enables tracing of all loaded classes in the order in which they are referenced\&. By default, this option is disabled and classes are not traced\&.
1971 \-XX:+TraceClassResolution
1973 Enables tracing of constant pool resolutions\&. By default, this option is disabled and constant pool resolutions are not traced\&.
1976 \-XX:+TraceClassUnloading
1978 Enables tracing of classes as they are unloaded\&. By default, this option is disabled and classes are not traced\&.
1981 \-XX:+TraceLoaderConstraints
1983 Enables tracing of the loader constraints recording\&. By default, this option is disabled and loader constraints recording is not traced\&.
1986 \-XX:+UnlockCommercialFeatures
1988 Enables the use of commercial features\&. Commercial features are included with Oracle Java SE Advanced or Oracle Java SE Suite packages, as defined on the
1989 \fIJava SE Products\fR
1990 page at http://www\&.oracle\&.com/technetwork/java/javase/terms/products/index\&.html
1992 By default, this option is disabled and the JVM runs without the commercial features\&. Once they were enabled for a JVM process, it is not possible to disable their use for that process\&.
1994 If this option is not provided, commercial features can still be unlocked in a running JVM by using the appropriate
1996 diagnostic commands\&.
2001 Enables the use of alternative signals instead of
2005 for JVM internal signals\&. By default, this option is disabled and alternative signals are not used\&. This option is equivalent to
2006 \fB\-Xusealtsigs\fR\&.
2011 Enables application class data sharing (AppCDS)\&. To use AppCDS, you must also specify values for the options
2012 \fB\-XX:SharedClassListFile\fR
2014 \fB\-XX:SharedArchiveFile\fR
2015 during both CDS dump time (see the option
2016 \fB\-Xshare:dump\fR) and application run time\&.
2018 This is a commercial feature that requires you to also specify the
2019 \fB\-XX:+UnlockCommercialFeatures\fR
2020 option\&. This is also an experimental feature; it may change in future releases\&.
2022 See "Application Class Data Sharing"\&.
2025 \-XX:\-UseBiasedLocking
2027 Disables the use of biased locking\&. Some applications with significant amounts of uncontended synchronization may attain significant speedups with this flag enabled, whereas applications with certain patterns of locking may see slowdowns\&. For more information about the biased locking technique, see the example in Java Tuning White Paper at http://www\&.oracle\&.com/technetwork/java/tuning\-139912\&.html#section4\&.2\&.5
2029 By default, this option is enabled\&.
2032 \-XX:\-UseCompressedOops
2034 Disables the use of compressed pointers\&. By default, this option is enabled, and compressed pointers are used when Java heap sizes are less than 32 GB\&. When this option is enabled, object references are represented as 32\-bit offsets instead of 64\-bit pointers, which typically increases performance when running the application with Java heap sizes less than 32 GB\&. This option works only for 64\-bit JVMs\&.
2036 It is also possible to use compressed pointers when Java heap sizes are greater than 32GB\&. See the
2037 \fB\-XX:ObjectAlignmentInBytes\fR
2043 This option for Linux is the equivalent of specifying
2044 \fB\-XX:+UseLargePages\fR\&. This option is disabled by default\&. This option pre\-allocates all large pages up\-front, when memory is reserved; consequently the JVM cannot dynamically grow or shrink large pages memory areas; see
2045 \fB\-XX:UseTransparentHugePages\fR
2046 if you want this behavior\&.
2048 For more information, see "Large Pages"\&.
2053 Enables the use of large page memory\&. By default, this option is disabled and large page memory is not used\&.
2055 For more information, see "Large Pages"\&.
2060 Enables issuing of membars on thread state transitions\&. This option is disabled by default on all platforms except ARM servers, where it is enabled\&. (It is recommended that you do not disable this option on ARM servers\&.)
2067 feature\&. This option is enabled by default to allow JVM monitoring and performance testing\&. Disabling it suppresses the creation of the
2068 \fBhsperfdata_userid\fR
2069 directories\&. To disable the
2072 \fB\-XX:\-UsePerfData\fR\&.
2075 \-XX:+UseTransparentHugePages
2077 On Linux, enables the use of large pages that can dynamically grow or shrink\&. This option is disabled by default\&. You may encounter performance problems with transparent huge pages as the OS moves other pages around to create huge pages; this option is made available for experimentation\&.
2079 For more information, see "Large Pages"\&.
2082 \-XX:+AllowUserSignalHandlers
2084 Enables installation of signal handlers by the application\&. By default, this option is disabled and the application is not allowed to install signal handlers\&.
2086 .SS "Advanced JIT Compiler Options"
2088 These options control the dynamic just\-in\-time (JIT) compilation performed by the Java HotSpot VM\&.
2090 \-XX:+AggressiveOpts
2092 Enables the use of aggressive performance optimization features, which are expected to become default in upcoming releases\&. By default, this option is disabled and experimental performance features are not used\&.
2095 \-XX:AllocateInstancePrefetchLines=\fIlines\fR
2097 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:
2103 \fB\-XX:AllocateInstancePrefetchLines=1\fR
2109 Only the Java HotSpot Server VM supports this option\&.
2112 \-XX:AllocatePrefetchDistance=\fIsize\fR
2114 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\&.
2116 Negative values denote that prefetch distance is chosen based on the platform\&. Positive values are bytes to prefetch\&. Append the letter
2120 to indicate kilobytes,
2124 to indicate megabytes,
2128 to indicate gigabytes\&. The default value is set to \-1\&.
2130 The following example shows how to set the prefetch distance to 1024 bytes:
2136 \fB\-XX:AllocatePrefetchDistance=1024\fR
2142 Only the Java HotSpot Server VM supports this option\&.
2145 \-XX:AllocatePrefetchInstr=\fIinstruction\fR
2147 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:
2153 \fB\-XX:AllocatePrefetchInstr=0\fR
2159 Only the Java HotSpot Server VM supports this option\&.
2162 \-XX:AllocatePrefetchLines=\fIlines\fR
2164 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\&.
2166 The following example shows how to set the number of loaded cache lines to 5:
2172 \fB\-XX:AllocatePrefetchLines=5\fR
2178 Only the Java HotSpot Server VM supports this option\&.
2181 \-XX:AllocatePrefetchStepSize=\fIsize\fR
2183 Sets the step size (in bytes) for sequential prefetch instructions\&. Append the letter
2187 to indicate kilobytes,
2191 to indicate megabytes,
2195 to indicate gigabytes\&. By default, the step size is set to 16 bytes:
2201 \fB\-XX:AllocatePrefetchStepSize=16\fR
2207 Only the Java HotSpot Server VM supports this option\&.
2210 \-XX:AllocatePrefetchStyle=\fIstyle\fR
2212 Sets the generated code style for prefetch instructions\&. The
2214 argument is an integer from 0 to 3:
2218 Do not generate prefetch instructions\&.
2223 Execute prefetch instructions after each allocation\&. This is the default parameter\&.
2228 Use the thread\-local allocation block (TLAB) watermark pointer to determine when prefetch instructions are executed\&.
2233 Use BIS instruction on SPARC for allocation prefetch\&.
2236 Only the Java HotSpot Server VM supports this option\&.
2239 \-XX:+BackgroundCompilation
2241 Enables background compilation\&. This option is enabled by default\&. To disable background compilation, specify
2242 \fB\-XX:\-BackgroundCompilation\fR
2243 (this is equivalent to specifying
2247 \-XX:CICompilerCount=\fIthreads\fR
2249 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:
2255 \fB\-XX:CICompilerCount=2\fR
2263 \-XX:CodeCacheMinimumFreeSpace=\fIsize\fR
2265 Sets the minimum free space (in bytes) required for compilation\&. Append the letter
2269 to indicate kilobytes,
2273 to indicate megabytes,
2277 to indicate gigabytes\&. When less than the minimum free space remains, compiling stops\&. By default, this option is set to 500 KB\&. The following example shows how to set the minimum free space to 1024 MB:
2283 \fB\-XX:CodeCacheMinimumFreeSpace=1024m\fR
2291 \-XX:CompileCommand=\fIcommand\fR,\fImethod\fR[,\fIoption\fR]
2293 Specifies a command to perform on a method\&. For example, to exclude the
2297 class from being compiled, use the following:
2303 \fB\-XX:CompileCommand=exclude,java/lang/String\&.indexOf\fR
2309 Note that the full class name is specified, including all packages and subpackages separated by a slash (\fB/\fR)\&. For easier cut and paste operations, it is also possible to use the method name format produced by the
2310 \fB\-XX:+PrintCompilation\fR
2312 \fB\-XX:+LogCompilation\fR
2319 \fB\-XX:CompileCommand=exclude,java\&.lang\&.String::indexOf\fR
2325 If the method is specified without the signature, the command will be applied 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 command end\&. For example, if you want to exclude only the
2326 \fBindexOf(String)\fR
2329 class from being compiled, use the following:
2335 \fB\-XX:CompileCommand="exclude,java/lang/String\&.indexOf,(Ljava/lang/String;)I"\fR
2341 You can also use the asterisk (*) as a wildcard for class and method names\&. For example, to exclude all
2343 methods in all classes from being compiled, use the following:
2349 \fB\-XX:CompileCommand=exclude,*\&.indexOf\fR
2355 The commas and periods are aliases for spaces, making it easier to pass compiler commands through a shell\&. You can pass arguments to
2356 \fB\-XX:CompileCommand\fR
2357 using spaces as separators by enclosing the argument in quotation marks:
2363 \fB\-XX:CompileCommand="exclude java/lang/String indexOf"\fR
2369 Note that after parsing the commands passed on the command line using the
2370 \fB\-XX:CompileCommand\fR
2371 options, the JIT compiler then reads commands from the
2372 \fB\&.hotspot_compiler\fR
2373 file\&. You can add commands to this file or specify a different file using the
2374 \fB\-XX:CompileCommandFile\fR
2377 To add several commands, either specify the
2378 \fB\-XX:CompileCommand\fR
2379 option multiple times, or separate each argument with the newline separator (\fB\en\fR)\&. The following commands are available:
2383 Set a breakpoint when debugging the JVM to stop at the beginning of compilation of the specified method\&.
2388 Exclude all methods from compilation except for the specified method\&. As an alternative, you can use the
2389 \fB\-XX:CompileOnly\fR
2390 option, which allows to specify several methods\&.
2395 Prevent inlining of the specified method\&.
2400 Exclude the specified method from compilation\&.
2405 Print a help message for the
2406 \fB\-XX:CompileCommand\fR
2412 Attempt to inline the specified method\&.
2417 Exclude compilation logging (with the
2418 \fB\-XX:+LogCompilation\fR
2419 option) for all methods except for the specified method\&. By default, logging is performed for all compiled methods\&.
2424 This command can be used to pass a JIT compilation option to the specified method in place of the last argument (\fIoption\fR)\&. The compilation option is set at the end, after the method name\&. For example, to enable the
2425 \fBBlockLayoutByFrequency\fR
2430 class, use the following:
2436 \fB\-XX:CompileCommand=option,java/lang/StringBuffer\&.append,BlockLayoutByFrequency\fR
2442 You can specify multiple compilation options, separated by commas or spaces\&.
2447 Print generated assembler code after compilation of the specified method\&.
2452 Do not print the compile commands\&. By default, the commands that you specify with the \-\fBXX:CompileCommand\fR
2453 option are printed; for example, if you exclude from compilation the
2457 class, then the following will be printed to standard output:
2463 \fBCompilerOracle: exclude java/lang/String\&.indexOf\fR
2469 You can suppress this by specifying the
2470 \fB\-XX:CompileCommand=quiet\fR
2472 \fB\-XX:CompileCommand\fR
2477 \-XX:CompileCommandFile=\fIfilename\fR
2479 Sets the file from which JIT compiler commands are read\&. By default, the
2480 \fB\&.hotspot_compiler\fR
2481 file is used to store commands performed by the JIT compiler\&.
2483 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
2493 \fBprint java/lang/String toString\fR
2499 For more information about specifying the commands for the JIT compiler to perform on methods, see the
2500 \fB\-XX:CompileCommand\fR
2504 \-XX:CompileOnly=\fImethods\fR
2506 Sets the list of methods (separated by commas) to which compilation should be restricted\&. Only the specified methods will be compiled\&. Specify each method with the full class name (including the packages and subpackages)\&. For example, to compile only the
2514 class, use the following:
2520 \fB\-XX:CompileOnly=java/lang/String\&.length,java/util/List\&.size\fR
2526 Note that the full class name is specified, including all packages and subpackages separated by a slash (\fB/\fR)\&. For easier cut and paste operations, it is also possible to use the method name format produced by the
2527 \fB\-XX:+PrintCompilation\fR
2529 \fB\-XX:+LogCompilation\fR
2536 \fB\-XX:CompileOnly=java\&.lang\&.String::length,java\&.util\&.List::size\fR
2542 Although wildcards are not 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:
2548 \fB\-XX:CompileOnly=java/lang/String\fR
2549 \fB\-XX:CompileOnly=java/lang\fR
2550 \fB\-XX:CompileOnly=\&.length\fR
2558 \-XX:CompileThreshold=\fIinvocations\fR
2560 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
2561 \fB\-XX:+TieredCompilation\fR\&. The following example shows how to set the number of interpreted method invocations to 5,000:
2567 \fB\-XX:CompileThreshold=5000\fR
2573 You can completely disable interpretation of Java methods before compilation by specifying the
2578 \-XX:+DoEscapeAnalysis
2580 Enables the use of escape analysis\&. This option is enabled by default\&. To disable the use of escape analysis, specify
2581 \fB\-XX:\-DoEscapeAnalysis\fR\&. Only the Java HotSpot Server VM supports this option\&.
2584 \-XX:InitialCodeCacheSize=\fIsize\fR
2586 Sets the initial code cache size (in bytes)\&. Append the letter
2590 to indicate kilobytes,
2594 to indicate megabytes,
2598 to indicate gigabytes\&. The default value is set to 500 KB\&. The initial code cache size should be not less than the system\*(Aqs minimal memory page size\&. The following example shows how to set the initial code cache size to 32 KB:
2604 \fB\-XX:InitialCodeCacheSize=32k\fR
2614 Enables method inlining\&. This option is enabled by default to increase performance\&. To disable method inlining, specify
2615 \fB\-XX:\-Inline\fR\&.
2618 \-XX:InlineSmallCode=\fIsize\fR
2620 Sets the maximum code size (in bytes) for compiled methods that should be inlined\&. Append the letter
2624 to indicate kilobytes,
2628 to indicate megabytes,
2632 to indicate gigabytes\&. Only compiled methods with the size smaller than the specified size will be inlined\&. By default, the maximum code size is set to 1000 bytes:
2638 \fB\-XX:InlineSmallCode=1000\fR
2646 \-XX:+LogCompilation
2648 Enables logging of compilation activity to a file named
2650 in the current working directory\&. You can specify a different log file path and name using the
2654 By default, this option is disabled and compilation activity is not logged\&. The
2655 \fB\-XX:+LogCompilation\fR
2656 option has to be used together with the
2657 \fB\-XX:UnlockDiagnosticVMOptions\fR
2658 option that unlocks diagnostic JVM options\&.
2660 You can enable verbose diagnostic output with a message printed to the console every time a method is compiled by using the
2661 \fB\-XX:+PrintCompilation\fR
2665 \-XX:MaxInlineSize=\fIsize\fR
2667 Sets the maximum bytecode size (in bytes) of a method to be inlined\&. Append the letter
2671 to indicate kilobytes,
2675 to indicate megabytes,
2679 to indicate gigabytes\&. By default, the maximum bytecode size is set to 35 bytes:
2685 \fB\-XX:MaxInlineSize=35\fR
2693 \-XX:MaxNodeLimit=\fInodes\fR
2695 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:
2701 \fB\-XX:MaxNodeLimit=65000\fR
2709 \-XX:MaxTrivialSize=\fIsize\fR
2711 Sets the maximum bytecode size (in bytes) of a trivial method to be inlined\&. Append the letter
2715 to indicate kilobytes,
2719 to indicate megabytes,
2723 to indicate gigabytes\&. By default, the maximum bytecode size of a trivial method is set to 6 bytes:
2729 \fB\-XX:MaxTrivialSize=6\fR
2737 \-XX:+OptimizeStringConcat
2739 Enables the optimization of
2741 concatenation operations\&. This option is enabled by default\&. To disable the optimization of
2743 concatenation operations, specify
2744 \fB\-XX:\-OptimizeStringConcat\fR\&. Only the Java HotSpot Server VM supports this option\&.
2749 Enables printing of assembly code for bytecoded and native methods by using the external
2750 \fBdisassembler\&.so\fR
2751 library\&. This enables you to see the generated code, which may help you to diagnose performance issues\&.
2753 By default, this option is disabled and assembly code is not printed\&. The
2754 \fB\-XX:+PrintAssembly\fR
2755 option has to be used together with the
2756 \fB\-XX:UnlockDiagnosticVMOptions\fR
2757 option that unlocks diagnostic JVM options\&.
2760 \-XX:+PrintCompilation
2762 Enables verbose diagnostic output from the JVM by printing a message to the console every time a method is compiled\&. This enables you to see which methods actually get compiled\&. By default, this option is disabled and diagnostic output is not printed\&.
2764 You can also log compilation activity to a file by using the
2765 \fB\-XX:+LogCompilation\fR
2771 Enables printing of inlining decisions\&. This enables you to see which methods are getting inlined\&.
2773 By default, this option is disabled and inlining information is not printed\&. The
2774 \fB\-XX:+PrintInlining\fR
2775 option has to be used together with the
2776 \fB\-XX:+UnlockDiagnosticVMOptions\fR
2777 option that unlocks diagnostic JVM options\&.
2780 \-XX:ReservedCodeCacheSize=\fIsize\fR
2782 Sets the maximum code cache size (in bytes) for JIT\-compiled code\&. Append the letter
2786 to indicate kilobytes,
2790 to indicate megabytes,
2794 to indicate gigabytes\&. The default maximum code cache size is 240 MB; if you disable tiered compilation with the option
2795 \fB\-XX:\-TieredCompilation\fR, 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 should not be less than the initial code cache size; see the option
2796 \fB\-XX:InitialCodeCacheSize\fR\&. This option is equivalent to
2797 \fB\-Xmaxjitcodesize\fR\&.
2800 \-XX:RTMAbortRatio=\fIabort_ratio\fR
2802 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 will be deoptimized\&. This ratio is used when the
2803 \fB\-XX:+UseRTMDeopt\fR
2804 option is enabled\&. The default value of this option is 50\&. This means that the compiled code will be deoptimized if 50% of all transactions are aborted\&.
2807 \-XX:RTMRetryCount=\fInumber_of_retries\fR
2809 RTM locking code will be retried, when it is aborted or busy, the number of times specified by this option before falling back to the normal locking mechanism\&. The default value for this option is 5\&. The
2810 \fB\-XX:UseRTMLocking\fR
2811 option must be enabled\&.
2814 \-XX:\-TieredCompilation
2816 Disables the use of tiered compilation\&. By default, this option is enabled\&. Only the Java HotSpot Server VM supports this option\&.
2821 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\&. UseAES is used in conjunction with UseAESIntrinsics\&.
2824 \-XX:+UseAESIntrinsics
2826 UseAES and UseAESIntrinsics flags are enabled by default and are supported only for Java HotSpot Server VM 32\-bit and 64\-bit\&. To disable hardware\-based AES intrinsics, specify
2827 \fB\-XX:\-UseAES \-XX:\-UseAESIntrinsics\fR\&. For example, to enable hardware AES, use the following flags:
2833 \fB\-XX:+UseAES \-XX:+UseAESIntrinsics\fR
2839 To support UseAES and UseAESIntrinsics flags for 32\-bit and 64\-bit use
2841 option to choose Java HotSpot Server VM\&. These flags are not supported on Client VM\&.
2844 \-XX:+UseCodeCacheFlushing
2846 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
2847 \fB\-XX:\-UseCodeCacheFlushing\fR\&.
2850 \-XX:+UseCondCardMark
2852 Enables checking of whether the card is already marked before updating the card table\&. This option is disabled by default and should only be used on machines with multiple sockets, where it will increase performance of Java applications that rely heavily on concurrent operations\&. Only the Java HotSpot Server VM supports this option\&.
2857 Auto\-tunes RTM locking depending on the abort ratio\&. This ratio is specified by
2858 \fB\-XX:RTMAbortRatio\fR
2859 option\&. If the number of aborted transactions exceeds the abort ratio, then the method containing the lock will be deoptimized and recompiled with all locks as normal locks\&. This option is disabled by default\&. The
2860 \fB\-XX:+UseRTMLocking\fR
2861 option must be enabled\&.
2866 Generate 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 only available for the Java HotSpot Server VM on x86 CPUs that support Transactional Synchronization Extensions (TSX)\&.
2868 RTM is part of Intel\*(Aqs TSX, which is an x86 instruction set extension and facilitates the creation of multithreaded applications\&. RTM introduces the new instructions
2876 instructions enclose a set of instructions to run as a transaction\&. If no conflict is found when running the transaction, the memory and register modifications are committed together at the
2880 instruction can be used to explicitly abort a transaction and the
2882 instruction to check if a set of instructions are being run in a transaction\&.
2884 A lock on a transaction is inflated when another thread tries to access the same transaction, thereby blocking the thread that did not 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\*(Aqs system\&.
2886 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 does not 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\&.
2891 Enables hardware\-based intrinsics for SHA crypto hash functions for SPARC hardware\&.
2893 is used in conjunction with the
2894 \fBUseSHA1Intrinsics\fR,
2895 \fBUseSHA256Intrinsics\fR, and
2896 \fBUseSHA512Intrinsics\fR
2902 \fBUseSHA*Intrinsics\fR
2903 flags are enabled by default, and are supported only for Java HotSpot Server VM 64\-bit on SPARC T4 and newer\&.
2905 This feature is only applicable when using the
2906 \fBsun\&.security\&.provider\&.Sun\fR
2907 provider for SHA operations\&.
2909 To disable all hardware\-based SHA intrinsics, specify
2910 \fB\-XX:\-UseSHA\fR\&. To disable only a particular SHA intrinsic, use the appropriate corresponding option\&. For example:
2911 \fB\-XX:\-UseSHA256Intrinsics\fR\&.
2914 \-XX:+UseSHA1Intrinsics
2916 Enables intrinsics for SHA\-1 crypto hash function\&.
2919 \-XX:+UseSHA256Intrinsics
2921 Enables intrinsics for SHA\-224 and SHA\-256 crypto hash functions\&.
2924 \-XX:+UseSHA512Intrinsics
2926 Enables intrinsics for SHA\-384 and SHA\-512 crypto hash functions\&.
2931 Enables the transformation of scalar operations into superword operations\&. This option is enabled by default\&. To disable the transformation of scalar operations into superword operations, specify
2932 \fB\-XX:\-UseSuperWord\fR\&. Only the Java HotSpot Server VM supports this option\&.
2934 .SS "Advanced Serviceability Options"
2936 These options provide the ability to gather system information and perform extensive debugging\&.
2938 \-XX:+ExtendedDTraceProbes
2942 tool probes that impact the performance\&. By default, this option is disabled and
2944 performs only standard probes\&.
2947 \-XX:+HeapDumpOnOutOfMemory
2949 Enables the dumping of the Java heap to a file in the current directory by using the heap profiler (HPROF) when a
2950 \fBjava\&.lang\&.OutOfMemoryError\fR
2951 exception is thrown\&. You can explicitly set the heap dump file path and name using the
2952 \fB\-XX:HeapDumpPath\fR
2953 option\&. By default, this option is disabled and the heap is not dumped when an
2954 \fBOutOfMemoryError\fR
2955 exception is thrown\&.
2958 \-XX:HeapDumpPath=\fIpath\fR
2960 Sets the path and file name for writing the heap dump provided by the heap profiler (HPROF) when the
2961 \fB\-XX:+HeapDumpOnOutOfMemoryError\fR
2962 option is set\&. By default, the file is created in the current working directory, and it is named
2963 \fBjava_pid\fR\fIpid\fR\fB\&.hprof\fR
2966 is the identifier of the process that caused the error\&. The following example shows how to set the default file explicitly (\fB%p\fR
2967 represents the current process identificator):
2973 \fB\-XX:HeapDumpPath=\&./java_pid%p\&.hprof\fR
2979 The following example shows how to set the heap dump file to
2980 \fB/var/log/java/java_heapdump\&.hprof\fR:
2986 \fB\-XX:HeapDumpPath=/var/log/java/java_heapdump\&.hprof\fR
2994 \-XX:LogFile=\fIpath\fR
2996 Sets the path and file name where log data is written\&. By default, the file is created in the current working directory, and it is named
2997 \fBhotspot\&.log\fR\&.
2999 The following example shows how to set the log file to
3000 \fB/var/log/java/hotspot\&.log\fR:
3006 \fB\-XX:LogFile=/var/log/java/hotspot\&.log\fR
3014 \-XX:+PrintClassHistogram
3016 Enables printing of a class instance histogram after a
3018 event (\fBSIGTERM\fR)\&. By default, this option is disabled\&.
3020 Setting this option is equivalent to running the
3023 \fBjcmd \fR\fIpid\fR\fB GC\&.class_histogram\fR
3026 is the current Java process identifier\&.
3029 \-XX:+PrintConcurrentLocks
3031 Enables printing of locks after a event\&. By default, this option is disabled\&.
3034 \fBjava\&.util\&.concurrent\fR
3037 event (\fBSIGTERM\fR)\&. By default, this option is disabled\&.
3039 Setting this option is equivalent to running the
3042 \fBjcmd \fR\fIpid\fR\fB Thread\&.print \-l\fR
3045 is the current Java process identifier\&.
3048 \-XX:+UnlockDiagnosticVMOptions
3050 Unlocks the options intended for diagnosing the JVM\&. By default, this option is disabled and diagnostic options are not available\&.
3052 .SS "Advanced Garbage Collection Options"
3054 These options control how garbage collection (GC) is performed by the Java HotSpot VM\&.
3056 \-XX:+AggressiveHeap
3058 Enables Java heap optimization\&. This sets various parameters to be optimal for long\-running jobs with intensive memory allocation, based on the configuration of the computer (RAM and CPU)\&. By default, the option is disabled and the heap is not optimized\&.
3061 \-XX:+AlwaysPreTouch
3063 Enables touching of every page on the Java heap during JVM initialization\&. This gets all pages into the memory before entering the
3065 method\&. The option can be used in testing to simulate a long\-running system with all virtual memory mapped to physical memory\&. By default, this option is disabled and all pages are committed as JVM heap space fills\&.
3068 \-XX:+CMSClassUnloadingEnabled
3070 Enables class unloading when using the concurrent mark\-sweep (CMS) garbage collector\&. This option is enabled by default\&. To disable class unloading for the CMS garbage collector, specify
3071 \fB\-XX:\-CMSClassUnloadingEnabled\fR\&.
3074 \-XX:CMSExpAvgFactor=\fIpercent\fR
3076 Sets the percentage of time (0 to 100) used to weight the current sample when computing exponential averages for the concurrent collection statistics\&. By default, the exponential averages factor is set to 25%\&. The following example shows how to set the factor to 15%:
3082 \fB\-XX:CMSExpAvgFactor=15\fR
3090 \-XX:CMSInitiatingOccupancyFraction=\fIpercent\fR
3092 Sets the percentage of the old generation occupancy (0 to 100) at which to start a CMS collection cycle\&. The default value is set to \-1\&. Any negative value (including the default) implies that
3093 \fB\-XX:CMSTriggerRatio\fR
3094 is used to define the value of the initiating occupancy fraction\&.
3096 The following example shows how to set the occupancy fraction to 20%:
3102 \fB\-XX:CMSInitiatingOccupancyFraction=20\fR
3110 \-XX:+CMSScavengeBeforeRemark
3112 Enables scavenging attempts before the CMS remark step\&. By default, this option is disabled\&.
3115 \-XX:CMSTriggerRatio=\fIpercent\fR
3117 Sets the percentage (0 to 100) of the value specified by
3118 \fB\-XX:MinHeapFreeRatio\fR
3119 that is allocated before a CMS collection cycle commences\&. The default value is set to 80%\&.
3121 The following example shows how to set the occupancy fraction to 75%:
3127 \fB\-XX:CMSTriggerRatio=75\fR
3135 \-XX:ConcGCThreads=\fIthreads\fR
3137 Sets the number of threads used for concurrent GC\&. The default value depends on the number of CPUs available to the JVM\&.
3139 For example, to set the number of threads for concurrent GC to 2, specify the following option:
3145 \fB\-XX:ConcGCThreads=2\fR
3153 \-XX:+DisableExplicitGC
3155 Enables the option that disables processing of calls to
3156 \fBSystem\&.gc()\fR\&. This option is disabled by default, meaning that calls to
3158 are processed\&. If processing of calls to
3160 is disabled, the JVM still performs GC when necessary\&.
3163 \-XX:+ExplicitGCInvokesConcurrent
3165 Enables invoking of concurrent GC by using the
3167 request\&. This option is disabled by default and can be enabled only together with the
3168 \fB\-XX:+UseConcMarkSweepGC\fR
3172 \-XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses
3174 Enables invoking of concurrent GC by using the
3176 request and unloading of classes during the concurrent GC cycle\&. This option is disabled by default and can be enabled only together with the
3177 \fB\-XX:+UseConcMarkSweepGC\fR
3181 \-XX:G1HeapRegionSize=\fIsize\fR
3183 Sets the size of the regions into which the Java heap is subdivided when using the garbage\-first (G1) collector\&. The value can be between 1 MB and 32 MB\&. The default region size is determined ergonomically based on the heap size\&.
3185 The following example shows how to set the size of the subdivisions to 16 MB:
3191 \fB\-XX:G1HeapRegionSize=16m\fR
3199 \-XX:+G1PrintHeapRegions
3201 Enables the printing of information about which regions are allocated and which are reclaimed by the G1 collector\&. By default, this option is disabled\&.
3204 \-XX:G1ReservePercent=\fIpercent\fR
3206 Sets the percentage of the heap (0 to 50) that is reserved as a false ceiling to reduce the possibility of promotion failure for the G1 collector\&. By default, this option is set to 10%\&.
3208 The following example shows how to set the reserved heap to 20%:
3214 \fB\-XX:G1ReservePercent=20\fR
3222 \-XX:InitialHeapSize=\fIsize\fR
3224 Sets the initial size (in bytes) of the memory allocation pool\&. This value must be either 0, or a multiple of 1024 and greater than 1 MB\&. Append the letter
3228 to indicate kilobytes,
3232 to indicate megabytes,
3236 to indicate gigabytes\&. The default value is chosen at runtime based on system configuration\&. See the section "Ergonomics" in
3237 \fIJava SE HotSpot Virtual Machine Garbage Collection Tuning Guide\fR
3238 at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gctuning/index\&.html\&.
3240 The following examples show how to set the size of allocated memory to 6 MB using various units:
3246 \fB\-XX:InitialHeapSize=6291456\fR
3247 \fB\-XX:InitialHeapSize=6144k\fR
3248 \fB\-XX:InitialHeapSize=6m\fR
3254 If you set this option to 0, then the initial size will be set as the sum of the sizes allocated for the old generation and the young generation\&. The size of the heap for the young generation can be set using the
3259 \-XX:InitialSurvivorRatio=\fIratio\fR
3261 Sets the initial survivor space ratio used by the throughput garbage collector (which is enabled by the
3262 \fB\-XX:+UseParallelGC\fR
3263 and/or \-\fBXX:+UseParallelOldGC\fR
3264 options)\&. Adaptive sizing is enabled by default with the throughput garbage collector by using the
3265 \fB\-XX:+UseParallelGC\fR
3267 \fB\-XX:+UseParallelOldGC\fR
3268 options, and survivor space is resized according to the application behavior, starting with the initial value\&. If adaptive sizing is disabled (using the
3269 \fB\-XX:\-UseAdaptiveSizePolicy\fR
3271 \fB\-XX:SurvivorRatio\fR
3272 option should be used to set the size of the survivor space for the entire execution of the application\&.
3274 The following formula can be used to calculate the initial size of survivor space (S) based on the size of the young generation (Y), and the initial survivor space ratio (R):
3286 The 2 in the equation denotes two survivor spaces\&. The larger the value specified as the initial survivor space ratio, the smaller the initial survivor space size\&.
3288 By default, the initial survivor space ratio is set to 8\&. If the default value for the young generation space size is used (2 MB), the initial size of the survivor space will be 0\&.2 MB\&.
3290 The following example shows how to set the initial survivor space ratio to 4:
3296 \fB\-XX:InitialSurvivorRatio=4\fR
3304 \-XX:InitiatingHeapOccupancyPercent=\fIpercent\fR
3306 Sets the percentage of the heap occupancy (0 to 100) at which to start a concurrent GC cycle\&. It is used by garbage collectors that trigger a concurrent GC cycle based on the occupancy of the entire heap, not just one of the generations (for example, the G1 garbage collector)\&.
3308 By default, the initiating value is set to 45%\&. A value of 0 implies nonstop GC cycles\&. The following example shows how to set the initiating heap occupancy to 75%:
3314 \fB\-XX:InitiatingHeapOccupancyPercent=75\fR
3322 \-XX:MaxGCPauseMillis=\fItime\fR
3324 Sets a target for the maximum GC pause time (in milliseconds)\&. This is a soft goal, and the JVM will make its best effort to achieve it\&. By default, there is no maximum pause time value\&.
3326 The following example shows how to set the maximum target pause time to 500 ms:
3332 \fB\-XX:MaxGCPauseMillis=500\fR
3340 \-XX:MaxHeapSize=\fIsize\fR
3342 Sets the maximum size (in byes) of the memory allocation pool\&. This value must be a multiple of 1024 and greater than 2 MB\&. Append the letter
3346 to indicate kilobytes,
3350 to indicate megabytes,
3354 to indicate gigabytes\&. The default value is chosen at runtime based on system configuration\&. For server deployments,
3355 \fB\-XX:InitialHeapSize\fR
3357 \fB\-XX:MaxHeapSize\fR
3358 are often set to the same value\&. See the section "Ergonomics" in
3359 \fIJava SE HotSpot Virtual Machine Garbage Collection Tuning Guide\fR
3360 at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gctuning/index\&.html\&.
3362 The following examples show how to set the maximum allowed size of allocated memory to 80 MB using various units:
3368 \fB\-XX:MaxHeapSize=83886080\fR
3369 \fB\-XX:MaxHeapSize=81920k\fR
3370 \fB\-XX:MaxHeapSize=80m\fR
3376 On Oracle Solaris 7 and Oracle Solaris 8 SPARC platforms, the upper limit for this value is approximately 4,000 MB minus overhead amounts\&. On Oracle Solaris 2\&.6 and x86 platforms, the upper limit is approximately 2,000 MB minus overhead amounts\&. On Linux platforms, the upper limit is approximately 2,000 MB minus overhead amounts\&.
3379 \fB\-XX:MaxHeapSize\fR
3380 option is equivalent to
3384 \-XX:MaxHeapFreeRatio=\fIpercent\fR
3386 Sets the maximum allowed percentage of free heap space (0 to 100) after a GC event\&. If free heap space expands above this value, then the heap will be shrunk\&. By default, this value is set to 70%\&.
3388 The following example shows how to set the maximum free heap ratio to 75%:
3394 \fB\-XX:MaxHeapFreeRatio=75\fR
3402 \-XX:MaxMetaspaceSize=\fIsize\fR
3404 Sets the maximum amount of native memory that can be allocated for class metadata\&. By default, the size is not limited\&. The amount of metadata for an application depends on the application itself, other running applications, and the amount of memory available on the system\&.
3406 The following example shows how to set the maximum class metadata size to 256 MB:
3412 \fB\-XX:MaxMetaspaceSize=256m\fR
3420 \-XX:MaxNewSize=\fIsize\fR
3422 Sets the maximum size (in bytes) of the heap for the young generation (nursery)\&. The default value is set ergonomically\&.
3425 \-XX:MaxTenuringThreshold=\fIthreshold\fR
3427 Sets the maximum tenuring threshold for use in adaptive GC sizing\&. The largest value is 15\&. The default value is 15 for the parallel (throughput) collector, and 6 for the CMS collector\&.
3429 The following example shows how to set the maximum tenuring threshold to 10:
3435 \fB\-XX:MaxTenuringThreshold=10\fR
3443 \-XX:MetaspaceSize=\fIsize\fR
3445 Sets the size of the allocated class metadata space that will trigger a garbage collection the first time it is exceeded\&. This threshold for a garbage collection is increased or decreased depending on the amount of metadata used\&. The default size depends on the platform\&.
3448 \-XX:MinHeapFreeRatio=\fIpercent\fR
3450 Sets the minimum allowed percentage of free heap space (0 to 100) after a GC event\&. If free heap space falls below this value, then the heap will be expanded\&. By default, this value is set to 40%\&.
3452 The following example shows how to set the minimum free heap ratio to 25%:
3458 \fB\-XX:MinHeapFreeRatio=25\fR
3466 \-XX:NewRatio=\fIratio\fR
3468 Sets the ratio between young and old generation sizes\&. By default, this option is set to 2\&. The following example shows how to set the young/old ratio to 1:
3474 \fB\-XX:NewRatio=1\fR
3482 \-XX:NewSize=\fIsize\fR
3484 Sets the initial size (in bytes) of the heap for the young generation (nursery)\&. Append the letter
3488 to indicate kilobytes,
3492 to indicate megabytes,
3496 to indicate gigabytes\&.
3498 The young generation region of the heap is used for new objects\&. GC is performed in this region more often than in other regions\&. If the size for the young generation is too low, then a large number of minor GCs will be performed\&. If the size is too high, then only full GCs will be performed, which can take a long time to complete\&. Oracle recommends that you keep the size for the young generation between a half and a quarter of the overall heap size\&.
3500 The following examples show how to set the initial size of young generation to 256 MB using various units:
3506 \fB\-XX:NewSize=256m\fR
3507 \fB\-XX:NewSize=262144k\fR
3508 \fB\-XX:NewSize=268435456\fR
3516 option is equivalent to
3520 \-XX:ParallelGCThreads=\fIthreads\fR
3522 Sets the number of threads used for parallel garbage collection in the young and old generations\&. The default value depends on the number of CPUs available to the JVM\&.
3524 For example, to set the number of threads for parallel GC to 2, specify the following option:
3530 \fB\-XX:ParallelGCThreads=2\fR
3538 \-XX:+ParallelRefProcEnabled
3540 Enables parallel reference processing\&. By default, this option is disabled\&.
3543 \-XX:+PrintAdaptiveSizePolicy
3545 Enables printing of information about adaptive generation sizing\&. By default, this option is disabled\&.
3550 Enables printing of messages at every GC\&. By default, this option is disabled\&.
3553 \-XX:+PrintGCApplicationConcurrentTime
3555 Enables printing of how much time elapsed since the last pause (for example, a GC pause)\&. By default, this option is disabled\&.
3558 \-XX:+PrintGCApplicationStoppedTime
3560 Enables printing of how much time the pause (for example, a GC pause) lasted\&. By default, this option is disabled\&.
3563 \-XX:+PrintGCDateStamps
3565 Enables printing of a date stamp at every GC\&. By default, this option is disabled\&.
3568 \-XX:+PrintGCDetails
3570 Enables printing of detailed messages at every GC\&. By default, this option is disabled\&.
3573 \-XX:+PrintGCTaskTimeStamps
3575 Enables printing of time stamps for every individual GC worker thread task\&. By default, this option is disabled\&.
3578 \-XX:+PrintGCTimeStamps
3580 Enables printing of time stamps at every GC\&. By default, this option is disabled\&.
3583 \-XX:+PrintStringDeduplicationStatistics
3585 Prints detailed deduplication statistics\&. By default, this option is disabled\&. See the
3586 \fB\-XX:+UseStringDeduplication\fR
3590 \-XX:+PrintTenuringDistribution
3592 Enables printing of tenuring age information\&. The following is an example of the output:
3598 \fBDesired survivor size 48286924 bytes, new threshold 10 (max 10)\fR
3599 \fB\- age 1: 28992024 bytes, 28992024 total\fR
3600 \fB\- age 2: 1366864 bytes, 30358888 total\fR
3601 \fB\- age 3: 1425912 bytes, 31784800 total\fR
3608 Age 1 objects are the youngest survivors (they were created after the previous scavenge, survived the latest scavenge, and moved from eden to survivor space)\&. Age 2 objects have survived two scavenges (during the second scavenge they were copied from one survivor space to the next)\&. And so on\&.
3610 In the preceding example, 28 992 024 bytes survived one scavenge and were copied from eden to survivor space, 1 366 864 bytes are occupied by age 2 objects, etc\&. The third value in each row is the cumulative size of objects of age n or less\&.
3612 By default, this option is disabled\&.
3615 \-XX:+ScavengeBeforeFullGC
3617 Enables GC of the young generation before each full GC\&. This option is enabled by default\&. Oracle recommends that you
3619 disable it, because scavenging the young generation before a full GC can reduce the number of objects reachable from the old generation space into the young generation space\&. To disable GC of the young generation before each full GC, specify
3620 \fB\-XX:\-ScavengeBeforeFullGC\fR\&.
3623 \-XX:SoftRefLRUPolicyMSPerMB=\fItime\fR
3625 Sets the amount of time (in milliseconds) a softly reachable object is kept active on the heap after the last time it was referenced\&. The default value is one second of lifetime per free megabyte in the heap\&. The
3626 \fB\-XX:SoftRefLRUPolicyMSPerMB\fR
3627 option accepts integer values representing milliseconds per one megabyte of the current heap size (for Java HotSpot Client VM) or the maximum possible heap size (for Java HotSpot Server VM)\&. This difference means that the Client VM tends to flush soft references rather than grow the heap, whereas the Server VM tends to grow the heap rather than flush soft references\&. In the latter case, the value of the
3629 option has a significant effect on how quickly soft references are garbage collected\&.
3631 The following example shows how to set the value to 2\&.5 seconds:
3637 \fB\-XX:SoftRefLRUPolicyMSPerMB=2500\fR
3645 \-XX:StringDeduplicationAgeThreshold=\fIthreshold\fR
3648 objects reaching the specified age are considered candidates for deduplication\&. An object\*(Aqs age is a measure of how many times it has survived garbage collection\&. This is sometimes referred to as tenuring; see the
3649 \fB\-XX:+PrintTenuringDistribution\fR
3652 objects that are promoted to an old heap region before this age has been reached are always considered candidates for deduplication\&. The default value for this option is
3654 \fB\-XX:+UseStringDeduplication\fR
3658 \-XX:SurvivorRatio=\fIratio\fR
3660 Sets the ratio between eden space size and survivor space size\&. By default, this option is set to 8\&. The following example shows how to set the eden/survivor space ratio to 4:
3666 \fB\-XX:SurvivorRatio=4\fR
3674 \-XX:TargetSurvivorRatio=\fIpercent\fR
3676 Sets the desired percentage of survivor space (0 to 100) used after young garbage collection\&. By default, this option is set to 50%\&.
3678 The following example shows how to set the target survivor space ratio to 30%:
3684 \fB\-XX:TargetSurvivorRatio=30\fR
3692 \-XX:TLABSize=\fIsize\fR
3694 Sets the initial size (in bytes) of a thread\-local allocation buffer (TLAB)\&. Append the letter
3698 to indicate kilobytes,
3702 to indicate megabytes,
3706 to indicate gigabytes\&. If this option is set to 0, then the JVM chooses the initial size automatically\&.
3708 The following example shows how to set the initial TLAB size to 512 KB:
3714 \fB\-XX:TLABSize=512k\fR
3722 \-XX:+UseAdaptiveSizePolicy
3724 Enables the use of adaptive generation sizing\&. This option is enabled by default\&. To disable adaptive generation sizing, specify
3725 \fB\-XX:\-UseAdaptiveSizePolicy\fR
3726 and set the size of the memory allocation pool explicitly (see the
3727 \fB\-XX:SurvivorRatio\fR
3731 \-XX:+UseCMSInitiatingOccupancyOnly
3733 Enables the use of the occupancy value as the only criterion for initiating the CMS collector\&. By default, this option is disabled and other criteria may be used\&.
3736 \-XX:+UseConcMarkSweepGC
3738 Enables the use of the CMS garbage collector for the old generation\&. Oracle recommends that you use the CMS garbage collector when application latency requirements cannot be met by the throughput (\fB\-XX:+UseParallelGC\fR) garbage collector\&. The G1 garbage collector (\fB\-XX:+UseG1GC\fR) is another alternative\&.
3740 By default, this option is disabled and the collector is chosen automatically based on the configuration of the machine and type of the JVM\&. When this option is enabled, the
3741 \fB\-XX:+UseParNewGC\fR
3742 option is automatically set and you should not disable it, because the following combination of options has been deprecated in JDK 8:
3743 \fB\-XX:+UseConcMarkSweepGC \-XX:\-UseParNewGC\fR\&.
3748 Enables the use of the garbage\-first (G1) garbage collector\&. It is a server\-style garbage collector, targeted for multiprocessor machines with a large amount of RAM\&. It meets GC pause time goals with high probability, while maintaining good throughput\&. The G1 collector is recommended for applications requiring large heaps (sizes of around 6 GB or larger) with limited GC latency requirements (stable and predictable pause time below 0\&.5 seconds)\&.
3750 By default, this option is disabled and the collector is chosen automatically based on the configuration of the machine and type of the JVM\&.
3753 \-XX:+UseGCOverheadLimit
3755 Enables the use of a policy that limits the proportion of time spent by the JVM on GC before an
3756 \fBOutOfMemoryError\fR
3757 exception is thrown\&. This option is enabled, by default and the parallel GC will throw an
3758 \fBOutOfMemoryError\fR
3759 if more than 98% of the total time is spent on garbage collection and less than 2% of the heap is recovered\&. When the heap is small, this feature can be used to prevent applications from running for long periods of time with little or no progress\&. To disable this option, specify
3760 \fB\-XX:\-UseGCOverheadLimit\fR\&.
3765 Enables performance optimization of an application on a machine with nonuniform memory architecture (NUMA) by increasing the application\*(Aqs use of lower latency memory\&. By default, this option is disabled and no optimization for NUMA is made\&. The option is only available when the parallel garbage collector is used (\fB\-XX:+UseParallelGC\fR)\&.
3770 Enables the use of the parallel scavenge garbage collector (also known as the throughput collector) to improve the performance of your application by leveraging multiple processors\&.
3772 By default, this option is disabled and the collector is chosen automatically based on the configuration of the machine and type of the JVM\&. If it is enabled, then the
3773 \fB\-XX:+UseParallelOldGC\fR
3774 option is automatically enabled, unless you explicitly disable it\&.
3777 \-XX:+UseParallelOldGC
3779 Enables the use of the parallel garbage collector for full GCs\&. By default, this option is disabled\&. Enabling it automatically enables the
3780 \fB\-XX:+UseParallelGC\fR
3786 Enables the use of parallel threads for collection in the young generation\&. By default, this option is disabled\&. It is automatically enabled when you set the
3787 \fB\-XX:+UseConcMarkSweepGC\fR
3789 \fB\-XX:+UseParNewGC\fR
3791 \fB\-XX:+UseConcMarkSweepGC\fR
3792 option was deprecated in JDK 8\&.
3797 Enables the use of the serial garbage collector\&. This is generally the best choice for small and simple applications that do not require any special functionality from garbage collection\&. By default, this option is disabled and the collector is chosen automatically based on the configuration of the machine and type of the JVM\&.
3802 On Linux, enables the JVM to use shared memory to setup large pages\&.
3804 For more information, see "Large Pages"\&.
3807 \-XX:+UseStringDeduplication
3809 Enables string deduplication\&. By default, this option is disabled\&. To use this option, you must enable the garbage\-first (G1) garbage collector\&. See the
3813 \fIString deduplication\fR
3814 reduces the memory footprint of
3816 objects on the Java heap by taking advantage of the fact that many
3818 objects are identical\&. Instead of each
3820 object pointing to its own character array, identical
3822 objects can point to and share the same character array\&.
3827 Enables the use of thread\-local allocation blocks (TLABs) in the young generation space\&. This option is enabled by default\&. To disable the use of TLABs, specify
3828 \fB\-XX:\-UseTLAB\fR\&.
3830 .SS "Deprecated and Removed Options"
3832 These options were included in the previous release, but have since been considered unnecessary\&.
3836 Enables incremental garbage collection\&. This option was deprecated in JDK 8 with no replacement\&.
3841 Loads the specified debugging/profiling library\&. This option was superseded by the
3846 \-XX:CMSIncrementalDutyCycle=\fIpercent\fR
3848 Sets the percentage of time (0 to 100) between minor collections that the concurrent collector is allowed to run\&. This option was deprecated in JDK 8 with no replacement, following the deprecation of the
3849 \fB\-XX:+CMSIncrementalMode\fR
3853 \-XX:CMSIncrementalDutyCycleMin=\fIpercent\fR
3855 Sets the percentage of time (0 to 100) between minor collections that is the lower bound for the duty cycle when
3856 \fB\-XX:+CMSIncrementalPacing\fR
3857 is enabled\&. This option was deprecated in JDK 8 with no replacement, following the deprecation of the
3858 \fB\-XX:+CMSIncrementalMode\fR
3862 \-XX:+CMSIncrementalMode
3864 Enables the incremental mode for the CMS collector\&. This option was deprecated in JDK 8 with no replacement, along with other options that start with
3865 \fBCMSIncremental\fR\&.
3868 \-XX:CMSIncrementalOffset=\fIpercent\fR
3870 Sets the percentage of time (0 to 100) by which the incremental mode duty cycle is shifted to the right within the period between minor collections\&. This option was deprecated in JDK 8 with no replacement, following the deprecation of the
3871 \fB\-XX:+CMSIncrementalMode\fR
3875 \-XX:+CMSIncrementalPacing
3877 Enables automatic adjustment of the incremental mode duty cycle based on statistics collected while the JVM is running\&. This option was deprecated in JDK 8 with no replacement, following the deprecation of the
3878 \fB\-XX:+CMSIncrementalMode\fR
3882 \-XX:CMSIncrementalSafetyFactor=\fIpercent\fR
3884 Sets the percentage of time (0 to 100) used to add conservatism when computing the duty cycle\&. This option was deprecated in JDK 8 with no replacement, following the deprecation of the
3885 \fB\-XX:+CMSIncrementalMode\fR
3889 \-XX:CMSInitiatingPermOccupancyFraction=\fIpercent\fR
3891 Sets the percentage of the permanent generation occupancy (0 to 100) at which to start a GC\&. This option was deprecated in JDK 8 with no replacement\&.
3894 \-XX:MaxPermSize=\fIsize\fR
3896 Sets the maximum permanent generation space size (in bytes)\&. This option was deprecated in JDK 8, and superseded by the
3897 \fB\-XX:MaxMetaspaceSize\fR
3901 \-XX:PermSize=\fIsize\fR
3903 Sets the space (in bytes) allocated to the permanent generation that triggers a garbage collection if it is exceeded\&. This option was deprecated un JDK 8, and superseded by the
3904 \fB\-XX:MetaspaceSize\fR
3908 \-XX:+UseSplitVerifier
3910 Enables splitting of the verification process\&. By default, this option was enabled in the previous releases, and verification was split into two phases: type referencing (performed by the compiler) and type checking (performed by the JVM runtime)\&. This option was deprecated in JDK 8, and verification is now split by default without a way to disable it\&.
3913 \-XX:+UseStringCache
3915 Enables caching of commonly allocated strings\&. This option was removed from JDK 8 with no replacement\&.
3917 .SH "PERFORMANCE TUNING EXAMPLES"
3919 The following examples show how to use experimental tuning flags to either optimize throughput or to provide lower response time\&.
3921 \fBExample 1 \fRTuning for Higher Throughput
3928 \fBjava \-d64 \-server \-XX:+AggressiveOpts \-XX:+UseLargePages \-Xmn10g \-Xms26g \-Xmx26g\fR
3936 \fBExample 2 \fRTuning for Lower Response Time
3943 \fBjava \-d64 \-XX:+UseG1GC \-Xms26g Xmx26g \-XX:MaxGCPauseMillis=500 \-XX:+PrintGCTimeStamp\fR
3952 Also known as huge pages, large pages are memory pages that are significantly larger than the standard memory page size (which varies depending on the processor and operating system)\&. Large pages optimize processor Translation\-Lookaside Buffers\&.
3954 A Translation\-Lookaside Buffer (TLB) is a page translation cache that holds the most\-recently used virtual\-to\-physical address translations\&. TLB is a scarce system resource\&. A TLB miss can be costly as the processor must then read from the hierarchical page table, which may require multiple memory accesses\&. By using a larger memory page size, a single TLB entry can represent a larger memory range\&. There will be less pressure on TLB, and memory\-intensive applications may have better performance\&.
3956 However, large pages page memory can negatively affect system performance\&. For example, when a large mount of memory is pinned by an application, it may create a shortage of regular memory and cause excessive paging in other applications and slow down the entire system\&. Also, a system that has been up for a long time could produce excessive fragmentation, which could make it impossible to reserve enough large page memory\&. When this happens, either the OS or JVM reverts to using regular pages\&.
3957 .SS "Large Pages Support"
3959 Solaris and Linux support large pages\&.
3962 .nr an-no-space-flag 1
3969 Solaris 9 and later include Multiple Page Size Support (MPSS); no additional configuration is necessary\&. See http://www\&.oracle\&.com/technetwork/server\-storage/solaris10/overview/solaris9\-features\-scalability\-135663\&.html\&.
3973 .nr an-no-space-flag 1
3980 The 2\&.6 kernel supports large pages\&. Some vendors have backported the code to their 2\&.4\-based releases\&. To check if your system can support large page memory, try the following:
3986 \fB# cat /proc/meminfo | grep Huge\fR
3987 \fBHugePages_Total: 0\fR
3988 \fBHugePages_Free: 0\fR
3989 \fBHugepagesize: 2048 kB\fR
3996 If the output shows the three "Huge" variables, then your system can support large page memory but it needs to be configured\&. If the command prints nothing, then your system does not support large pages\&. To configure the system to use large page memory, login as
3997 \fBroot\fR, and then follow these steps:
4007 If you are using the option
4010 \fB\-XX:+UseHugeTLBFS\fR), then increase the
4012 value\&. It must be larger than the Java heap size\&. On a system with 4 GB of physical RAM (or less), the following will make all the memory sharable:
4018 \fB# echo 4294967295 > /proc/sys/kernel/shmmax\fR
4034 If you are using the option
4037 \fB\-XX:+UseHugeTLBFS\fR, then specify the number of large pages\&. In the following example, 3 GB of a 4 GB system are reserved for large pages (assuming a large page size of 2048kB, then 3 GB = 3 * 1024 MB = 3072 MB = 3072 * 1024 kB = 3145728 kB and 3145728 kB / 2048 kB = 1536):
4043 \fB# echo 1536 > /proc/sys/vm/nr_hugepages\fR
4055 .nr an-no-space-flag 1
4069 \h'-04'\(bu\h'+03'\c
4075 Note that the values contained in
4077 will reset after you reboot your system, so may want to set them in an initialization script (for example,
4080 \fBsysctl\&.conf\fR)\&.
4085 \h'-04'\(bu\h'+03'\c
4091 If you configure (or resize) the OS kernel parameters
4092 \fB/proc/sys/kernel/shmmax\fR
4094 \fB/proc/sys/vm/nr_hugepages\fR, Java processes may allocate large pages for areas in addition to the Java heap\&. These steps can allocate large pages for the following areas:
4098 \h'-04'\(bu\h'+03'\c
4109 \h'-04'\(bu\h'+03'\c
4120 \h'-04'\(bu\h'+03'\c
4126 The marking bitmap data structure for the parallel GC
4129 Consequently, if you configure the
4131 parameter to the size of the Java heap, then the JVM can fail in allocating the code cache areas on large pages because these areas are quite large in size\&.
4139 .SH "APPLICATION CLASS DATA SHARING"
4141 Application Class Data Sharing (AppCDS) extends CDS (see https://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/class\-data\-sharing\&.html) to enable classes from the standard extensions directories (specified by the system property
4142 \fBjava\&.ext\&.dirs\fR; see https://docs\&.oracle\&.com/javase/8/docs/technotes/guides/extensions/spec\&.html) and the application class path (see "Setting the Class Path ") to be placed in the shared archive\&. AppCDS reduces the footprint and decreases start\-up time of your applications provided that a substantial number of classes are loaded from the application class path\&.
4144 This is a commercial feature that requires you to also specify the
4145 \fB\-XX:+UnlockCommercialFeatures\fR
4146 option\&. This is also an experimental feature; it may change in future releases\&.
4147 .SS "Creating a Shared Archive File, and Running an Application with It"
4149 The following steps create a shared archive file that contains all the classes used by the
4151 application\&. The last step runs the application with the shared archive file\&.
4161 Create a list of all classes used by the
4163 application\&. The following command creates a file named
4164 \fBhello\&.classlist\fR
4165 that contains a list of all classes used by this application:
4167 \fBjava \-Xshare:off \-XX:+UnlockCommercialFeatures \-XX:DumpLoadedClassList=hello\&.classlist \-XX:+UseAppCDS \-cp hello\&.jar test\&.Hello\fR
4171 parameter must contain only JAR files; the
4172 \fB\-XX:+UseAppCDS\fR
4173 option does not support class paths that contain directory names\&.
4184 Create a shared archive, named
4185 \fBhello\&.jsa\fR, that contains all the classes in
4186 \fBhello\&.classlist\fR:
4188 \fBjava \-XX:+UnlockCommercialFeatures \-Xshare:dump \-XX:+UseAppCDS \-XX:SharedArchiveFile=hello\&.jsa \-XX:SharedClassListFile=hello\&.classlist \-cp hello\&.jar\fR
4192 parameter used at archive creation time must be the same as (or a prefix of) the
4207 with the shared archive
4210 \fBjava \-XX:+UnlockCommercialFeatures \-Xshare:on \-XX:+UseAppCDS \-XX:SharedArchiveFile=hello\&.jsa \-cp hello\&.jar test\&.Hello\fR
4212 Ensure that you have specified the option
4214 or \-\fBXshare:auto\fR\&.
4227 application is using the class contained in the
4231 \fBjava \-XX:+UnlockCommercialFeatures \-Xshare:on \-XX:+UseAppCDS \-XX:SharedArchiveFile=hello\&.jsa \-cp hello\&.jar \-verbose:class test\&.Hello\fR
4233 The output of this command should contain the following text:
4235 \fBLoaded test\&.Hello from shared objects file by sun/misc/Launcher$AppClassLoader\fR
4237 .SS "Sharing a Shared Archive across Multiple Application Processes"
4239 You can share the same archive file across multiple applications processes that have the exact same class path or share a common class path prefix\&. This reduces memory usage as the archive is memory\-mapped into the address space of the processes\&. The operating system automatically shares the read\-only pages across these processes\&.
4241 The following steps create a shared archive that both applications
4255 Create a list of all classes used by the
4257 application and another list for the
4261 \fBjava \-XX:+UnlockCommercialFeatures \-XX:DumpLoadedClassList=hello\&.classlist \-XX:+UseAppCDS \-cp common\&.jar:hello\&.jar Hello\fR
4263 \fBjava \-XX:+UnlockCommercialFeatures \-XX:DumpLoadedClassList=hi\&.classlist \-XX:+UseAppCDS \-cp common\&.jar:hi\&.jar Hi\fR
4265 Note that because the
4269 applications share a common class path prefix (both of their class paths start with
4270 \fBcommon\&.jar\fR), these two applications can share a shared archive file\&.
4281 Create a single list of classes used by all the applications that will share the shared archive file\&.
4283 The following commands combine the files
4284 \fBhello\&.classlist\fR
4286 \fBhi\&.classlist\fR
4288 \fBcommon\&.classlist\fR:
4290 \fBcat hello\&.classlist hi\&.classlist > common\&.classlist\fR
4301 Create a shared archive, named
4302 \fBcommon\&.jsa\fR, that contains all the classes in
4303 \fBcommon\&.classlist\fR:
4305 \fBjava \-XX:+UnlockCommercialFeatures \-Xshare:dump \-XX:SharedArchiveFile=common\&.jsa \-XX:+UseAppCDS \-XX:SharedClassListFile=common\&.classlist \-cp common\&.jar\fR
4309 parameter is the common class path prefix shared by the
4328 applications with the same shared archive:
4330 \fBjava \-XX:+UnlockCommercialFeatures \-Xshare:on \-XX:SharedArchiveFile=common\&.jsa \-XX:+UseAppCDS \-cp common\&.jar:hello\&.jar Hello\fR
4332 \fBjava \-XX:+UnlockCommercialFeatures \-Xshare:on \-XX:SharedArchiveFile=common\&.jsa \-XX:+UseAppCDS \-cp common\&.jar:hi\&.jar Hi\fR
4336 The following exit values are typically returned by the launcher when the launcher is called with the wrong arguments, serious errors, or exceptions thrown by the JVM\&. However, a Java application may choose to return any value by using the API call
4337 \fBSystem\&.exit(exitValue)\fR\&. The values are:
4341 \h'-04'\(bu\h'+03'\c
4347 \fB0\fR: Successful completion
4352 \h'-04'\(bu\h'+03'\c
4358 \fB>0\fR: An error occurred
4364 \h'-04'\(bu\h'+03'\c
4375 \h'-04'\(bu\h'+03'\c
4386 \h'-04'\(bu\h'+03'\c
4397 \h'-04'\(bu\h'+03'\c
4408 \h'-04'\(bu\h'+03'\c