< prev index next >

src/java.base/share/man/java.1

Print this page




   5 .\" This code is free software; you can redistribute it and/or modify it
   6 .\" under the terms of the GNU General Public License version 2 only, as
   7 .\" published by the Free Software Foundation.
   8 .\"
   9 .\" This code is distributed in the hope that it will be useful, but WITHOUT
  10 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11 .\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12 .\" version 2 for more details (a copy is included in the LICENSE file that
  13 .\" accompanied this code).
  14 .\"
  15 .\" You should have received a copy of the GNU General Public License version
  16 .\" 2 along with this work; if not, write to the Free Software Foundation,
  17 .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 .\"
  19 .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 .\" or visit www.oracle.com if you need additional information or have any
  21 .\" questions.
  22 .\"
  23 .\" Automatically generated by Pandoc 2.3.1
  24 .\"
  25 .TH "JAVA" "1" "2019" "JDK 13" "JDK Commands"
  26 .hy
  27 .SH NAME
  28 .PP
  29 java \- launch a Java application
  30 .SH SYNOPSIS
  31 .PP
  32 To launch a class file:
  33 .PP
  34 \f[CB]java\f[R] [\f[I]options\f[R]] \f[I]mainclass\f[R] [\f[I]args\f[R] ...]
  35 .PP
  36 To launch the main class in a JAR file:
  37 .PP
  38 \f[CB]java\f[R] [\f[I]options\f[R]] \f[CB]\-jar\f[R] \f[I]jarfile\f[R]
  39 [\f[I]args\f[R] ...]
  40 .PP
  41 To launch the main class in a module:
  42 .PP
  43 \f[CB]java\f[R] [\f[I]options\f[R]] \f[CB]\-m\f[R]
  44 \f[I]module\f[R][\f[CB]/\f[R]\f[I]mainclass\f[R]] [\f[I]args\f[R] ...]
  45 .PP


 164 main class name.
 165 .IP \[bu] 2
 166 The \f[CB]\-\-source\f[R] \f[I]version\f[R] option, if present.
 167 .PP
 168 If the class identifies an existing file that has a \f[CB]\&.java\f[R]
 169 extension, or if the \f[CB]\-\-source\f[R] option is specified, then
 170 source\-file mode is selected.
 171 The source file is then compiled and run.
 172 The \f[CB]\-\-source\f[R] option can be used to specify the source
 173 \f[I]version\f[R] or \f[I]N\f[R] of the source code.
 174 This determines the API that can be used.
 175 When you set \f[CB]\-\-source\f[R] \f[I]N\f[R], you can only use the public
 176 API that was defined in JDK \f[I]N\f[R].
 177 .RS
 178 .PP
 179 \f[B]Note:\f[R] The valid values of \f[I]N\f[R] change for each release,
 180 with new values added and old values removed.
 181 You\[aq]ll get an error message if you use a value of \f[I]N\f[R] that is
 182 no longer supported.
 183 Supported values of \f[I]N\f[R] for this release are \f[CB]7\f[R],
 184 \f[CB]8\f[R], \f[CB]9\f[R], \f[CB]10\f[R], \f[CB]11\f[R], \f[CB]12\f[R], and
 185 \f[CB]13\f[R].
 186 .RE
 187 .PP
 188 If the file does not have the \f[CB]\&.java\f[R] extension, the
 189 \f[CB]\-\-source\f[R] option must be used to tell the \f[CB]java\f[R]
 190 command to use the source\-file mode.
 191 The \f[CB]\-\-source\f[R] option is used for cases when the source file is
 192 a "script" to be executed and the name of the source file does not
 193 follow the normal naming conventions for Java source files.
 194 .PP
 195 In source\-file mode, the effect is as though the source file is
 196 compiled into memory, and the first class found in the source file is
 197 executed.
 198 Any arguments placed after the name of the source file in the original
 199 command line are passed to the compiled class when it is executed.
 200 .PP
 201 For example, if a file were named \f[CB]HelloWorld.java\f[R] and contained
 202 a class named \f[CB]hello.World\f[R], then the source\-file mode command
 203 to launch the class would be:
 204 .RS
 205 .PP


 250 environment are taken into account.
 251 .IP \[bu] 2
 252 No other source files are found and compiled, as if the source path is
 253 set to an empty value.
 254 .IP \[bu] 2
 255 Annotation processing is disabled, as if \f[CB]\-proc:none\f[R] is in
 256 effect.
 257 .IP \[bu] 2
 258 If a version is specified, via the \f[CB]\-\-source\f[R] option, the value
 259 is used as the argument for an implicit \f[CB]\-\-release\f[R] option for
 260 the compilation.
 261 This sets both the source version accepted by compiler and the system
 262 API that may be used by the code in the source file.
 263 .IP \[bu] 2
 264 The source file is compiled in the context of an unnamed module.
 265 .IP \[bu] 2
 266 The source file should contain one or more top\-level classes, the first
 267 of which is taken as the class to be executed.
 268 .IP \[bu] 2
 269 The compiler does not enforce the optional restriction defined at the
 270 end of JLS §7.6, that a type in a named package should exist in a file
 271 whose name is composed from the type name followed by the
 272 \f[CB]\&.java\f[R] extension.
 273 .IP \[bu] 2
 274 If the source file contains errors, appropriate error messages are
 275 written to the standard error stream, and the launcher exits with a
 276 non\-zero exit code.
 277 .PP
 278 \f[B]In source\-file mode, execution proceeds as follows:\f[R]
 279 .IP \[bu] 2
 280 The class to be executed is the first top\-level class found in the
 281 source file.
 282 It must contain a declaration of the standard
 283 \f[CB]public\ static\ void\ main(String[])\f[R] method.
 284 .IP \[bu] 2
 285 The compiled classes are loaded by a custom class loader, that delegates
 286 to the application class loader.
 287 This implies that classes appearing on the application class path cannot
 288 refer to any classes declared in the source file.
 289 .IP \[bu] 2
 290 The compiled classes are executed in the context of an unnamed module,


 298 It is an error if there is a class on the application class path whose
 299 name is the same as that of the class to be executed.
 300 .PP
 301 See \f[B]JEP 330: Launch Single\-File Source\-Code Programs\f[R]
 302 [http://openjdk.java.net/jeps/330] for complete details.
 303 .SH USING THE JDK_JAVA_OPTIONS LAUNCHER ENVIRONMENT VARIABLE
 304 .PP
 305 \f[CB]JDK_JAVA_OPTIONS\f[R] prepends its content to the options parsed
 306 from the command line.
 307 The content of the \f[CB]JDK_JAVA_OPTIONS\f[R] environment variable is a
 308 list of arguments separated by white\-space characters (as determined by
 309 \f[CB]isspace()\f[R]).
 310 These are prepended to the command line arguments passed to
 311 \f[CB]java\f[R] launcher.
 312 The encoding requirement for the environment variable is the same as the
 313 \f[CB]java\f[R] command line on the system.
 314 \f[CB]JDK_JAVA_OPTIONS\f[R] environment variable content is treated in the
 315 same manner as that specified in the command line.
 316 .PP
 317 Single (\f[CB]\[aq]\f[R]) or double (\f[CB]"\f[R]) quotes can be used to
 318 enclose arguments that\ contain whitespace characters.
 319 All content between the open quote and the first matching close quote
 320 are preserved by simply removing the pair of quotes.
 321 In case a matching quote is not found, the launcher will abort with an
 322 error message.
 323 \f[CB]\@\f[R]\-files are supported as they are specified in the command
 324 line.
 325 However, as in \f[CB]\@\f[R]\-files, use of a wildcard is not supported.
 326 In order to mitigate potential misuse of \f[CB]JDK_JAVA_OPTIONS\f[R]
 327 behavior, options that specify the main class (such as \f[CB]\-jar\f[R])
 328 or cause the \f[CB]java\f[R] launcher to exit without executing the main
 329 class (such as \f[CB]\-h\f[R]) are disallowed in the environment variable.
 330 If any of these options appear in the environment variable, the launcher
 331 will abort with an error message.
 332 When \f[CB]JDK_JAVA_OPTIONS\f[R] is set, the launcher prints a message to
 333 stderr as a reminder.
 334 .PP
 335 \f[B]Example:\f[R]
 336 .IP
 337 .nf
 338 \f[CB]


 785 .RS
 786 .PP
 787 \f[B]Oracle Solaris, Linux, and macOS:\f[R] Colons (\f[CB]:\f[R]) separate
 788 entities in this list.
 789 .PP
 790 \f[B]Windows:\f[R] Semicolons (\f[CB];\f[R]) separate entities in this
 791 list.
 792 .RE
 793 .TP
 794 .B \f[CB]\-Xcheck:jni\f[R]
 795 Performs additional checks for Java Native Interface (JNI) functions.
 796 Specifically, it validates the parameters passed to the JNI function and
 797 the runtime environment data before processing the JNI request.
 798 It also checks for pending exceptions between JNI calls.
 799 Any invalid data encountered indicates a problem in the native code, and
 800 the JVM terminates with an irrecoverable error in such cases.
 801 Expect a performance degradation when this option is used.
 802 .RS
 803 .RE
 804 .TP
 805 .B \f[CB]\-Xcomp\f[R]
 806 Forces compilation of methods on first invocation.
 807 By default, the Client VM (\f[CB]\-client\f[R]) performs 1,000 interpreted
 808 method invocations and the Server VM (\f[CB]\-server\f[R]) performs 10,000
 809 interpreted method invocations to gather information for efficient
 810 compilation.
 811 Specifying the \f[CB]\-Xcomp\f[R] option disables interpreted method
 812 invocations to increase compilation performance at the expense of
 813 efficiency.
 814 You can also change the number of interpreted method invocations before
 815 compilation using the \f[CB]\-XX:CompileThreshold\f[R] option.
 816 .RS
 817 .RE
 818 .TP
 819 .B \f[CB]\-Xdebug\f[R]
 820 Does nothing.
 821 Provided for backward compatibility.
 822 .RS
 823 .RE
 824 .TP
 825 .B \f[CB]\-Xdiag\f[R]
 826 Shows additional diagnostic messages.
 827 .RS
 828 .RE
 829 .TP
 830 .B \f[CB]\-Xint\f[R]
 831 Runs the application in interpreted\-only mode.
 832 Compilation to native code is disabled, and all bytecode is executed by
 833 the interpreter.
 834 The performance benefits offered by the just\-in\-time (JIT) compiler
 835 aren\[aq]t present in this mode.
 836 .RS
 837 .RE
 838 .TP
 839 .B \f[CB]\-Xinternalversion\f[R]
 840 Displays more detailed JVM version information than the
 841 \f[CB]\-version\f[R] option, and then exits.
 842 .RS
 843 .RE
 844 .TP
 845 .B \f[CB]\-Xlog:\f[R]\f[I]option\f[R]
 846 Configure or enable logging with the Java Virtual Machine (JVM) unified
 847 logging framework.
 848 See \f[B]Enable Logging with the JVM Unified Logging Framework\f[R].
 849 .RS
 850 .RE
 851 .TP
 852 .B \f[CB]\-Xmixed\f[R]
 853 Executes all bytecode by the interpreter except for hot methods, which
 854 are compiled to native code.


 855 .RS
 856 .RE
 857 .TP
 858 .B \f[CB]\-Xmn\f[R] \f[I]size\f[R]
 859 Sets the initial and maximum size (in bytes) of the heap for the young
 860 generation (nursery) in the generational collectors.
 861 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
 862 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
 863 \f[CB]G\f[R] to indicate gigabytes.
 864 The young generation region of the heap is used for new objects.
 865 GC is performed in this region more often than in other regions.
 866 If the size for the young generation is too small, then a lot of minor
 867 garbage collections are performed.
 868 If the size is too large, then only full garbage collections are
 869 performed, which can take a long time to complete.
 870 It is recommended that you do not set the size for the young generation
 871 for the G1 collector, and keep the size for the young generation greater
 872 than 25% and less than 50% of the overall heap size for other
 873 collectors.
 874 The following examples show how to set the initial and maximum size of


1626 marks.
1627 For an example of a command string, see the description of the
1628 \f[CB]\-XX:OnError\f[R] option.
1629 .RS
1630 .RE
1631 .TP
1632 .B \f[CB]\-XX:+PrintCommandLineFlags\f[R]
1633 Enables printing of ergonomically selected JVM flags that appeared on
1634 the command line.
1635 It can be useful to know the ergonomic values set by the JVM, such as
1636 the heap space size and the selected garbage collector.
1637 By default, this option is disabled and flags aren\[aq]t printed.
1638 .RS
1639 .RE
1640 .TP
1641 .B \f[CB]\-XX:+PreserveFramePointer\f[R]
1642 Selects between using the RBP register as a general purpose register
1643 (\f[CB]\-XX:\-PreserveFramePointer\f[R]) and using the RBP register to
1644 hold the frame pointer of the currently executing method
1645 (\f[CB]\-XX:+PreserveFramePointer\f[R] .
1646 If the frame pointer is available, then external profiling tools\ (for
1647 example, Linux perf) can construct more accurate stack traces.
1648 .RS
1649 .RE
1650 .TP
1651 .B \f[CB]\-XX:+PrintNMTStatistics\f[R]
1652 Enables printing of collected native memory tracking data at JVM exit
1653 when native memory tracking is enabled (see
1654 \f[CB]\-XX:NativeMemoryTracking\f[R]).
1655 By default, this option is disabled and native memory tracking data
1656 isn\[aq]t printed.
1657 .RS
1658 .RE
1659 .TP
1660 .B \f[CB]\-XX:SharedArchiveFile=\f[R]\f[I]path\f[R]
1661 Specifies the path and name of the class data sharing (CDS) archive file
1662 .RS
1663 .PP
1664 See \f[B]Application Class Data Sharing\f[R].
1665 .RE
1666 .TP


1677 For example, to specify the classes \f[CB]java.lang.Object\f[R] and
1678 \f[CB]hello.Main\f[R], create a text file that contains the following two
1679 lines:
1680 .RS
1681 .IP
1682 .nf
1683 \f[CB]
1684 java/lang/Object
1685 hello/Main
1686 \f[R]
1687 .fi
1688 .PP
1689 The classes that you specify in this text file should include the
1690 classes that are commonly used by the application.
1691 They may include any classes from the application, extension, or
1692 bootstrap class paths.
1693 .PP
1694 See \f[B]Application Class Data Sharing\f[R].
1695 .RE
1696 .TP













1697 .B \f[CB]\-XX:+ShowMessageBoxOnError\f[R]
1698 Enables the display of a dialog box when the JVM experiences an
1699 irrecoverable error.
1700 This prevents the JVM from exiting and keeps the process active so that
1701 you can attach a debugger to it to investigate the cause of the error.
1702 By default, this option is disabled.
1703 .RS
1704 .RE
1705 .TP
1706 .B \f[CB]\-XX:StartFlightRecording=\f[R]\f[I]parameter\f[R]\f[CB]=\f[R]\f[I]value\f[R]
1707 Starts a JFR recording for the Java application.
1708 This option is equivalent to the \f[CB]JFR.start\f[R] diagnostic command
1709 that starts a recording during runtime.
1710 You can set the following \f[I]parameter\f[R]\f[CB]=\f[R]\f[I]value\f[R]
1711 entries when starting a JFR recording:
1712 .RS
1713 .TP
1714 .B \f[CB]delay=\f[R]\f[I]time\f[R]
1715 Specifies the delay between the Java application launch time and the
1716 start of the recording.


1813 This default settings file collects a predefined set of information with
1814 low overhead, so it has minimal impact on performance and can be used
1815 with recordings that run continuously.
1816 .RS
1817 .PP
1818 A second settings file is also provided, profile.jfc, which provides
1819 more data than the default configuration, but can have more overhead and
1820 impact performance.
1821 Use this configuration for short periods of time when more information
1822 is needed.
1823 .RE
1824 .PP
1825 You can specify values for multiple parameters by separating them with a
1826 comma.
1827 .RE
1828 .TP
1829 .B \f[CB]\-XX:ThreadStackSize=\f[R]\f[I]size\f[R]
1830 Sets the Java thread stack size (in kilobytes).
1831 Use of a scaling suffix, such as \f[CB]k\f[R], results in the scaling of
1832 the kilobytes value so that \f[CB]\-XX:ThreadStackSize=1k\f[R] sets the
1833 Java thread stack size\ to 1024*1024 bytes or 1 megabyte.
1834 The default value depends on the platform:
1835 .RS
1836 .IP \[bu] 2
1837 Linux/x64 (64\-bit): 1024 KB
1838 .IP \[bu] 2
1839 macOS (64\-bit): 1024 KB
1840 .IP \[bu] 2
1841 Oracle Solaris (64\-bit): 1024 KB
1842 .IP \[bu] 2
1843 Windows: The default value depends on virtual memory
1844 .PP
1845 The following examples show how to set the thread stack size to 1
1846 megabyte in different units:
1847 .IP
1848 .nf
1849 \f[CB]
1850 \-XX:ThreadStackSize=1k
1851 \-XX:ThreadStackSize=1024
1852 \f[R]
1853 .fi


1875 By default this range is 32 GB.
1876 .RS
1877 .PP
1878 With compressed oops enabled, object references are represented as
1879 32\-bit offsets instead of 64\-bit pointers, which typically increases
1880 performance when running the application with Java heap sizes smaller
1881 than the compressed oops pointer range.
1882 This option works only for 64\-bit JVMs.
1883 .PP
1884 It\[aq]s possible to use compressed pointers with Java heap sizes
1885 greater than 32 GB.
1886 See the \f[CB]\-XX:ObjectAlignmentInBytes\f[R] option.
1887 .RE
1888 .TP
1889 .B \f[CB]\-XX:\-UseContainerSupport\f[R]
1890 The VM now provides automatic container detection support, which allows
1891 the VM to determine the amount of memory and number of processors that
1892 are available to a Java process running in docker containers.
1893 It uses this information to allocate system resources.
1894 This support is only available on Linux x64 platforms.
1895 \ If supported, the default for this flag is\ \f[CB]true\f[R], and
1896 container support is enabled by default.
1897 \ It\ can be disabled with\ \f[CB]\-XX:\-UseContainerSupport\f[R].
1898 .RS
1899 .PP
1900 Unified Logging is available to help to diagnose issues related to this
1901 support.
1902 .PP
1903 Use \f[CB]\-Xlog:os+container=trace\f[R] for maximum logging of container
1904 information.
1905 See \f[B]Enable Logging with the JVM Unified Logging Framework\f[R] for a
1906 description of using Unified Logging.
1907 .RE
1908 .TP
1909 .B \f[CB]\-XX:+UseHugeTLBFS\f[R]
1910 \f[B]Linux only:\f[R] This option is the equivalent of specifying
1911 \f[CB]\-XX:+UseLargePages\f[R].
1912 This option is disabled by default.
1913 This option pre\-allocates all large pages up\-front, when memory is
1914 reserved; consequently the JVM can\[aq]t dynamically grow or shrink
1915 large pages memory areas; see \f[CB]\-XX:UseTransparentHugePages\f[R] if
1916 you want this behavior.
1917 .RS


1947 .TP
1948 .B \f[CB]\-XX:VMOptionsFile=\f[R]\f[I]filename\f[R]
1949 Allows user to specify VM options in a file, for example,
1950 \f[CB]java\ \-XX:VMOptionsFile=/var/my_vm_options\ HelloWorld\f[R].
1951 .RS
1952 .RE
1953 .SH ADVANCED JIT COMPILER OPTIONS FOR JAVA
1954 .PP
1955 These \f[CB]java\f[R] options control the dynamic just\-in\-time (JIT)
1956 compilation performed by the Java HotSpot VM.
1957 .TP
1958 .B \f[CB]\-XX:AllocateInstancePrefetchLines=\f[R]\f[I]lines\f[R]
1959 Sets the number of lines to prefetch ahead of the instance allocation
1960 pointer.
1961 By default, the number of lines to prefetch is set to 1:
1962 .RS
1963 .RS
1964 .PP
1965 \f[CB]\-XX:AllocateInstancePrefetchLines=1\f[R]
1966 .RE
1967 .PP
1968 Only the Java HotSpot Server VM supports this option.
1969 .RE
1970 .TP
1971 .B \f[CB]\-XX:AllocatePrefetchDistance=\f[R]\f[I]size\f[R]
1972 Sets the size (in bytes) of the prefetch distance for object allocation.
1973 Memory about to be written with the value of new objects is prefetched
1974 up to this distance starting from the address of the last allocated
1975 object.
1976 Each Java thread has its own allocation point.
1977 .RS
1978 .PP
1979 Negative values denote that prefetch distance is chosen based on the
1980 platform.
1981 Positive values are bytes to prefetch.
1982 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
1983 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
1984 \f[CB]G\f[R] to indicate gigabytes.
1985 The default value is set to \-1.
1986 .PP
1987 The following example shows how to set the prefetch distance to 1024
1988 bytes:
1989 .RS
1990 .PP
1991 \f[CB]\-XX:AllocatePrefetchDistance=1024\f[R]
1992 .RE
1993 .PP
1994 Only the Java HotSpot Server VM supports this option.
1995 .RE
1996 .TP
1997 .B \f[CB]\-XX:AllocatePrefetchInstr=\f[R]\f[I]instruction\f[R]
1998 Sets the prefetch instruction to prefetch ahead of the allocation
1999 pointer.
2000 Only the Java HotSpot Server VM supports this option.
2001 Possible values are from 0 to 3.
2002 The actual instructions behind the values depend on the platform.
2003 By default, the prefetch instruction is set to 0:
2004 .RS
2005 .RS
2006 .PP
2007 \f[CB]\-XX:AllocatePrefetchInstr=0\f[R]
2008 .RE
2009 .PP
2010 Only the Java HotSpot Server VM supports this option.
2011 .RE
2012 .TP
2013 .B \f[CB]\-XX:AllocatePrefetchLines=\f[R]\f[I]lines\f[R]
2014 Sets the number of cache lines to load after the last object allocation
2015 by using the prefetch instructions generated in compiled code.
2016 The default value is 1 if the last allocated object was an instance, and
2017 3 if it was an array.
2018 .RS
2019 .PP
2020 The following example shows how to set the number of loaded cache lines
2021 to 5:
2022 .RS
2023 .PP
2024 \f[CB]\-XX:AllocatePrefetchLines=5\f[R]
2025 .RE
2026 .PP
2027 Only the Java HotSpot Server VM supports this option.
2028 .RE
2029 .TP
2030 .B \f[CB]\-XX:AllocatePrefetchStepSize=\f[R]\f[I]size\f[R]
2031 Sets the step size (in bytes) for sequential prefetch instructions.
2032 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
2033 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, \f[CB]g\f[R] or \f[CB]G\f[R]
2034 to indicate gigabytes.
2035 By default, the step size is set to 16 bytes:
2036 .RS
2037 .RS
2038 .PP
2039 \f[CB]\-XX:AllocatePrefetchStepSize=16\f[R]
2040 .RE
2041 .PP
2042 Only the Java HotSpot Server VM supports this option.
2043 .RE
2044 .TP
2045 .B \f[CB]\-XX:AllocatePrefetchStyle=\f[R]\f[I]style\f[R]
2046 Sets the generated code style for prefetch instructions.
2047 The \f[I]style\f[R] argument is an integer from 0 to 3:
2048 .RS
2049 .TP
2050 .B \f[CB]0\f[R]
2051 Don\[aq]t generate prefetch instructions.
2052 .RS
2053 .RE
2054 .TP
2055 .B \f[CB]1\f[R]
2056 Execute prefetch instructions after each allocation.
2057 This is the default parameter.
2058 .RS
2059 .RE
2060 .TP
2061 .B \f[CB]2\f[R]
2062 Use the thread\-local allocation block (TLAB) watermark pointer to
2063 determine when prefetch instructions are executed.
2064 .RS
2065 .RE
2066 .TP
2067 .B \f[CB]3\f[R]
2068 Use BIS instruction on SPARC for allocation prefetch.
2069 .RS
2070 .RE
2071 .PP
2072 Only the Java HotSpot Server VM supports this option.
2073 .RE
2074 .TP
2075 .B \f[CB]\-XX:+BackgroundCompilation\f[R]
2076 Enables background compilation.
2077 This option is enabled by default.
2078 To disable background compilation, specify
2079 \f[CB]\-XX:\-BackgroundCompilation\f[R] (this is equivalent to specifying
2080 \f[CB]\-Xbatch\f[R]).
2081 .RS
2082 .RE
2083 .TP
2084 .B \f[CB]\-XX:CICompilerCount=\f[R]\f[I]threads\f[R]
2085 Sets the number of compiler threads to use for compilation.
2086 By default, the number of threads is set to 2 for the server JVM, to 1
2087 for the client JVM, and it scales to the number of cores if tiered
2088 compilation is used.
2089 The following example shows how to set the number of threads to 2:
2090 .RS
2091 .RS
2092 .PP
2093 \f[CB]\-XX:CICompilerCount=2\f[R]
2094 .RE
2095 .RE
2096 .TP







2097 .B \f[CB]\-XX:CompileCommand=\f[R]\f[I]command\f[R]\f[CB],\f[R]\f[I]method\f[R][\f[CB],\f[R]\f[I]option\f[R]]
2098 Specifies a \f[I]command\f[R] to perform on a \f[I]method\f[R].
2099 For example, to exclude the \f[CB]indexOf()\f[R] method of the
2100 \f[CB]String\f[R] class from being compiled, use the following:
2101 .RS
2102 .RS
2103 .PP
2104 \f[CB]\-XX:CompileCommand=exclude,java/lang/String.indexOf\f[R]
2105 .RE
2106 .PP
2107 Note that the full class name is specified, including all packages and
2108 subpackages separated by a slash (\f[CB]/\f[R]).
2109 For easier cut\-and\-paste operations, it\[aq]s also possible to use the
2110 method name format produced by the \f[CB]\-XX:+PrintCompilation\f[R] and
2111 \f[CB]\-XX:+LogCompilation\f[R] options:
2112 .RS
2113 .PP
2114 \f[CB]\-XX:CompileCommand=exclude,java.lang.String::indexOf\f[R]
2115 .RE
2116 .PP


2301 \f[CB]\-XX:+LogCompilation\f[R] options:
2302 .RS
2303 .PP
2304 \f[CB]\-XX:CompileOnly=java.lang.String::length,java.util.List::size\f[R]
2305 .RE
2306 .PP
2307 Although wildcards aren\[aq]t supported, you can specify only the class
2308 or package name to compile all methods in that class or package, as well
2309 as specify just the method to compile methods with this name in any
2310 class:
2311 .IP
2312 .nf
2313 \f[CB]
2314 \-XX:CompileOnly=java/lang/String
2315 \-XX:CompileOnly=java/lang
2316 \-XX:CompileOnly=.length
2317 \f[R]
2318 .fi
2319 .RE
2320 .TP
2321 .B \f[CB]\-XX:CompileThreshold=\f[R]\f[I]invocations\f[R]
2322 Sets the number of interpreted method invocations before compilation.
2323 By default, in the server JVM, the JIT compiler performs 10,000
2324 interpreted method invocations to gather information for efficient
2325 compilation.
2326 For the client JVM, the default setting is 1,500 invocations.
2327 This option is ignored when tiered compilation is enabled; see the
2328 option \f[CB]\-XX:\-TieredCompilation\f[R].
2329 The following example shows how to set the number of interpreted method
2330 invocations to 5,000:
2331 .RS
2332 .RS
2333 .PP
2334 \f[CB]\-XX:CompileThreshold=5000\f[R]
2335 .RE
2336 .PP
2337 You can completely disable interpretation of Java methods before
2338 compilation by specifying the \f[CB]\-Xcomp\f[R] option.
2339 .RE
2340 .TP
2341 .B \f[CB]\-XX:CompileThresholdScaling=\f[R]\f[I]scale\f[R]
2342 Provides unified control of first compilation.
2343 This option controls when methods are first compiled for both the tiered
2344 and the nontiered modes of operation.
2345 The \f[CB]CompileThresholdScaling\f[R] option has an integer value between
2346 0 and +Inf and scales the thresholds corresponding to the current mode
2347 of operation (both tiered and nontiered).
2348 Setting \f[CB]CompileThresholdScaling\f[R] to a value less than 1.0
2349 results in earlier compilation while values greater than 1.0 delay
2350 compilation.
2351 Setting \f[CB]CompileThresholdScaling\f[R] to 0 is equivalent to disabling
2352 compilation.
2353 .RS
2354 .RE
2355 .TP
2356 .B \f[CB]\-XX:+DoEscapeAnalysis\f[R]
2357 Enables the use of escape analysis.
2358 This option is enabled by default.
2359 To disable the use of escape analysis, specify
2360 \f[CB]\-XX:\-DoEscapeAnalysis\f[R].
2361 Only the Java HotSpot Server VM supports this option.
2362 .RS
2363 .RE
2364 .TP
2365 .B \f[CB]\-XX:InitialCodeCacheSize=\f[R]\f[I]size\f[R]
2366 Sets the initial code cache size (in bytes).
2367 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
2368 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
2369 \f[CB]G\f[R] to indicate gigabytes.
2370 The default value is set to 500 KB.
2371 The initial code cache size shouldn\[aq]t be less than the system\[aq]s
2372 minimal memory page size.
2373 The following example shows how to set the initial code cache size to 32
2374 KB:
2375 .RS
2376 .RS
2377 .PP
2378 \f[CB]\-XX:InitialCodeCacheSize=32k\f[R]
2379 .RE
2380 .RE
2381 .TP
2382 .B \f[CB]\-XX:+Inline\f[R]
2383 Enables method inlining.
2384 This option is enabled by default to increase performance.
2385 To disable method inlining, specify \f[CB]\-XX:\-Inline\f[R].
2386 .RS
2387 .RE
2388 .TP
2389 .B \f[CB]\-XX:InlineSmallCode=\f[R]\f[I]size\f[R]
2390 Sets the maximum code size (in bytes) for compiled methods that should
2391 be inlined.
2392 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
2393 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
2394 \f[CB]G\f[R] to indicate gigabytes.
2395 Only compiled methods with the size smaller than the specified size is
2396 inlined.
2397 By default, the maximum code size is set to 1000 bytes:
2398 .RS
2399 .RS
2400 .PP
2401 \f[CB]\-XX:InlineSmallCode=1000\f[R]
2402 .RE
2403 .RE
2404 .TP
2405 .B \f[CB]\-XX:+LogCompilation\f[R]
2406 Enables logging of compilation activity to a file named
2407 \f[CB]hotspot.log\f[R] in the current working directory.
2408 You can specify a different log file path and name using the
2409 \f[CB]\-XX:LogFile\f[R] option.
2410 .RS
2411 .PP
2412 By default, this option is disabled and compilation activity isn\[aq]t
2413 logged.
2414 The \f[CB]\-XX:+LogCompilation\f[R] option has to be used together with
2415 the \f[CB]\-XX:UnlockDiagnosticVMOptions\f[R] option that unlocks
2416 diagnostic JVM options.
2417 .PP
2418 You can enable verbose diagnostic output with a message printed to the
2419 console every time a method is compiled by using the
2420 \f[CB]\-XX:+PrintCompilation\f[R] option.
2421 .RE
2422 .TP














2423 .B \f[CB]\-XX:MaxInlineSize=\f[R]\f[I]size\f[R]
2424 Sets the maximum bytecode size (in bytes) of a method to be inlined.

2425 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
2426 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
2427 \f[CB]G\f[R] to indicate gigabytes.
2428 By default, the maximum bytecode size is set to 35 bytes:
2429 .RS
2430 .RS
2431 .PP
2432 \f[CB]\-XX:MaxInlineSize=35\f[R]
2433 .RE
2434 .RE
2435 .TP















2436 .B \f[CB]\-XX:MaxNodeLimit=\f[R]\f[I]nodes\f[R]
2437 Sets the maximum number of nodes to be used during single method
2438 compilation.
2439 By default, the maximum number of nodes is set to 65,000:

2440 .RS
2441 .RS
2442 .PP
2443 \f[CB]\-XX:MaxNodeLimit=65000\f[R]
2444 .RE
2445 .RE
2446 .TP
2447 .B \f[CB]\-XX:NonNMethodCodeHeapSize=\f[R]\f[I]size\f[R]
2448 Sets the size in bytes of the code segment containing nonmethod code.
2449 .RS
2450 .PP
2451 A nonmethod code segment containing nonmethod code, such as compiler
2452 buffers and the bytecode interpreter.
2453 This code type stays in the code cache forever.
2454 This flag is used only if \f[CB]\-XX:SegmentedCodeCache\f[R] is enabled.
2455 .RE
2456 .TP
2457 .B \f[CB]\-XX:NonProfiledCodeHeapSize=\f[R]\f[I]size\f[R]
2458 Sets the size in bytes of the code segment containing nonprofiled
2459 methods.
2460 This flag is used only if \f[CB]\-XX:SegmentedCodeCache\f[R] is enabled.
2461 .RS
2462 .RE
2463 .TP
2464 .B \f[CB]\-XX:MaxTrivialSize=\f[R]\f[I]size\f[R]
2465 Sets the maximum bytecode size (in bytes) of a trivial method to be
2466 inlined.
2467 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
2468 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
2469 \f[CB]G\f[R] to indicate gigabytes.
2470 By default, the maximum bytecode size of a trivial method is set to 6
2471 bytes:
2472 .RS
2473 .RS
2474 .PP
2475 \f[CB]\-XX:MaxTrivialSize=6\f[R]
2476 .RE
2477 .RE
2478 .TP
2479 .B \f[CB]\-XX:+OptimizeStringConcat\f[R]
2480 Enables the optimization of \f[CB]String\f[R] concatenation operations.
2481 This option is enabled by default.
2482 To disable the optimization of \f[CB]String\f[R] concatenation operations,
2483 specify \f[CB]\-XX:\-OptimizeStringConcat\f[R].
2484 Only the Java HotSpot Server VM supports this option.
2485 .RS
2486 .RE
2487 .TP
2488 .B \f[CB]\-XX:+PrintAssembly\f[R]
2489 Enables printing of assembly code for bytecoded and native methods by
2490 using the external \f[CB]hsdis\-<arch>.so\f[R] or \f[CB]\&.dll\f[R] library.
2491 For 64\-bit VM on Windows, it\[aq]s \f[CB]hsdis\-amd64.dll\f[R].
2492 This lets you to see the generated code, which may help you to diagnose
2493 performance issues.
2494 .RS
2495 .PP
2496 By default, this option is disabled and assembly code isn\[aq]t printed.
2497 The \f[CB]\-XX:+PrintAssembly\f[R] option has to be used together with the
2498 \f[CB]\-XX:UnlockDiagnosticVMOptions\f[R] option that unlocks diagnostic
2499 JVM options.
2500 .RE
2501 .TP
2502 .B \f[CB]\-XX:ProfiledCodeHeapSize=\f[R]\f[I]size\f[R]
2503 Sets the size in bytes of the code segment containing profiled methods.
2504 This flag is used only if \f[CB]\-XX:SegmentedCodeCache\f[R] is enabled.


2578 The advantages are better control of the memory footprint, reduced code
2579 fragmentation, and better iTLB/iCache behavior due to improved locality.
2580 iTLB/iCache is a CPU\-specific term meaning Instruction Translation
2581 Lookaside Buffer (ITLB).
2582 ICache is an instruction cache in theCPU.
2583 The implementation of the code cache can be found in the file:
2584 \f[CB]/share/vm/code/codeCache.cpp\f[R].
2585 .RS
2586 .RE
2587 .TP
2588 .B \f[CB]\-XX:StartAggressiveSweepingAt=\f[R]\f[I]percent\f[R]
2589 Forces stack scanning of active methods to aggressively remove unused
2590 code when only the given percentage of the code cache is free.
2591 The default value is 10%.
2592 .RS
2593 .RE
2594 .TP
2595 .B \f[CB]\-XX:\-TieredCompilation\f[R]
2596 Disables the use of tiered compilation.
2597 By default, this option is enabled.
2598 Only the Java HotSpot Server VM supports this option.











2599 .RS
2600 .RE
2601 .TP
2602 .B \f[CB]\-XX:+UseAES\f[R]
2603 Enables hardware\-based AES intrinsics for Intel, AMD, and SPARC
2604 hardware.
2605 Intel Westmere (2010 and newer), AMD Bulldozer (2011 and newer), and
2606 SPARC (T4 and newer) are the supported hardware.
2607 The \f[CB]\-XX:+UseAES\f[R] is used in conjunction with UseAESIntrinsics.
2608 Flags that control intrinsics now require the option
2609 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2610 .RS
2611 .RE
2612 .TP
2613 .B \f[CB]\-XX:+UseAESIntrinsics\f[R]
2614 Enables \f[CB]\-XX:+UseAES\f[R] and \f[CB]\-XX:+UseAESIntrinsics\f[R] flags
2615 by default and are supported only for the Java HotSpot Server VM.

2616 To disable hardware\-based AES intrinsics, specify
2617 \f[CB]\-XX:\-UseAES\ \-XX:\-UseAESIntrinsics\f[R].
2618 For example, to enable hardware AES, use the following flags:
2619 .RS
2620 .RS
2621 .PP
2622 \f[CB]\-XX:+UseAES\ \-XX:+UseAESIntrinsics\f[R]
2623 .RE
2624 .PP
2625 Flags that control intrinsics now require the option
2626 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2627 To support UseAES and UseAESIntrinsics flags, use the \f[CB]\-server\f[R]
2628 option to select the Java HotSpot Server VM.
2629 These flags aren\[aq]t supported on Client VM.










































































































































2630 .RE
2631 .TP
2632 .B \f[CB]\-XX:+UseCMoveUnconditionally\f[R]
2633 Generates CMove (scalar and vector) instructions regardless of
2634 profitability analysis.
2635 .RS
2636 .RE
2637 .TP
2638 .B \f[CB]\-XX:+UseCodeCacheFlushing\f[R]
2639 Enables flushing of the code cache before shutting down the compiler.
2640 This option is enabled by default.
2641 To disable flushing of the code cache before shutting down the compiler,
2642 specify \f[CB]\-XX:\-UseCodeCacheFlushing\f[R].
2643 .RS
2644 .RE
2645 .TP
2646 .B \f[CB]\-XX:+UseCondCardMark\f[R]
2647 Enables checking if the card is already marked before updating the card
2648 table.
2649 This option is disabled by default.
2650 It should be used only on machines with multiple sockets, where it
2651 increases the performance of Java applications that rely on concurrent
2652 operations.
2653 Only the Java HotSpot Server VM supports this option.
2654 .RS
2655 .RE
2656 .TP
2657 .B \f[CB]\-XX:+UseCountedLoopSafepoints\f[R]
2658 Keeps safepoints in counted loops.
2659 Its default value is false.\ 



















2660 .RS
2661 .RE
2662 .TP
2663 .B \f[CB]\-XX:+UseFMA\f[R]
2664 Enables hardware\-based FMA intrinsics for hardware where FMA
2665 instructions are available (such as, Intel, SPARC, and ARM64).
2666 FMA intrinsics are generated for the
2667 \f[CB]java.lang.Math.fma(\f[R]\f[I]a\f[R]\f[CB],\f[R] \f[I]b\f[R]\f[CB],\f[R]
2668 \f[I]c\f[R]\f[CB])\f[R] methods that calculate the value of \f[CB](\f[R]
2669 \f[I]a\f[R] \f[CB]*\f[R] \f[I]b\f[R] \f[CB]+\f[R] \f[I]c\f[R] \f[CB])\f[R]
2670 expressions.
2671 .RS
2672 .RE
2673 .TP
2674 .B \f[CB]\-XX:+UseRTMDeopt\f[R]
2675 Autotunes RTM locking depending on the abort ratio.
2676 This ratio is specified by the \f[CB]\-XX:RTMAbortRatio\f[R] option.
2677 If the number of aborted transactions exceeds the abort ratio, then the
2678 method containing the lock is deoptimized and recompiled with all locks
2679 as normal locks.
2680 This option is disabled by default.
2681 The \f[CB]\-XX:+UseRTMLocking\f[R] option must be enabled.
2682 .RS
2683 .RE
2684 .TP
2685 .B \f[CB]\-XX:+UseRTMLocking\f[R]
2686 Generates Restricted Transactional Memory (RTM) locking code for all
2687 inflated locks, with the normal locking mechanism as the fallback
2688 handler.
2689 This option is disabled by default.
2690 Options related to RTM are available only for the Java HotSpot Server VM
2691 on x86 CPUs that support Transactional Synchronization Extensions (TSX).
2692 .RS
2693 .PP
2694 RTM is part of Intel\[aq]s TSX, which is an x86 instruction set
2695 extension and facilitates the creation of multithreaded applications.
2696 RTM introduces the new instructions \f[CB]XBEGIN\f[R], \f[CB]XABORT\f[R],
2697 \f[CB]XEND\f[R], and \f[CB]XTEST\f[R].
2698 The \f[CB]XBEGIN\f[R] and \f[CB]XEND\f[R] instructions enclose a set of
2699 instructions to run as a transaction.
2700 If no conflict is found when running the transaction, then the memory
2701 and register modifications are committed together at the \f[CB]XEND\f[R]
2702 instruction.
2703 The \f[CB]XABORT\f[R] instruction can be used to explicitly abort a
2704 transaction and the \f[CB]XEND\f[R] instruction checks if a set of
2705 instructions is being run in a transaction.
2706 .PP
2707 A lock on a transaction is inflated when another thread tries to access
2708 the same transaction, thereby blocking the thread that didn\[aq]t
2709 originally request access to the transaction.
2710 RTM requires that a fallback set of operations be specified in case a
2711 transaction aborts or fails.


2714 RTM improves performance for highly contended locks with low conflict in
2715 a critical region (which is code that must not be accessed by more than
2716 one thread concurrently).
2717 RTM also improves the performance of coarse\-grain locking, which
2718 typically doesn\[aq]t perform well in multithreaded applications.
2719 (Coarse\-grain locking is the strategy of holding locks for long periods
2720 to minimize the overhead of taking and releasing locks, while
2721 fine\-grained locking is the strategy of trying to achieve maximum
2722 parallelism by locking only when necessary and unlocking as soon as
2723 possible.) Also, for lightly contended locks that are used by different
2724 threads, RTM can reduce false cache line sharing, also known as cache
2725 line ping\-pong.
2726 This occurs when multiple threads from different processors are
2727 accessing different resources, but the resources share the same cache
2728 line.
2729 As a result, the processors repeatedly invalidate the cache lines of
2730 other processors, which forces them to read from main memory instead of
2731 their cache.
2732 .RE
2733 .TP
2734 .B \f[CB]\-XX:+UseSHA\f[R]
2735 Enables hardware\-based intrinsics for SHA crypto hash functions for
2736 SPARC hardware.
2737 The \f[CB]UseSHA\f[R] option is used in conjunction with the
2738 \f[CB]UseSHA1Intrinsics\f[R], \f[CB]UseSHA256Intrinsics\f[R], and
2739 \f[CB]UseSHA512Intrinsics\f[R] options.
2740 .RS
2741 .PP
2742 The \f[CB]UseSHA\f[R] and \f[CB]UseSHA*Intrinsics\f[R] flags are enabled by
2743 default, and are supported only for Java HotSpot Server VM 64\-bit on
2744 SPARC T4 and newer.
2745 .PP
2746 This feature is applicable only when using the
2747 \f[CB]sun.security.provider.Sun\f[R] provider for SHA operations.
2748 Flags that control intrinsics now require the option
2749 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2750 .PP
2751 To disable all hardware\-based SHA intrinsics, specify the
2752 \f[CB]\-XX:\-UseSHA\f[R].
2753 To disable only a particular SHA intrinsic, use the appropriate
2754 corresponding option.
2755 For example: \f[CB]\-XX:\-UseSHA256Intrinsics\f[R].
2756 .RE
2757 .TP
2758 .B \f[CB]\-XX:+UseSHA1Intrinsics\f[R]
2759 Enables intrinsics for SHA\-1 crypto hash function.
2760 Flags that control intrinsics now require the option
2761 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2762 .RS
2763 .RE
2764 .TP
2765 .B \f[CB]\-XX:+UseSHA256Intrinsics\f[R]
2766 Enables intrinsics for SHA\-224 and SHA\-256 crypto hash functions.
2767 Flags that control intrinsics now require the option
2768 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2769 .RS
2770 .RE
2771 .TP
2772 .B \f[CB]\-XX:+UseSHA512Intrinsics\f[R]
2773 Enables intrinsics for SHA\-384 and SHA\-512 crypto hash functions.
2774 Flags that control intrinsics now require the option
2775 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2776 .RS
2777 .RE
2778 .TP
2779 .B \f[CB]\-XX:+UseSuperWord\f[R]
2780 Enables the transformation of scalar operations into superword
2781 operations.
2782 Superword is a vectorization optimization.
2783 This option is enabled by default.
2784 To disable the transformation of scalar operations into superword
2785 operations, specify \f[CB]\-XX:\-UseSuperWord\f[R].
2786 Only the Java HotSpot Server VM supports this option.
2787 .RS
2788 .RE
2789 .SH ADVANCED SERVICEABILITY OPTIONS FOR JAVA
2790 .PP
2791 These \f[CB]java\f[R] options provide the ability to gather system
2792 information and perform extensive debugging.
2793 .TP
2794 .B \f[CB]\-XX:+DisableAttachMechanism\f[R]
2795 Disables the mechanism that lets tools attach to the JVM.
2796 By default, this option is disabled, meaning that the attach mechanism
2797 is enabled and you can use diagnostics and troubleshooting tools such as
2798 \f[CB]jcmd\f[R], \f[CB]jstack\f[R], \f[CB]jmap\f[R], and \f[CB]jinfo\f[R].
2799 .RS
2800 .RS
2801 .PP
2802 \f[B]Note:\f[R] The tools such as \f[B]jcmd\f[R], \f[B]jinfo\f[R],
2803 \f[B]jmap\f[R], and \f[B]jstack\f[R] shipped with the JDK aren\[aq]t
2804 supported when using the tools from one JDK version to troubleshoot a
2805 different JDK version.
2806 .RE


2958 performed by the Java HotSpot VM.
2959 .TP
2960 .B \f[CB]\-XX:+AggressiveHeap\f[R]
2961 Enables Java heap optimization.
2962 This sets various parameters to be optimal for long\-running jobs with
2963 intensive memory allocation, based on the configuration of the computer
2964 (RAM and CPU).
2965 By default, the option is disabled and the heap sizes are configured
2966 less aggressively.
2967 .RS
2968 .RE
2969 .TP
2970 .B \f[CB]\-XX:+AlwaysPreTouch\f[R]
2971 Requests the VM to touch every page on the Java heap after requesting it
2972 from the operating system and before handing memory out to the
2973 application.
2974 By default, this option is disabled and all pages are committed as the
2975 application uses the heap space.
2976 .RS
2977 .RE
2978 .RE
2979 .TP
2980 .B \f[CB]\-XX:ConcGCThreads=\f[R]\f[I]threads\f[R]
2981 Sets the number of threads used for concurrent GC.
2982 Sets \f[I]\f[CI]threads\f[I]\f[R] to approximately 1/4 of the number of
2983 parallel garbage collection threads.
2984 The default value depends on the number of CPUs available to the JVM.
2985 .RS
2986 .PP
2987 For example, to set the number of threads for concurrent GC to 2,
2988 specify the following option:
2989 .RS
2990 .PP
2991 \f[CB]\-XX:ConcGCThreads=2\f[R]
2992 .RE
2993 .RE
2994 .TP
2995 .B \f[CB]\-XX:+DisableExplicitGC\f[R]
2996 Enables the option that disables processing of calls to the
2997 \f[CB]System.gc()\f[R] method.
2998 This option is disabled by default, meaning that calls to


3690 nonuniform memory architecture (NUMA) by increasing the
3691 application\[aq]s use of lower latency memory.
3692 By default, this option is disabled and no optimization for NUMA is
3693 made.
3694 The option is available only when the parallel garbage collector is used
3695 (\f[CB]\-XX:+UseParallelGC\f[R]).
3696 .RS
3697 .RE
3698 .TP
3699 .B \f[CB]\-XX:+UseParallelGC\f[R]
3700 Enables the use of the parallel scavenge garbage collector (also known
3701 as the throughput collector) to improve the performance of your
3702 application by leveraging multiple processors.
3703 .RS
3704 .PP
3705 By default, this option is disabled and the default collector is used.
3706 If it\[aq]s enabled, then the \f[CB]\-XX:+UseParallelOldGC\f[R] option is
3707 automatically enabled, unless you explicitly disable it.
3708 .RE
3709 .TP
3710 .B \f[CB]\-XX:+UseParallelOldGC\f[R]
3711 Enables the use of the parallel garbage collector for full GCs.
3712 By default, this option is disabled.
3713 Enabling it automatically enables the \f[CB]\-XX:+UseParallelGC\f[R]
3714 option.
3715 .RS
3716 .RE
3717 .TP
3718 .B \f[CB]\-XX:+UseSerialGC\f[R]
3719 Enables the use of the serial garbage collector.
3720 This is generally the best choice for small and simple applications that
3721 don\[aq]t require any special functionality from garbage collection.
3722 By default, this option is disabled and the default collector is used.
3723 .RS
3724 .RE
3725 .TP
3726 .B \f[CB]\-XX:+UseSHM\f[R]
3727 \f[B]Linux only:\f[R] Enables the JVM to use shared memory to set up
3728 large pages.
3729 .RS
3730 .PP
3731 See \f[B]Large Pages\f[R] for setting up large pages.
3732 .RE
3733 .TP
3734 .B \f[CB]\-XX:+UseStringDeduplication\f[R]
3735 Enables string deduplication.
3736 By default, this option is disabled.
3737 To use this option, you must enable the garbage\-first (G1) garbage


3782 Developers should use this flag when developing new code.
3783 Stricter checks may become the default in future releases.
3784 .RS
3785 .RE
3786 .TP
3787 .B \f[CB]\-Xloggc:\f[R]\f[I]filename\f[R]
3788 Sets the file to which verbose GC events information should be
3789 redirected for logging.
3790 The \f[CB]\-Xloggc\f[R] option overrides \f[CB]\-verbose:gc\f[R] if both are
3791 given with the same java command.
3792 \f[CB]\-Xloggc:\f[R]\f[I]filename\f[R] is replaced by
3793 \f[CB]\-Xlog:gc:\f[R]\f[I]filename\f[R].
3794 See Enable Logging with the JVM Unified Logging Framework.
3795 .RS
3796 .PP
3797 Example:
3798 .PP
3799 \f[CB]\-Xlog:gc:garbage\-collection.log\f[R]
3800 .RE
3801 .TP
3802 .B \f[CB]\-XX:+FailOverToOldVerifier\f[R]
3803 Enables automatic failover to the old verifier when the new type checker
3804 fails.
3805 By default, this option is disabled and it\[aq]s ignored (that is,
3806 treated as disabled) for classes with a recent bytecode version.
3807 You can enable it only for classes with older versions of the bytecode.
3808 .RS
3809 .RE
3810 .TP
3811 .B \f[CB]\-XX:+FlightRecorder\f[R]
3812 Enables the use of Java Flight Recorder (JFR) during the runtime of the
3813 application.
3814 Since JDK 8u40 this option has not been required to use JFR.
3815 .RS
3816 .RE
3817 .TP
3818 .B \f[CB]\-XX:InitialRAMFraction=\f[R]\f[I]ratio\f[R]
3819 Sets the initial amount of memory that the JVM may use for the Java heap
3820 before applying ergonomics heuristics as a ratio of the maximum amount
3821 determined as described in the \f[CB]\-XX:MaxRAM\f[R] option.
3822 The default value is 64.
3823 .RS
3824 .PP
3825 Use the option \f[CB]\-XX:InitialRAMPercentage\f[R] instead.
3826 .RE
3827 .TP
3828 .B \f[CB]\-XX:MaxRAMFraction=\f[R]\f[I]ratio\f[R]
3829 Sets the maximum amount of memory that the JVM may use for the Java heap
3830 before applying ergonomics heuristics as a fraction of the maximum


3885 By default, this option is disabled and constant pool resolutions
3886 aren\[aq]t traced.
3887 .RS
3888 .PP
3889 The replacement Unified Logging syntax is
3890 \f[CB]\-Xlog:class+resolve=debug\f[R].
3891 See \f[B]Enable Logging with the JVM Unified Logging Framework\f[R].
3892 .RE
3893 .TP
3894 .B \f[CB]\-XX:+TraceLoaderConstraints\f[R]
3895 Enables tracing of the loader constraints recording.
3896 By default, this option is disabled and loader constraints recording
3897 isn\[aq]t traced.
3898 .RS
3899 .PP
3900 The replacement Unified Logging syntax is
3901 \f[CB]\-Xlog:class+loader+constraints=info\f[R].
3902 See \f[B]Enable Logging with the JVM Unified Logging Framework\f[R].
3903 .RE
3904 .TP





















3905 .B \f[CB]\-XX:+UseMembar\f[R]
3906 Enabled issuing membars on thread\-state transitions.
3907 This option was disabled by default on all platforms except ARM servers,
3908 where it was enabled.
3909 .RS
3910 .RE
3911 .TP
3912 .B \f[CB]\-XX:MaxPermSize=\f[R]\f[I]size\f[R]
3913 Sets the maximum permanent generation space size (in bytes).
3914 This option was deprecated in JDK 8 and superseded by the
3915 \f[CB]\-XX:MaxMetaspaceSize\f[R] option.
3916 .RS
3917 .RE
3918 .TP
3919 .B \f[CB]\-XX:PermSize=\f[R]\f[I]size\f[R]
3920 Sets the space (in bytes) allocated to the permanent generation that
3921 triggers a garbage collection if it\[aq]s exceeded.
3922 This option was deprecated in JDK 8 and superseded by the
3923 \f[CB]\-XX:MetaspaceSize\f[R] option.
3924 .RS
3925 .RE
3926 .SH REMOVED JAVA OPTIONS
3927 .PP
3928 These \f[CB]java\f[R] options have been removed in JDK 13 and using them
3929 results in an error of:
3930 .RS
3931 .PP
3932 \f[CB]Unrecognized\ VM\ option\f[R] \f[I]option\-name\f[R]
3933 .RE
3934 .TP
3935 .B \f[CB]\-XX:+AggressiveOpts\f[R]
3936 Enabled the use of aggressive performance optimization features.
3937 By default, this option was disabled and experimental performance
3938 features were not used.
3939 .RS
3940 .RE
3941 .PP
3942 For the lists and descriptions of options removed in previous releases
3943 see the \f[I]Removed Java Options\f[R] section in:
3944 .IP \[bu] 2



3945 \f[B]Java Platform, Standard Edition Tools Reference, Release 12\f[R]
3946 [https://docs.oracle.com/en/java/javase/12/tools/java.html#GUID\-3B1CE181\-CD30\-4178\-9602\-230B800D4FAE]
3947 .IP \[bu] 2
3948 \f[B]Java Platform, Standard Edition Tools Reference, Release 11\f[R]
3949 [https://docs.oracle.com/en/java/javase/11/tools/java.html#GUID\-741FC470\-AA3E\-494A\-8D2B\-1B1FE4A990D1]
3950 .IP \[bu] 2
3951 \f[B]Java Platform, Standard Edition Tools Reference, Release 10\f[R]
3952 [https://docs.oracle.com/javase/10/tools/java.htm#JSWOR624]
3953 .IP \[bu] 2
3954 \f[B]Java Platform, Standard Edition Tools Reference, Release 9\f[R]
3955 [https://docs.oracle.com/javase/9/tools/java.htm#JSWOR624]
3956 .IP \[bu] 2
3957 \f[B]Java Platform, Standard Edition Tools Reference, Release 8 for
3958 Oracle JDK on Windows\f[R]
3959 [https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html#BGBCIEFC]
3960 .IP \[bu] 2
3961 \f[B]Java Platform, Standard Edition Tools Reference, Release 8 for
3962 Oracle JDK on Solaris, Linux, and macOS\f[R]
3963 [https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html#BGBCIEFC]
3964 .SH JAVA COMMAND\-LINE ARGUMENT FILES


3995 Use white space or new line characters to separate arguments included in
3996 the file.
3997 .IP \[bu] 2
3998 White space includes a white space character, \f[CB]\\t\f[R],
3999 \f[CB]\\n\f[R], \f[CB]\\r\f[R], and \f[CB]\\f\f[R].
4000 .RS 2
4001 .PP
4002 For example, it is possible to have a path with a space, such as
4003 \f[CB]c:\\Program\ Files\f[R] that can be specified as either
4004 \f[CB]"c:\\\\Program\ Files"\f[R] or, to avoid an escape,
4005 \f[CB]c:\\Program"\ "Files\f[R].
4006 .RE
4007 .IP \[bu] 2
4008 Any option that contains spaces, such as a path component, must be
4009 within quotation marks using quotation (\[aq]"\[aq]) characters in its
4010 entirety.
4011 .IP \[bu] 2
4012 A string within quotation marks may contain the characters \f[CB]\\n\f[R],
4013 \f[CB]\\r\f[R], \f[CB]\\t\f[R], and \f[CB]\\f\f[R].
4014 They are converted to their respective ASCII codes.
4015 \ 
4016 .IP \[bu] 2
4017 If a file name contains embedded spaces, then put the whole file name in
4018 double quotation marks.
4019 .IP \[bu] 2
4020 File names in an argument file are relative to the current directory,
4021 not to the location of the argument file.
4022 .IP \[bu] 2
4023 Use the number sign \f[CB]#\f[R] in the argument file to identify
4024 comments.
4025 All characters following the \f[CB]#\f[R] are ignored until the end of
4026 line.
4027 .IP \[bu] 2
4028 Additional at sign \f[CB]\@\f[R] prefixes to \f[CB]\@\f[R] prefixed options
4029 act as an escape, (the first \f[CB]\@\f[R] is removed and the rest of the
4030 arguments are presented to the launcher literally).
4031 .IP \[bu] 2
4032 Lines may be continued using the continuation character (\f[CB]\\\f[R]) at
4033 the end\-of\-line.
4034 The two lines are concatenated with the leading white spaces trimmed.
4035 To prevent trimming the \ leading white spaces, a continuation character
4036 (\f[CB]\\\f[R]) may be placed at the first column.
4037 .IP \[bu] 2
4038 Because backslash (\\) is an escape character, a backslash
4039 character\ must be escaped with another backslash character.
4040 .IP \[bu] 2
4041 Partial quote is allowed and is closed by an end\-of\-file.
4042 .IP \[bu] 2
4043 An open quote stops at end\-of\-line unless \f[CB]\\\f[R] is the last
4044 character, which then joins the next line by removing all leading white
4045 space characters.
4046 .IP \[bu] 2
4047 Wildcards (*) aren\[aq]t allowed in these lists (such as specifying
4048 \f[CB]*.java\f[R]).
4049 .IP \[bu] 2
4050 Use of the at sign (\f[CB]\@\f[R]) to recursively interpret files
4051 isn\[aq]t supported.
4052 .SS Example of Open or Partial Quotes in an Argument File
4053 .PP
4054 In the argument file,
4055 .IP
4056 .nf
4057 \f[CB]
4058 \-cp\ "lib/
4059 cool/
4060 app/
4061 jars
4062 \f[R]
4063 .fi
4064 .PP
4065 this is interpreted as:
4066 .RS
4067 .PP
4068 \f[CB]\-cp\ lib/cool/app/jars\f[R]
4069 .RE
4070 .SS Example of a Backslash Character\ Escaped with Another Backslash
4071 Character in an Argument File
4072 .PP
4073 To output the following:
4074 .RS
4075 .PP
4076 \f[CB]\-cp\ c:\\Program\ Files\ (x86)\\Java\\jre\\lib\\ext;c:\\Program\ Files\\Java\\jre9\\lib\\ext\f[R]
4077 .RE
4078 .PP
4079 The backslash character must be specified in the argument file as:
4080 .RS
4081 .PP
4082 \f[CB]\-cp\ \ "c:\\\\Program\ Files\ (x86)\\\\Java\\\\jre\\\\lib\\\\ext;c:\\\\Program\ Files\\\\Java\\\\jre9\\\\lib\\\\ext"\f[R]
4083 .RE
4084 .SS Example of an EOL Escape Used to Force Concatenation of Lines in an
4085 Argument File
4086 .PP
4087 In the argument file,
4088 .IP
4089 .nf
4090 \f[CB]
4091 \-cp\ "/lib/cool\ app/jars:\\
4092 \ \ \ \ /lib/another\ app/jars"
4093 \f[R]
4094 .fi
4095 .PP
4096 This is interpreted as:
4097 .RS
4098 .PP
4099 \f[CB]\-cp\ /lib/cool\ app/jars:/lib/another\ app/jars\f[R]
4100 .RE
4101 .SS Example of Line Continuation with Leading Spaces in an Argument File
4102 .PP
4103 In the argument file,
4104 .IP
4105 .nf
4106 \f[CB]
4107 \-cp\ "/lib/cool\\
4108 \\app/jars”
4109 \f[R]
4110 .fi
4111 .PP
4112 This is interpreted as:
4113 .PP
4114 \f[CB]\-cp\ /lib/cool\ app/jars\f[R]
4115 .SS Examples of Using Single Argument File
4116 .PP
4117 You can use a single argument file, such as \f[CB]myargumentfile\f[R] in
4118 the following example, to hold all required \f[CB]java\f[R] arguments:
4119 .RS
4120 .PP
4121 \f[CB]java\ \@myargumentfile\f[R]
4122 .RE
4123 .SS Examples of Using Argument Files with Paths
4124 .PP
4125 You can include relative paths in argument files; however, they\[aq]re
4126 relative to the current working directory and not to the paths of the
4127 argument files themselves.
4128 In the following example, \f[CB]path1/options\f[R] and


4877 out\-of\-range, then an appropriate error message is displayed.
4878 .PP
4879 Whether they\[aq]re set ergonomically, in a command line, by an input
4880 tool, or through the APIs (for example, classes contained in the package
4881 \f[CB]java.lang.management\f[R]) the values provided to all Java Virtual
4882 Machine (JVM) command\-line flags are validated.
4883 Ergonomics are described in Java Platform, Standard Edition HotSpot
4884 Virtual Machine Garbage Collection Tuning Guide.
4885 .PP
4886 Range and constraints are validated either when all flags have their
4887 values set during JVM initialization or a flag\[aq]s value is changed
4888 during runtime (for example using the \f[CB]jcmd\f[R] tool).
4889 The JVM is terminated if a value violates either the range or constraint
4890 check and an appropriate error message is printed on the error stream.
4891 .PP
4892 For example, if a flag violates a range or a constraint check, then the
4893 JVM exits with an error:
4894 .IP
4895 .nf
4896 \f[CB]
4897 java\ \-XX:AllocatePrefetchStyle=5\ \-version\ \ \ 
4898 intx\ AllocatePrefetchStyle=5\ is\ outside\ the\ allowed\ range\ [\ 0\ ...\ 3\ ]\ \ \ 
4899 Improperly\ specified\ VM\ option\ \[aq]AllocatePrefetchStyle=5\[aq]\ \ \ 
4900 Error:\ Could\ not\ create\ the\ Java\ Virtual\ Machine.\ \ 
4901 Error:\ A\ fatal\ exception\ has\ occurred.\ Program\ will\ exit.
4902 \f[R]
4903 .fi
4904 .PP
4905 The flag \f[CB]\-XX:+PrintFlagsRanges\f[R] prints the range of all the
4906 flags.
4907 This flag allows automatic testing of the flags by the values provided
4908 by the ranges.
4909 For the flags that have the ranges specified, the type, name, and the
4910 actual range is printed in the output.
4911 .PP
4912 For example,
4913 .IP
4914 .nf
4915 \f[CB]
4916 intx\ \ \ ThreadStackSize\ [\ 0\ ...\ 9007199254740987\ ]\ {pd\ product}
4917 \f[R]
4918 .fi
4919 .PP
4920 For the flags that don\[aq]t have the range specified, the values


5554 archive:
5555 .RS 4
5556 .RS
5557 .PP
5558 \f[CB]java\ \-XX:SharedArchiveFile=common.jsa\ \-cp\ common.jar:hello.jar:hi.jar\ Hello\f[R]
5559 .RE
5560 .RS
5561 .PP
5562 \f[CB]java\ \-XX:SharedArchiveFile=common.jsa\ \-cp\ common.jar:hello.jar:hi.jar\ Hi\f[R]
5563 .RE
5564 .RE
5565 .SS Specifying Additional Shared Data Added to an Archive File
5566 .PP
5567 The \f[CB]SharedArchiveConfigFile\f[R] option is used to specify
5568 additional shared data to add to the archive file.
5569 .RS
5570 .PP
5571 \f[CB]\-XX:SharedArchiveConfigFile=\f[R]\f[I]shared_config_file\f[R]
5572 .RE
5573 .PP
5574 JDK 9 and later supports adding both symbols and\ string objects to an
5575 archive for memory sharing\ when you have multiple JVM processes running
5576 on the same host.
5577 An example of this is having multiple JVM processes that use the same
5578 set of Java EE classes.
5579 When these common classes are loaded and used, new symbols and strings
5580 may be created and added to the JVM\[aq]s internal "symbol" and "string"
5581 tables.\ At runtime, the symbols or string objects mapped from the
5582 archive file can be shared across multiple JVM processes, resulting in a
5583 reduction of overall memory usage.\ In addition, archiving strings also
5584 provides added performance benefits in both startup time and runtime
5585 execution.

5586 .PP
5587 In JDK 10 and later, CONSTANT_String entries in archived classes are
5588 resolved to interned String objects at dump time, and all interned
5589 String objects are archived.
5590 However, even though all CONSTANT_String literals in all archived
5591 classes are resolved, it might still beneficial to add additional
5592 strings that are not string literals in class files, but are likely to
5593 be used by your application at run time.
5594 .PP
5595 Symbol data should be generated by the \f[CB]jcmd\f[R] tool attaching to a
5596 running JVM process.
5597 See \f[B]jcmd\f[R].
5598 .PP
5599 The following is an example of the symbol dumping command in
5600 \f[CB]jcmd\f[R]:\ 
5601 .RS
5602 .PP
5603 \f[CB]jcmd\f[R] \f[I]pid\f[R] \f[CB]VM.symboltable\ \-verbose\f[R]
5604 .RE
5605 .RS
5606 .PP
5607 \f[B]Note:\f[R] The first line (process ID) and the second line
5608 (\f[CB]\@VERSION\ ...\f[R]) of this \f[CB]jcmd\f[R] output should be
5609 excluded from the configuration file.
5610 .RE
5611 .SS Example of a Configuration File
5612 .PP
5613 The following is an example of a configuration file:
5614 .IP
5615 .nf
5616 \f[CB]
5617 VERSION:\ 1.0
5618 \@SECTION:\ Symbol
5619 10\ \-1:\ linkMethod
5620 \f[R]




   5 .\" This code is free software; you can redistribute it and/or modify it
   6 .\" under the terms of the GNU General Public License version 2 only, as
   7 .\" published by the Free Software Foundation.
   8 .\"
   9 .\" This code is distributed in the hope that it will be useful, but WITHOUT
  10 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11 .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  12 .\" version 2 for more details (a copy is included in the LICENSE file that
  13 .\" accompanied this code).
  14 .\"
  15 .\" You should have received a copy of the GNU General Public License version
  16 .\" 2 along with this work; if not, write to the Free Software Foundation,
  17 .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 .\"
  19 .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 .\" or visit www.oracle.com if you need additional information or have any
  21 .\" questions.
  22 .\"
  23 .\" Automatically generated by Pandoc 2.3.1
  24 .\"
  25 .TH "JAVA" "1" "2020" "JDK 14" "JDK Commands"
  26 .hy
  27 .SH NAME
  28 .PP
  29 java \- launch a Java application
  30 .SH SYNOPSIS
  31 .PP
  32 To launch a class file:
  33 .PP
  34 \f[CB]java\f[R] [\f[I]options\f[R]] \f[I]mainclass\f[R] [\f[I]args\f[R] ...]
  35 .PP
  36 To launch the main class in a JAR file:
  37 .PP
  38 \f[CB]java\f[R] [\f[I]options\f[R]] \f[CB]\-jar\f[R] \f[I]jarfile\f[R]
  39 [\f[I]args\f[R] ...]
  40 .PP
  41 To launch the main class in a module:
  42 .PP
  43 \f[CB]java\f[R] [\f[I]options\f[R]] \f[CB]\-m\f[R]
  44 \f[I]module\f[R][\f[CB]/\f[R]\f[I]mainclass\f[R]] [\f[I]args\f[R] ...]
  45 .PP


 164 main class name.
 165 .IP \[bu] 2
 166 The \f[CB]\-\-source\f[R] \f[I]version\f[R] option, if present.
 167 .PP
 168 If the class identifies an existing file that has a \f[CB]\&.java\f[R]
 169 extension, or if the \f[CB]\-\-source\f[R] option is specified, then
 170 source\-file mode is selected.
 171 The source file is then compiled and run.
 172 The \f[CB]\-\-source\f[R] option can be used to specify the source
 173 \f[I]version\f[R] or \f[I]N\f[R] of the source code.
 174 This determines the API that can be used.
 175 When you set \f[CB]\-\-source\f[R] \f[I]N\f[R], you can only use the public
 176 API that was defined in JDK \f[I]N\f[R].
 177 .RS
 178 .PP
 179 \f[B]Note:\f[R] The valid values of \f[I]N\f[R] change for each release,
 180 with new values added and old values removed.
 181 You\[aq]ll get an error message if you use a value of \f[I]N\f[R] that is
 182 no longer supported.
 183 Supported values of \f[I]N\f[R] for this release are \f[CB]7\f[R],
 184 \f[CB]8\f[R], \f[CB]9\f[R], \f[CB]10\f[R], \f[CB]11\f[R], \f[CB]12\f[R],
 185 \f[CB]13\f[R], and \f[CB]14\f[R].
 186 .RE
 187 .PP
 188 If the file does not have the \f[CB]\&.java\f[R] extension, the
 189 \f[CB]\-\-source\f[R] option must be used to tell the \f[CB]java\f[R]
 190 command to use the source\-file mode.
 191 The \f[CB]\-\-source\f[R] option is used for cases when the source file is
 192 a "script" to be executed and the name of the source file does not
 193 follow the normal naming conventions for Java source files.
 194 .PP
 195 In source\-file mode, the effect is as though the source file is
 196 compiled into memory, and the first class found in the source file is
 197 executed.
 198 Any arguments placed after the name of the source file in the original
 199 command line are passed to the compiled class when it is executed.
 200 .PP
 201 For example, if a file were named \f[CB]HelloWorld.java\f[R] and contained
 202 a class named \f[CB]hello.World\f[R], then the source\-file mode command
 203 to launch the class would be:
 204 .RS
 205 .PP


 250 environment are taken into account.
 251 .IP \[bu] 2
 252 No other source files are found and compiled, as if the source path is
 253 set to an empty value.
 254 .IP \[bu] 2
 255 Annotation processing is disabled, as if \f[CB]\-proc:none\f[R] is in
 256 effect.
 257 .IP \[bu] 2
 258 If a version is specified, via the \f[CB]\-\-source\f[R] option, the value
 259 is used as the argument for an implicit \f[CB]\-\-release\f[R] option for
 260 the compilation.
 261 This sets both the source version accepted by compiler and the system
 262 API that may be used by the code in the source file.
 263 .IP \[bu] 2
 264 The source file is compiled in the context of an unnamed module.
 265 .IP \[bu] 2
 266 The source file should contain one or more top\-level classes, the first
 267 of which is taken as the class to be executed.
 268 .IP \[bu] 2
 269 The compiler does not enforce the optional restriction defined at the
 270 end of JLS ??7.6, that a type in a named package should exist in a file
 271 whose name is composed from the type name followed by the
 272 \f[CB]\&.java\f[R] extension.
 273 .IP \[bu] 2
 274 If the source file contains errors, appropriate error messages are
 275 written to the standard error stream, and the launcher exits with a
 276 non\-zero exit code.
 277 .PP
 278 \f[B]In source\-file mode, execution proceeds as follows:\f[R]
 279 .IP \[bu] 2
 280 The class to be executed is the first top\-level class found in the
 281 source file.
 282 It must contain a declaration of the standard
 283 \f[CB]public\ static\ void\ main(String[])\f[R] method.
 284 .IP \[bu] 2
 285 The compiled classes are loaded by a custom class loader, that delegates
 286 to the application class loader.
 287 This implies that classes appearing on the application class path cannot
 288 refer to any classes declared in the source file.
 289 .IP \[bu] 2
 290 The compiled classes are executed in the context of an unnamed module,


 298 It is an error if there is a class on the application class path whose
 299 name is the same as that of the class to be executed.
 300 .PP
 301 See \f[B]JEP 330: Launch Single\-File Source\-Code Programs\f[R]
 302 [http://openjdk.java.net/jeps/330] for complete details.
 303 .SH USING THE JDK_JAVA_OPTIONS LAUNCHER ENVIRONMENT VARIABLE
 304 .PP
 305 \f[CB]JDK_JAVA_OPTIONS\f[R] prepends its content to the options parsed
 306 from the command line.
 307 The content of the \f[CB]JDK_JAVA_OPTIONS\f[R] environment variable is a
 308 list of arguments separated by white\-space characters (as determined by
 309 \f[CB]isspace()\f[R]).
 310 These are prepended to the command line arguments passed to
 311 \f[CB]java\f[R] launcher.
 312 The encoding requirement for the environment variable is the same as the
 313 \f[CB]java\f[R] command line on the system.
 314 \f[CB]JDK_JAVA_OPTIONS\f[R] environment variable content is treated in the
 315 same manner as that specified in the command line.
 316 .PP
 317 Single (\f[CB]\[aq]\f[R]) or double (\f[CB]"\f[R]) quotes can be used to
 318 enclose arguments that contain whitespace characters.
 319 All content between the open quote and the first matching close quote
 320 are preserved by simply removing the pair of quotes.
 321 In case a matching quote is not found, the launcher will abort with an
 322 error message.
 323 \f[CB]\@\f[R]\-files are supported as they are specified in the command
 324 line.
 325 However, as in \f[CB]\@\f[R]\-files, use of a wildcard is not supported.
 326 In order to mitigate potential misuse of \f[CB]JDK_JAVA_OPTIONS\f[R]
 327 behavior, options that specify the main class (such as \f[CB]\-jar\f[R])
 328 or cause the \f[CB]java\f[R] launcher to exit without executing the main
 329 class (such as \f[CB]\-h\f[R]) are disallowed in the environment variable.
 330 If any of these options appear in the environment variable, the launcher
 331 will abort with an error message.
 332 When \f[CB]JDK_JAVA_OPTIONS\f[R] is set, the launcher prints a message to
 333 stderr as a reminder.
 334 .PP
 335 \f[B]Example:\f[R]
 336 .IP
 337 .nf
 338 \f[CB]


 785 .RS
 786 .PP
 787 \f[B]Oracle Solaris, Linux, and macOS:\f[R] Colons (\f[CB]:\f[R]) separate
 788 entities in this list.
 789 .PP
 790 \f[B]Windows:\f[R] Semicolons (\f[CB];\f[R]) separate entities in this
 791 list.
 792 .RE
 793 .TP
 794 .B \f[CB]\-Xcheck:jni\f[R]
 795 Performs additional checks for Java Native Interface (JNI) functions.
 796 Specifically, it validates the parameters passed to the JNI function and
 797 the runtime environment data before processing the JNI request.
 798 It also checks for pending exceptions between JNI calls.
 799 Any invalid data encountered indicates a problem in the native code, and
 800 the JVM terminates with an irrecoverable error in such cases.
 801 Expect a performance degradation when this option is used.
 802 .RS
 803 .RE
 804 .TP














 805 .B \f[CB]\-Xdebug\f[R]
 806 Does nothing.
 807 Provided for backward compatibility.
 808 .RS
 809 .RE
 810 .TP
 811 .B \f[CB]\-Xdiag\f[R]
 812 Shows additional diagnostic messages.
 813 .RS
 814 .RE
 815 .TP
 816 .B \f[CB]\-Xint\f[R]
 817 Runs the application in interpreted\-only mode.
 818 Compilation to native code is disabled, and all bytecode is executed by
 819 the interpreter.
 820 The performance benefits offered by the just\-in\-time (JIT) compiler
 821 aren\[aq]t present in this mode.
 822 .RS
 823 .RE
 824 .TP
 825 .B \f[CB]\-Xinternalversion\f[R]
 826 Displays more detailed JVM version information than the
 827 \f[CB]\-version\f[R] option, and then exits.
 828 .RS
 829 .RE
 830 .TP
 831 .B \f[CB]\-Xlog:\f[R]\f[I]option\f[R]
 832 Configure or enable logging with the Java Virtual Machine (JVM) unified
 833 logging framework.
 834 See \f[B]Enable Logging with the JVM Unified Logging Framework\f[R].
 835 .RS
 836 .RE
 837 .TP
 838 .B \f[CB]\-Xmixed\f[R]
 839 Executes all bytecode by the interpreter except for hot methods, which
 840 are compiled to native code.
 841 On by default.
 842 Use \f[CB]\-Xint\f[R] to switch off.
 843 .RS
 844 .RE
 845 .TP
 846 .B \f[CB]\-Xmn\f[R] \f[I]size\f[R]
 847 Sets the initial and maximum size (in bytes) of the heap for the young
 848 generation (nursery) in the generational collectors.
 849 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
 850 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
 851 \f[CB]G\f[R] to indicate gigabytes.
 852 The young generation region of the heap is used for new objects.
 853 GC is performed in this region more often than in other regions.
 854 If the size for the young generation is too small, then a lot of minor
 855 garbage collections are performed.
 856 If the size is too large, then only full garbage collections are
 857 performed, which can take a long time to complete.
 858 It is recommended that you do not set the size for the young generation
 859 for the G1 collector, and keep the size for the young generation greater
 860 than 25% and less than 50% of the overall heap size for other
 861 collectors.
 862 The following examples show how to set the initial and maximum size of


1614 marks.
1615 For an example of a command string, see the description of the
1616 \f[CB]\-XX:OnError\f[R] option.
1617 .RS
1618 .RE
1619 .TP
1620 .B \f[CB]\-XX:+PrintCommandLineFlags\f[R]
1621 Enables printing of ergonomically selected JVM flags that appeared on
1622 the command line.
1623 It can be useful to know the ergonomic values set by the JVM, such as
1624 the heap space size and the selected garbage collector.
1625 By default, this option is disabled and flags aren\[aq]t printed.
1626 .RS
1627 .RE
1628 .TP
1629 .B \f[CB]\-XX:+PreserveFramePointer\f[R]
1630 Selects between using the RBP register as a general purpose register
1631 (\f[CB]\-XX:\-PreserveFramePointer\f[R]) and using the RBP register to
1632 hold the frame pointer of the currently executing method
1633 (\f[CB]\-XX:+PreserveFramePointer\f[R] .
1634 If the frame pointer is available, then external profiling tools (for
1635 example, Linux perf) can construct more accurate stack traces.
1636 .RS
1637 .RE
1638 .TP
1639 .B \f[CB]\-XX:+PrintNMTStatistics\f[R]
1640 Enables printing of collected native memory tracking data at JVM exit
1641 when native memory tracking is enabled (see
1642 \f[CB]\-XX:NativeMemoryTracking\f[R]).
1643 By default, this option is disabled and native memory tracking data
1644 isn\[aq]t printed.
1645 .RS
1646 .RE
1647 .TP
1648 .B \f[CB]\-XX:SharedArchiveFile=\f[R]\f[I]path\f[R]
1649 Specifies the path and name of the class data sharing (CDS) archive file
1650 .RS
1651 .PP
1652 See \f[B]Application Class Data Sharing\f[R].
1653 .RE
1654 .TP


1665 For example, to specify the classes \f[CB]java.lang.Object\f[R] and
1666 \f[CB]hello.Main\f[R], create a text file that contains the following two
1667 lines:
1668 .RS
1669 .IP
1670 .nf
1671 \f[CB]
1672 java/lang/Object
1673 hello/Main
1674 \f[R]
1675 .fi
1676 .PP
1677 The classes that you specify in this text file should include the
1678 classes that are commonly used by the application.
1679 They may include any classes from the application, extension, or
1680 bootstrap class paths.
1681 .PP
1682 See \f[B]Application Class Data Sharing\f[R].
1683 .RE
1684 .TP
1685 .B \f[CB]\-XX:+ShowCodeDetailsInExceptionMessages\f[R]
1686 Enables printing of improved \f[CB]NullPointerException\f[R] messages.
1687 When an application throws a \f[CB]NullPointerException\f[R], the option
1688 enables the JVM to analyze the program\[aq]s bytecode instructions to
1689 determine precisely which reference is \f[CB]null\f[R], and describes the
1690 source with a null\-detail message.
1691 The null\-detail message is calculated and returned by
1692 \f[CB]NullPointerException.getMessage()\f[R], and will be printed as the
1693 exception message along with the method, filename, and line number.
1694 By default, this option is disabled.
1695 .RS
1696 .RE
1697 .TP
1698 .B \f[CB]\-XX:+ShowMessageBoxOnError\f[R]
1699 Enables the display of a dialog box when the JVM experiences an
1700 irrecoverable error.
1701 This prevents the JVM from exiting and keeps the process active so that
1702 you can attach a debugger to it to investigate the cause of the error.
1703 By default, this option is disabled.
1704 .RS
1705 .RE
1706 .TP
1707 .B \f[CB]\-XX:StartFlightRecording=\f[R]\f[I]parameter\f[R]\f[CB]=\f[R]\f[I]value\f[R]
1708 Starts a JFR recording for the Java application.
1709 This option is equivalent to the \f[CB]JFR.start\f[R] diagnostic command
1710 that starts a recording during runtime.
1711 You can set the following \f[I]parameter\f[R]\f[CB]=\f[R]\f[I]value\f[R]
1712 entries when starting a JFR recording:
1713 .RS
1714 .TP
1715 .B \f[CB]delay=\f[R]\f[I]time\f[R]
1716 Specifies the delay between the Java application launch time and the
1717 start of the recording.


1814 This default settings file collects a predefined set of information with
1815 low overhead, so it has minimal impact on performance and can be used
1816 with recordings that run continuously.
1817 .RS
1818 .PP
1819 A second settings file is also provided, profile.jfc, which provides
1820 more data than the default configuration, but can have more overhead and
1821 impact performance.
1822 Use this configuration for short periods of time when more information
1823 is needed.
1824 .RE
1825 .PP
1826 You can specify values for multiple parameters by separating them with a
1827 comma.
1828 .RE
1829 .TP
1830 .B \f[CB]\-XX:ThreadStackSize=\f[R]\f[I]size\f[R]
1831 Sets the Java thread stack size (in kilobytes).
1832 Use of a scaling suffix, such as \f[CB]k\f[R], results in the scaling of
1833 the kilobytes value so that \f[CB]\-XX:ThreadStackSize=1k\f[R] sets the
1834 Java thread stack size to 1024*1024 bytes or 1 megabyte.
1835 The default value depends on the platform:
1836 .RS
1837 .IP \[bu] 2
1838 Linux/x64 (64\-bit): 1024 KB
1839 .IP \[bu] 2
1840 macOS (64\-bit): 1024 KB
1841 .IP \[bu] 2
1842 Oracle Solaris (64\-bit): 1024 KB
1843 .IP \[bu] 2
1844 Windows: The default value depends on virtual memory
1845 .PP
1846 The following examples show how to set the thread stack size to 1
1847 megabyte in different units:
1848 .IP
1849 .nf
1850 \f[CB]
1851 \-XX:ThreadStackSize=1k
1852 \-XX:ThreadStackSize=1024
1853 \f[R]
1854 .fi


1876 By default this range is 32 GB.
1877 .RS
1878 .PP
1879 With compressed oops enabled, object references are represented as
1880 32\-bit offsets instead of 64\-bit pointers, which typically increases
1881 performance when running the application with Java heap sizes smaller
1882 than the compressed oops pointer range.
1883 This option works only for 64\-bit JVMs.
1884 .PP
1885 It\[aq]s possible to use compressed pointers with Java heap sizes
1886 greater than 32 GB.
1887 See the \f[CB]\-XX:ObjectAlignmentInBytes\f[R] option.
1888 .RE
1889 .TP
1890 .B \f[CB]\-XX:\-UseContainerSupport\f[R]
1891 The VM now provides automatic container detection support, which allows
1892 the VM to determine the amount of memory and number of processors that
1893 are available to a Java process running in docker containers.
1894 It uses this information to allocate system resources.
1895 This support is only available on Linux x64 platforms.
1896 If supported, the default for this flag is \f[CB]true\f[R], and container
1897 support is enabled by default.
1898 It can be disabled with \f[CB]\-XX:\-UseContainerSupport\f[R].
1899 .RS
1900 .PP
1901 Unified Logging is available to help to diagnose issues related to this
1902 support.
1903 .PP
1904 Use \f[CB]\-Xlog:os+container=trace\f[R] for maximum logging of container
1905 information.
1906 See \f[B]Enable Logging with the JVM Unified Logging Framework\f[R] for a
1907 description of using Unified Logging.
1908 .RE
1909 .TP
1910 .B \f[CB]\-XX:+UseHugeTLBFS\f[R]
1911 \f[B]Linux only:\f[R] This option is the equivalent of specifying
1912 \f[CB]\-XX:+UseLargePages\f[R].
1913 This option is disabled by default.
1914 This option pre\-allocates all large pages up\-front, when memory is
1915 reserved; consequently the JVM can\[aq]t dynamically grow or shrink
1916 large pages memory areas; see \f[CB]\-XX:UseTransparentHugePages\f[R] if
1917 you want this behavior.
1918 .RS


1948 .TP
1949 .B \f[CB]\-XX:VMOptionsFile=\f[R]\f[I]filename\f[R]
1950 Allows user to specify VM options in a file, for example,
1951 \f[CB]java\ \-XX:VMOptionsFile=/var/my_vm_options\ HelloWorld\f[R].
1952 .RS
1953 .RE
1954 .SH ADVANCED JIT COMPILER OPTIONS FOR JAVA
1955 .PP
1956 These \f[CB]java\f[R] options control the dynamic just\-in\-time (JIT)
1957 compilation performed by the Java HotSpot VM.
1958 .TP
1959 .B \f[CB]\-XX:AllocateInstancePrefetchLines=\f[R]\f[I]lines\f[R]
1960 Sets the number of lines to prefetch ahead of the instance allocation
1961 pointer.
1962 By default, the number of lines to prefetch is set to 1:
1963 .RS
1964 .RS
1965 .PP
1966 \f[CB]\-XX:AllocateInstancePrefetchLines=1\f[R]
1967 .RE


1968 .RE
1969 .TP
1970 .B \f[CB]\-XX:AllocatePrefetchDistance=\f[R]\f[I]size\f[R]
1971 Sets the size (in bytes) of the prefetch distance for object allocation.
1972 Memory about to be written with the value of new objects is prefetched
1973 up to this distance starting from the address of the last allocated
1974 object.
1975 Each Java thread has its own allocation point.
1976 .RS
1977 .PP
1978 Negative values denote that prefetch distance is chosen based on the
1979 platform.
1980 Positive values are bytes to prefetch.
1981 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
1982 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
1983 \f[CB]G\f[R] to indicate gigabytes.
1984 The default value is set to \-1.
1985 .PP
1986 The following example shows how to set the prefetch distance to 1024
1987 bytes:
1988 .RS
1989 .PP
1990 \f[CB]\-XX:AllocatePrefetchDistance=1024\f[R]
1991 .RE


1992 .RE
1993 .TP
1994 .B \f[CB]\-XX:AllocatePrefetchInstr=\f[R]\f[I]instruction\f[R]
1995 Sets the prefetch instruction to prefetch ahead of the allocation
1996 pointer.

1997 Possible values are from 0 to 3.
1998 The actual instructions behind the values depend on the platform.
1999 By default, the prefetch instruction is set to 0:
2000 .RS
2001 .RS
2002 .PP
2003 \f[CB]\-XX:AllocatePrefetchInstr=0\f[R]
2004 .RE


2005 .RE
2006 .TP
2007 .B \f[CB]\-XX:AllocatePrefetchLines=\f[R]\f[I]lines\f[R]
2008 Sets the number of cache lines to load after the last object allocation
2009 by using the prefetch instructions generated in compiled code.
2010 The default value is 1 if the last allocated object was an instance, and
2011 3 if it was an array.
2012 .RS
2013 .PP
2014 The following example shows how to set the number of loaded cache lines
2015 to 5:
2016 .RS
2017 .PP
2018 \f[CB]\-XX:AllocatePrefetchLines=5\f[R]
2019 .RE


2020 .RE
2021 .TP
2022 .B \f[CB]\-XX:AllocatePrefetchStepSize=\f[R]\f[I]size\f[R]
2023 Sets the step size (in bytes) for sequential prefetch instructions.
2024 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
2025 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, \f[CB]g\f[R] or \f[CB]G\f[R]
2026 to indicate gigabytes.
2027 By default, the step size is set to 16 bytes:
2028 .RS
2029 .RS
2030 .PP
2031 \f[CB]\-XX:AllocatePrefetchStepSize=16\f[R]
2032 .RE


2033 .RE
2034 .TP
2035 .B \f[CB]\-XX:AllocatePrefetchStyle=\f[R]\f[I]style\f[R]
2036 Sets the generated code style for prefetch instructions.
2037 The \f[I]style\f[R] argument is an integer from 0 to 3:
2038 .RS
2039 .TP
2040 .B \f[CB]0\f[R]
2041 Don\[aq]t generate prefetch instructions.
2042 .RS
2043 .RE
2044 .TP
2045 .B \f[CB]1\f[R]
2046 Execute prefetch instructions after each allocation.
2047 This is the default setting.
2048 .RS
2049 .RE
2050 .TP
2051 .B \f[CB]2\f[R]
2052 Use the thread\-local allocation block (TLAB) watermark pointer to
2053 determine when prefetch instructions are executed.
2054 .RS
2055 .RE
2056 .TP
2057 .B \f[CB]3\f[R]
2058 Generate one prefetch instruction per cache line.
2059 .RS
2060 .RE


2061 .RE
2062 .TP
2063 .B \f[CB]\-XX:+BackgroundCompilation\f[R]
2064 Enables background compilation.
2065 This option is enabled by default.
2066 To disable background compilation, specify
2067 \f[CB]\-XX:\-BackgroundCompilation\f[R] (this is equivalent to specifying
2068 \f[CB]\-Xbatch\f[R]).
2069 .RS
2070 .RE
2071 .TP
2072 .B \f[CB]\-XX:CICompilerCount=\f[R]\f[I]threads\f[R]
2073 Sets the number of compiler threads to use for compilation.
2074 By default, the number of compiler threads is selected automatically
2075 depending on the number of CPUs and memory available for compiled code.

2076 The following example shows how to set the number of threads to 2:
2077 .RS
2078 .RS
2079 .PP
2080 \f[CB]\-XX:CICompilerCount=2\f[R]
2081 .RE
2082 .RE
2083 .TP
2084 .B \f[CB]\-XX:+UseDynamicNumberOfCompilerThreads\f[R]
2085 Dynamically create compiler thread up to the limit specified by
2086 \f[CB]\-XX:CICompilerCount\f[R].
2087 This option is enabled by default.
2088 .RS
2089 .RE
2090 .TP
2091 .B \f[CB]\-XX:CompileCommand=\f[R]\f[I]command\f[R]\f[CB],\f[R]\f[I]method\f[R][\f[CB],\f[R]\f[I]option\f[R]]
2092 Specifies a \f[I]command\f[R] to perform on a \f[I]method\f[R].
2093 For example, to exclude the \f[CB]indexOf()\f[R] method of the
2094 \f[CB]String\f[R] class from being compiled, use the following:
2095 .RS
2096 .RS
2097 .PP
2098 \f[CB]\-XX:CompileCommand=exclude,java/lang/String.indexOf\f[R]
2099 .RE
2100 .PP
2101 Note that the full class name is specified, including all packages and
2102 subpackages separated by a slash (\f[CB]/\f[R]).
2103 For easier cut\-and\-paste operations, it\[aq]s also possible to use the
2104 method name format produced by the \f[CB]\-XX:+PrintCompilation\f[R] and
2105 \f[CB]\-XX:+LogCompilation\f[R] options:
2106 .RS
2107 .PP
2108 \f[CB]\-XX:CompileCommand=exclude,java.lang.String::indexOf\f[R]
2109 .RE
2110 .PP


2295 \f[CB]\-XX:+LogCompilation\f[R] options:
2296 .RS
2297 .PP
2298 \f[CB]\-XX:CompileOnly=java.lang.String::length,java.util.List::size\f[R]
2299 .RE
2300 .PP
2301 Although wildcards aren\[aq]t supported, you can specify only the class
2302 or package name to compile all methods in that class or package, as well
2303 as specify just the method to compile methods with this name in any
2304 class:
2305 .IP
2306 .nf
2307 \f[CB]
2308 \-XX:CompileOnly=java/lang/String
2309 \-XX:CompileOnly=java/lang
2310 \-XX:CompileOnly=.length
2311 \f[R]
2312 .fi
2313 .RE
2314 .TP




















2315 .B \f[CB]\-XX:CompileThresholdScaling=\f[R]\f[I]scale\f[R]
2316 Provides unified control of first compilation.
2317 This option controls when methods are first compiled for both the tiered
2318 and the nontiered modes of operation.
2319 The \f[CB]CompileThresholdScaling\f[R] option has a floating point value
2320 between 0 and +Inf and scales the thresholds corresponding to the
2321 current mode of operation (both tiered and nontiered).
2322 Setting \f[CB]CompileThresholdScaling\f[R] to a value less than 1.0
2323 results in earlier compilation while values greater than 1.0 delay
2324 compilation.
2325 Setting \f[CB]CompileThresholdScaling\f[R] to 0 is equivalent to disabling
2326 compilation.
2327 .RS
2328 .RE
2329 .TP
2330 .B \f[CB]\-XX:+DoEscapeAnalysis\f[R]
2331 Enables the use of escape analysis.
2332 This option is enabled by default.
2333 To disable the use of escape analysis, specify
2334 \f[CB]\-XX:\-DoEscapeAnalysis\f[R].

2335 .RS
2336 .RE
2337 .TP
2338 .B \f[CB]\-XX:InitialCodeCacheSize=\f[R]\f[I]size\f[R]
2339 Sets the initial code cache size (in bytes).
2340 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
2341 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
2342 \f[CB]G\f[R] to indicate gigabytes.
2343 The default value depends on the platform.
2344 The initial code cache size shouldn\[aq]t be less than the system\[aq]s
2345 minimal memory page size.
2346 The following example shows how to set the initial code cache size to 32
2347 KB:
2348 .RS
2349 .RS
2350 .PP
2351 \f[CB]\-XX:InitialCodeCacheSize=32k\f[R]
2352 .RE
2353 .RE
2354 .TP
2355 .B \f[CB]\-XX:+Inline\f[R]
2356 Enables method inlining.
2357 This option is enabled by default to increase performance.
2358 To disable method inlining, specify \f[CB]\-XX:\-Inline\f[R].
2359 .RS
2360 .RE
2361 .TP
2362 .B \f[CB]\-XX:InlineSmallCode=\f[R]\f[I]size\f[R]
2363 Sets the maximum code size (in bytes) for already compiled methods that
2364 may be inlined.
2365 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
2366 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
2367 \f[CB]G\f[R] to indicate gigabytes.
2368 The default value depends on the platform and on whether tiered
2369 compilation is enabled.
2370 In the following example it is set to 1000 bytes:
2371 .RS
2372 .RS
2373 .PP
2374 \f[CB]\-XX:InlineSmallCode=1000\f[R]
2375 .RE
2376 .RE
2377 .TP
2378 .B \f[CB]\-XX:+LogCompilation\f[R]
2379 Enables logging of compilation activity to a file named
2380 \f[CB]hotspot.log\f[R] in the current working directory.
2381 You can specify a different log file path and name using the
2382 \f[CB]\-XX:LogFile\f[R] option.
2383 .RS
2384 .PP
2385 By default, this option is disabled and compilation activity isn\[aq]t
2386 logged.
2387 The \f[CB]\-XX:+LogCompilation\f[R] option has to be used together with
2388 the \f[CB]\-XX:UnlockDiagnosticVMOptions\f[R] option that unlocks
2389 diagnostic JVM options.
2390 .PP
2391 You can enable verbose diagnostic output with a message printed to the
2392 console every time a method is compiled by using the
2393 \f[CB]\-XX:+PrintCompilation\f[R] option.
2394 .RE
2395 .TP
2396 .B \f[CB]\-XX:FreqInlineSize=\f[R]\f[I]size\f[R]
2397 Sets the maximum bytecode size (in bytes) of a hot method to be inlined.
2398 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
2399 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
2400 \f[CB]G\f[R] to indicate gigabytes.
2401 The default value depends on the platform.
2402 In the following example it is set to 325 bytes:
2403 .RS
2404 .RS
2405 .PP
2406 \f[CB]\-XX:FreqInlineSize=325\f[R]
2407 .RE
2408 .RE
2409 .TP
2410 .B \f[CB]\-XX:MaxInlineSize=\f[R]\f[I]size\f[R]
2411 Sets the maximum bytecode size (in bytes) of a cold method to be
2412 inlined.
2413 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
2414 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
2415 \f[CB]G\f[R] to indicate gigabytes.
2416 By default, the maximum bytecode size is set to 35 bytes:
2417 .RS
2418 .RS
2419 .PP
2420 \f[CB]\-XX:MaxInlineSize=35\f[R]
2421 .RE
2422 .RE
2423 .TP
2424 .B \f[CB]\-XX:MaxTrivialSize=\f[R]\f[I]size\f[R]
2425 Sets the maximum bytecode size (in bytes) of a trivial method to be
2426 inlined.
2427 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
2428 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
2429 \f[CB]G\f[R] to indicate gigabytes.
2430 By default, the maximum bytecode size of a trivial method is set to 6
2431 bytes:
2432 .RS
2433 .RS
2434 .PP
2435 \f[CB]\-XX:MaxTrivialSize=6\f[R]
2436 .RE
2437 .RE
2438 .TP
2439 .B \f[CB]\-XX:MaxNodeLimit=\f[R]\f[I]nodes\f[R]
2440 Sets the maximum number of nodes to be used during single method
2441 compilation.
2442 By default the value depends on the features enabled.
2443 In the following example the maximum number of nodes is set to 100,000:
2444 .RS
2445 .RS
2446 .PP
2447 \f[CB]\-XX:MaxNodeLimit=100000\f[R]
2448 .RE
2449 .RE
2450 .TP
2451 .B \f[CB]\-XX:NonNMethodCodeHeapSize=\f[R]\f[I]size\f[R]
2452 Sets the size in bytes of the code segment containing nonmethod code.
2453 .RS
2454 .PP
2455 A nonmethod code segment containing nonmethod code, such as compiler
2456 buffers and the bytecode interpreter.
2457 This code type stays in the code cache forever.
2458 This flag is used only if \f[CB]\-XX:SegmentedCodeCache\f[R] is enabled.
2459 .RE
2460 .TP
2461 .B \f[CB]\-XX:NonProfiledCodeHeapSize=\f[R]\f[I]size\f[R]
2462 Sets the size in bytes of the code segment containing nonprofiled
2463 methods.
2464 This flag is used only if \f[CB]\-XX:SegmentedCodeCache\f[R] is enabled.
2465 .RS
2466 .RE
2467 .TP















2468 .B \f[CB]\-XX:+OptimizeStringConcat\f[R]
2469 Enables the optimization of \f[CB]String\f[R] concatenation operations.
2470 This option is enabled by default.
2471 To disable the optimization of \f[CB]String\f[R] concatenation operations,
2472 specify \f[CB]\-XX:\-OptimizeStringConcat\f[R].

2473 .RS
2474 .RE
2475 .TP
2476 .B \f[CB]\-XX:+PrintAssembly\f[R]
2477 Enables printing of assembly code for bytecoded and native methods by
2478 using the external \f[CB]hsdis\-<arch>.so\f[R] or \f[CB]\&.dll\f[R] library.
2479 For 64\-bit VM on Windows, it\[aq]s \f[CB]hsdis\-amd64.dll\f[R].
2480 This lets you to see the generated code, which may help you to diagnose
2481 performance issues.
2482 .RS
2483 .PP
2484 By default, this option is disabled and assembly code isn\[aq]t printed.
2485 The \f[CB]\-XX:+PrintAssembly\f[R] option has to be used together with the
2486 \f[CB]\-XX:UnlockDiagnosticVMOptions\f[R] option that unlocks diagnostic
2487 JVM options.
2488 .RE
2489 .TP
2490 .B \f[CB]\-XX:ProfiledCodeHeapSize=\f[R]\f[I]size\f[R]
2491 Sets the size in bytes of the code segment containing profiled methods.
2492 This flag is used only if \f[CB]\-XX:SegmentedCodeCache\f[R] is enabled.


2566 The advantages are better control of the memory footprint, reduced code
2567 fragmentation, and better iTLB/iCache behavior due to improved locality.
2568 iTLB/iCache is a CPU\-specific term meaning Instruction Translation
2569 Lookaside Buffer (ITLB).
2570 ICache is an instruction cache in theCPU.
2571 The implementation of the code cache can be found in the file:
2572 \f[CB]/share/vm/code/codeCache.cpp\f[R].
2573 .RS
2574 .RE
2575 .TP
2576 .B \f[CB]\-XX:StartAggressiveSweepingAt=\f[R]\f[I]percent\f[R]
2577 Forces stack scanning of active methods to aggressively remove unused
2578 code when only the given percentage of the code cache is free.
2579 The default value is 10%.
2580 .RS
2581 .RE
2582 .TP
2583 .B \f[CB]\-XX:\-TieredCompilation\f[R]
2584 Disables the use of tiered compilation.
2585 By default, this option is enabled.
2586 .RS
2587 .RE
2588 .TP
2589 .B \f[CB]\-XX:UseSSE=\f[R]\f[I]version\f[R]
2590 Enables the use of SSE instruction set of a specified version.
2591 Is set by default to the highest supported version available (x86 only).
2592 .RS
2593 .RE
2594 .TP
2595 .B \f[CB]\-XX:UseAVX=\f[R]\f[I]version\f[R]
2596 Enables the use of AVX instruction set of a specified version.
2597 Is set by default to the highest supported version available (x86 only).
2598 .RS
2599 .RE
2600 .TP
2601 .B \f[CB]\-XX:+UseAES\f[R]
2602 Enables hardware\-based AES intrinsics for hardware that supports it.
2603 This option is on by default on hardware that has the necessary
2604 instructions.

2605 The \f[CB]\-XX:+UseAES\f[R] is used in conjunction with UseAESIntrinsics.
2606 Flags that control intrinsics now require the option
2607 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2608 .RS
2609 .RE
2610 .TP
2611 .B \f[CB]\-XX:+UseAESIntrinsics\f[R]
2612 Enables AES intrinsics.
2613 Specifying\f[CB]\-XX:+UseAESIntrinsics\f[R] is equivalent to also enabling
2614 \f[CB]\-XX:+UseAES\f[R].
2615 To disable hardware\-based AES intrinsics, specify
2616 \f[CB]\-XX:\-UseAES\ \-XX:\-UseAESIntrinsics\f[R].
2617 For example, to enable hardware AES, use the following flags:
2618 .RS
2619 .RS
2620 .PP
2621 \f[CB]\-XX:+UseAES\ \-XX:+UseAESIntrinsics\f[R]
2622 .RE
2623 .PP
2624 Flags that control intrinsics now require the option
2625 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2626 .RE
2627 .TP
2628 .B \f[CB]\-XX:+UseAESCTRIntrinsics\f[R]
2629 Analogous to \f[CB]\-XX:+UseAESIntrinsics\f[R] enables AES/CTR intrinsics.
2630 .RS
2631 .RE
2632 .TP
2633 .B \f[CB]\-XX:+UseGHASHIntrinsics\f[R]
2634 Controls the use of GHASH intrinsics.
2635 Enabled by default on platforms that support the corresponding
2636 instructions.
2637 Flags that control intrinsics now require the option
2638 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2639 .RS
2640 .RE
2641 .TP
2642 .B \f[CB]\-XX:+UseBASE64Intrinsics\f[R]
2643 Controls the use of accelerated BASE64 encoding routines for
2644 \f[CB]java.util.Base64\f[R].
2645 Enabled by default on platforms that support it.
2646 Flags that control intrinsics now require the option
2647 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2648 .RS
2649 .RE
2650 .TP
2651 .B \f[CB]\-XX:+UseAdler32Intrinsics\f[R]
2652 Controls the use of Adler32 checksum algorithm intrinsic for
2653 \f[CB]java.util.zip.Adler32\f[R].
2654 Enabled by default on platforms that support it.
2655 Flags that control intrinsics now require the option
2656 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2657 .RS
2658 .RE
2659 .TP
2660 .B \f[CB]\-XX:+UseCRC32Intrinsics\f[R]
2661 Controls the use of CRC32 intrinsics for \f[CB]java.util.zip.CRC32\f[R].
2662 Enabled by default on platforms that support it.
2663 Flags that control intrinsics now require the option
2664 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2665 .RS
2666 .RE
2667 .TP
2668 .B \f[CB]\-XX:+UseCRC32CIntrinsics\f[R]
2669 Controls the use of CRC32C intrinsics for \f[CB]java.util.zip.CRC32C\f[R].
2670 Enabled by default on platforms that support it.
2671 Flags that control intrinsics now require the option
2672 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2673 .RS
2674 .RE
2675 .TP
2676 .B \f[CB]\-XX:+UseSHA\f[R]
2677 Enables hardware\-based intrinsics for SHA crypto hash functions for
2678 SPARC hardware.
2679 The \f[CB]UseSHA\f[R] option is used in conjunction with the
2680 \f[CB]UseSHA1Intrinsics\f[R], \f[CB]UseSHA256Intrinsics\f[R], and
2681 \f[CB]UseSHA512Intrinsics\f[R] options.
2682 .RS
2683 .PP
2684 The \f[CB]UseSHA\f[R] and \f[CB]UseSHA*Intrinsics\f[R] flags are enabled by
2685 default on machines that support the corresponding instructions.
2686 .PP
2687 This feature is applicable only when using the
2688 \f[CB]sun.security.provider.Sun\f[R] provider for SHA operations.
2689 Flags that control intrinsics now require the option
2690 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2691 .PP
2692 To disable all hardware\-based SHA intrinsics, specify the
2693 \f[CB]\-XX:\-UseSHA\f[R].
2694 To disable only a particular SHA intrinsic, use the appropriate
2695 corresponding option.
2696 For example: \f[CB]\-XX:\-UseSHA256Intrinsics\f[R].
2697 .RE
2698 .TP
2699 .B \f[CB]\-XX:+UseSHA1Intrinsics\f[R]
2700 Enables intrinsics for SHA\-1 crypto hash function.
2701 Flags that control intrinsics now require the option
2702 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2703 .RS
2704 .RE
2705 .TP
2706 .B \f[CB]\-XX:+UseSHA256Intrinsics\f[R]
2707 Enables intrinsics for SHA\-224 and SHA\-256 crypto hash functions.
2708 Flags that control intrinsics now require the option
2709 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2710 .RS
2711 .RE
2712 .TP
2713 .B \f[CB]\-XX:+UseSHA512Intrinsics\f[R]
2714 Enables intrinsics for SHA\-384 and SHA\-512 crypto hash functions.
2715 Flags that control intrinsics now require the option
2716 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2717 .RS
2718 .RE
2719 .TP
2720 .B \f[CB]\-XX:+UseMathExactIntrinsics\f[R]
2721 Enables intrinsification of various \f[CB]java.lang.Math.*Exact()\f[R]
2722 functions.
2723 Enabled by default.
2724 Flags that control intrinsics now require the option
2725 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2726 .RS
2727 .RE
2728 .TP
2729 .B \f[CB]\-XX:+UseMultiplyToLenIntrinsic\f[R]
2730 Enables intrinsification of \f[CB]BigInteger.multiplyToLen()\f[R].
2731 Enabled by default on platforms that support it.
2732 Flags that control intrinsics now require the option
2733 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2734 .RS
2735 .RE
2736 .TP
2737 .B \-XX:+UseSquareToLenIntrinsic
2738 Enables intrinsification of \f[CB]BigInteger.squareToLen()\f[R].
2739 Enabled by default on platforms that support it.
2740 Flags that control intrinsics now require the option
2741 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2742 .RS
2743 .RE
2744 .TP
2745 .B \-XX:+UseMulAddIntrinsic
2746 Enables intrinsification of \f[CB]BigInteger.mulAdd()\f[R].
2747 Enabled by default on platforms that support it.
2748 Flags that control intrinsics now require the option
2749 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2750 .RS
2751 .RE
2752 .TP
2753 .B \-XX:+UseMontgomeryMultiplyIntrinsic
2754 Enables intrinsification of \f[CB]BigInteger.montgomeryMultiply()\f[R].
2755 Enabled by default on platforms that support it.
2756 Flags that control intrinsics now require the option
2757 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2758 .RS
2759 .RE
2760 .TP
2761 .B \-XX:+UseMontgomerySquareIntrinsic
2762 Enables intrinsification of \f[CB]BigInteger.montgomerySquare()\f[R].
2763 Enabled by default on platforms that support it.
2764 Flags that control intrinsics now require the option
2765 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2766 .RS
2767 .RE
2768 .TP
2769 .B \f[CB]\-XX:+UseCMoveUnconditionally\f[R]
2770 Generates CMove (scalar and vector) instructions regardless of
2771 profitability analysis.
2772 .RS
2773 .RE
2774 .TP
2775 .B \f[CB]\-XX:+UseCodeCacheFlushing\f[R]
2776 Enables flushing of the code cache before shutting down the compiler.
2777 This option is enabled by default.
2778 To disable flushing of the code cache before shutting down the compiler,
2779 specify \f[CB]\-XX:\-UseCodeCacheFlushing\f[R].
2780 .RS
2781 .RE
2782 .TP
2783 .B \f[CB]\-XX:+UseCondCardMark\f[R]
2784 Enables checking if the card is already marked before updating the card
2785 table.
2786 This option is disabled by default.
2787 It should be used only on machines with multiple sockets, where it
2788 increases the performance of Java applications that rely on concurrent
2789 operations.

2790 .RS
2791 .RE
2792 .TP
2793 .B \f[CB]\-XX:+UseCountedLoopSafepoints\f[R]
2794 Keeps safepoints in counted loops.
2795 Its default value depends on whether the selected garbage collector
2796 requires low latency safepoints.
2797 .RS
2798 .RE
2799 .TP
2800 .B \f[CB]\-XX:LoopStripMiningIter=\f[R]\f[I]number_of_iterations\f[R]
2801 Controls the number of iterations in the inner strip mined loop.
2802 Strip mining transforms counted loops into two level nested loops.
2803 Safepoints are kept in the outer loop while the inner loop can execute
2804 at full speed.
2805 This option controls the maximum number of iterations in the inner loop.
2806 The default value is 1,000.
2807 .RS
2808 .RE
2809 .TP
2810 .B \f[CB]\-XX:LoopStripMiningIterShortLoop\f[R]=\f[I]number_of_iterations\f[R]
2811 Controls loop strip mining optimization.
2812 Loops with the number of iterations less than specified will not have
2813 safepoints in them.
2814 Default value is 1/10th of \f[CB]\-XX:LoopStripMiningIter\f[R].
2815 .RS
2816 .RE
2817 .TP
2818 .B \f[CB]\-XX:+UseFMA\f[R]
2819 Enables hardware\-based FMA intrinsics for hardware where FMA
2820 instructions are available (such as, Intel, SPARC, and ARM64).
2821 FMA intrinsics are generated for the
2822 \f[CB]java.lang.Math.fma(\f[R]\f[I]a\f[R]\f[CB],\f[R] \f[I]b\f[R]\f[CB],\f[R]
2823 \f[I]c\f[R]\f[CB])\f[R] methods that calculate the value of \f[CB](\f[R]
2824 \f[I]a\f[R] \f[CB]*\f[R] \f[I]b\f[R] \f[CB]+\f[R] \f[I]c\f[R] \f[CB])\f[R]
2825 expressions.
2826 .RS
2827 .RE
2828 .TP
2829 .B \f[CB]\-XX:+UseRTMDeopt\f[R]
2830 Autotunes RTM locking depending on the abort ratio.
2831 This ratio is specified by the \f[CB]\-XX:RTMAbortRatio\f[R] option.
2832 If the number of aborted transactions exceeds the abort ratio, then the
2833 method containing the lock is deoptimized and recompiled with all locks
2834 as normal locks.
2835 This option is disabled by default.
2836 The \f[CB]\-XX:+UseRTMLocking\f[R] option must be enabled.
2837 .RS
2838 .RE
2839 .TP
2840 .B \f[CB]\-XX:+UseRTMLocking\f[R]
2841 Generates Restricted Transactional Memory (RTM) locking code for all
2842 inflated locks, with the normal locking mechanism as the fallback
2843 handler.
2844 This option is disabled by default.
2845 Options related to RTM are available only on x86 CPUs that support
2846 Transactional Synchronization Extensions (TSX).
2847 .RS
2848 .PP
2849 RTM is part of Intel\[aq]s TSX, which is an x86 instruction set
2850 extension and facilitates the creation of multithreaded applications.
2851 RTM introduces the new instructions \f[CB]XBEGIN\f[R], \f[CB]XABORT\f[R],
2852 \f[CB]XEND\f[R], and \f[CB]XTEST\f[R].
2853 The \f[CB]XBEGIN\f[R] and \f[CB]XEND\f[R] instructions enclose a set of
2854 instructions to run as a transaction.
2855 If no conflict is found when running the transaction, then the memory
2856 and register modifications are committed together at the \f[CB]XEND\f[R]
2857 instruction.
2858 The \f[CB]XABORT\f[R] instruction can be used to explicitly abort a
2859 transaction and the \f[CB]XEND\f[R] instruction checks if a set of
2860 instructions is being run in a transaction.
2861 .PP
2862 A lock on a transaction is inflated when another thread tries to access
2863 the same transaction, thereby blocking the thread that didn\[aq]t
2864 originally request access to the transaction.
2865 RTM requires that a fallback set of operations be specified in case a
2866 transaction aborts or fails.


2869 RTM improves performance for highly contended locks with low conflict in
2870 a critical region (which is code that must not be accessed by more than
2871 one thread concurrently).
2872 RTM also improves the performance of coarse\-grain locking, which
2873 typically doesn\[aq]t perform well in multithreaded applications.
2874 (Coarse\-grain locking is the strategy of holding locks for long periods
2875 to minimize the overhead of taking and releasing locks, while
2876 fine\-grained locking is the strategy of trying to achieve maximum
2877 parallelism by locking only when necessary and unlocking as soon as
2878 possible.) Also, for lightly contended locks that are used by different
2879 threads, RTM can reduce false cache line sharing, also known as cache
2880 line ping\-pong.
2881 This occurs when multiple threads from different processors are
2882 accessing different resources, but the resources share the same cache
2883 line.
2884 As a result, the processors repeatedly invalidate the cache lines of
2885 other processors, which forces them to read from main memory instead of
2886 their cache.
2887 .RE
2888 .TP













































2889 .B \f[CB]\-XX:+UseSuperWord\f[R]
2890 Enables the transformation of scalar operations into superword
2891 operations.
2892 Superword is a vectorization optimization.
2893 This option is enabled by default.
2894 To disable the transformation of scalar operations into superword
2895 operations, specify \f[CB]\-XX:\-UseSuperWord\f[R].

2896 .RS
2897 .RE
2898 .SH ADVANCED SERVICEABILITY OPTIONS FOR JAVA
2899 .PP
2900 These \f[CB]java\f[R] options provide the ability to gather system
2901 information and perform extensive debugging.
2902 .TP
2903 .B \f[CB]\-XX:+DisableAttachMechanism\f[R]
2904 Disables the mechanism that lets tools attach to the JVM.
2905 By default, this option is disabled, meaning that the attach mechanism
2906 is enabled and you can use diagnostics and troubleshooting tools such as
2907 \f[CB]jcmd\f[R], \f[CB]jstack\f[R], \f[CB]jmap\f[R], and \f[CB]jinfo\f[R].
2908 .RS
2909 .RS
2910 .PP
2911 \f[B]Note:\f[R] The tools such as \f[B]jcmd\f[R], \f[B]jinfo\f[R],
2912 \f[B]jmap\f[R], and \f[B]jstack\f[R] shipped with the JDK aren\[aq]t
2913 supported when using the tools from one JDK version to troubleshoot a
2914 different JDK version.
2915 .RE


3067 performed by the Java HotSpot VM.
3068 .TP
3069 .B \f[CB]\-XX:+AggressiveHeap\f[R]
3070 Enables Java heap optimization.
3071 This sets various parameters to be optimal for long\-running jobs with
3072 intensive memory allocation, based on the configuration of the computer
3073 (RAM and CPU).
3074 By default, the option is disabled and the heap sizes are configured
3075 less aggressively.
3076 .RS
3077 .RE
3078 .TP
3079 .B \f[CB]\-XX:+AlwaysPreTouch\f[R]
3080 Requests the VM to touch every page on the Java heap after requesting it
3081 from the operating system and before handing memory out to the
3082 application.
3083 By default, this option is disabled and all pages are committed as the
3084 application uses the heap space.
3085 .RS
3086 .RE

3087 .TP
3088 .B \f[CB]\-XX:ConcGCThreads=\f[R]\f[I]threads\f[R]
3089 Sets the number of threads used for concurrent GC.
3090 Sets \f[I]\f[CI]threads\f[I]\f[R] to approximately 1/4 of the number of
3091 parallel garbage collection threads.
3092 The default value depends on the number of CPUs available to the JVM.
3093 .RS
3094 .PP
3095 For example, to set the number of threads for concurrent GC to 2,
3096 specify the following option:
3097 .RS
3098 .PP
3099 \f[CB]\-XX:ConcGCThreads=2\f[R]
3100 .RE
3101 .RE
3102 .TP
3103 .B \f[CB]\-XX:+DisableExplicitGC\f[R]
3104 Enables the option that disables processing of calls to the
3105 \f[CB]System.gc()\f[R] method.
3106 This option is disabled by default, meaning that calls to


3798 nonuniform memory architecture (NUMA) by increasing the
3799 application\[aq]s use of lower latency memory.
3800 By default, this option is disabled and no optimization for NUMA is
3801 made.
3802 The option is available only when the parallel garbage collector is used
3803 (\f[CB]\-XX:+UseParallelGC\f[R]).
3804 .RS
3805 .RE
3806 .TP
3807 .B \f[CB]\-XX:+UseParallelGC\f[R]
3808 Enables the use of the parallel scavenge garbage collector (also known
3809 as the throughput collector) to improve the performance of your
3810 application by leveraging multiple processors.
3811 .RS
3812 .PP
3813 By default, this option is disabled and the default collector is used.
3814 If it\[aq]s enabled, then the \f[CB]\-XX:+UseParallelOldGC\f[R] option is
3815 automatically enabled, unless you explicitly disable it.
3816 .RE
3817 .TP








3818 .B \f[CB]\-XX:+UseSerialGC\f[R]
3819 Enables the use of the serial garbage collector.
3820 This is generally the best choice for small and simple applications that
3821 don\[aq]t require any special functionality from garbage collection.
3822 By default, this option is disabled and the default collector is used.
3823 .RS
3824 .RE
3825 .TP
3826 .B \f[CB]\-XX:+UseSHM\f[R]
3827 \f[B]Linux only:\f[R] Enables the JVM to use shared memory to set up
3828 large pages.
3829 .RS
3830 .PP
3831 See \f[B]Large Pages\f[R] for setting up large pages.
3832 .RE
3833 .TP
3834 .B \f[CB]\-XX:+UseStringDeduplication\f[R]
3835 Enables string deduplication.
3836 By default, this option is disabled.
3837 To use this option, you must enable the garbage\-first (G1) garbage


3882 Developers should use this flag when developing new code.
3883 Stricter checks may become the default in future releases.
3884 .RS
3885 .RE
3886 .TP
3887 .B \f[CB]\-Xloggc:\f[R]\f[I]filename\f[R]
3888 Sets the file to which verbose GC events information should be
3889 redirected for logging.
3890 The \f[CB]\-Xloggc\f[R] option overrides \f[CB]\-verbose:gc\f[R] if both are
3891 given with the same java command.
3892 \f[CB]\-Xloggc:\f[R]\f[I]filename\f[R] is replaced by
3893 \f[CB]\-Xlog:gc:\f[R]\f[I]filename\f[R].
3894 See Enable Logging with the JVM Unified Logging Framework.
3895 .RS
3896 .PP
3897 Example:
3898 .PP
3899 \f[CB]\-Xlog:gc:garbage\-collection.log\f[R]
3900 .RE
3901 .TP









3902 .B \f[CB]\-XX:+FlightRecorder\f[R]
3903 Enables the use of Java Flight Recorder (JFR) during the runtime of the
3904 application.
3905 Since JDK 8u40 this option has not been required to use JFR.
3906 .RS
3907 .RE
3908 .TP
3909 .B \f[CB]\-XX:InitialRAMFraction=\f[R]\f[I]ratio\f[R]
3910 Sets the initial amount of memory that the JVM may use for the Java heap
3911 before applying ergonomics heuristics as a ratio of the maximum amount
3912 determined as described in the \f[CB]\-XX:MaxRAM\f[R] option.
3913 The default value is 64.
3914 .RS
3915 .PP
3916 Use the option \f[CB]\-XX:InitialRAMPercentage\f[R] instead.
3917 .RE
3918 .TP
3919 .B \f[CB]\-XX:MaxRAMFraction=\f[R]\f[I]ratio\f[R]
3920 Sets the maximum amount of memory that the JVM may use for the Java heap
3921 before applying ergonomics heuristics as a fraction of the maximum


3976 By default, this option is disabled and constant pool resolutions
3977 aren\[aq]t traced.
3978 .RS
3979 .PP
3980 The replacement Unified Logging syntax is
3981 \f[CB]\-Xlog:class+resolve=debug\f[R].
3982 See \f[B]Enable Logging with the JVM Unified Logging Framework\f[R].
3983 .RE
3984 .TP
3985 .B \f[CB]\-XX:+TraceLoaderConstraints\f[R]
3986 Enables tracing of the loader constraints recording.
3987 By default, this option is disabled and loader constraints recording
3988 isn\[aq]t traced.
3989 .RS
3990 .PP
3991 The replacement Unified Logging syntax is
3992 \f[CB]\-Xlog:class+loader+constraints=info\f[R].
3993 See \f[B]Enable Logging with the JVM Unified Logging Framework\f[R].
3994 .RE
3995 .TP
3996 .B \f[CB]\-XX:+UseParallelOldGC\f[R]
3997 Enables the use of the parallel garbage collector for full GCs.
3998 By default, this option is disabled.
3999 Enabling it automatically enables the \f[CB]\-XX:+UseParallelGC\f[R]
4000 option.
4001 .RS
4002 .RE
4003 .SH OBSOLETE JAVA OPTIONS
4004 .PP
4005 These \f[CB]java\f[R] options are still accepted but ignored, and a
4006 warning is issued when they\[aq]re used.
4007 .TP
4008 .B \f[CB]\-XX:+FailOverToOldVerifier\f[R]
4009 Enables automatic failover to the old verifier when the new type checker
4010 fails.
4011 By default, this option is disabled and it\[aq]s ignored (that is,
4012 treated as disabled) for classes with a recent bytecode version.
4013 You can enable it only for classes with older versions of the bytecode.
4014 .RS
4015 .RE
4016 .TP
4017 .B \f[CB]\-XX:+UseMembar\f[R]
4018 Enabled issuing membars on thread\-state transitions.
4019 This option was disabled by default on all platforms except ARM servers,
4020 where it was enabled.
4021 .RS
4022 .RE
4023 .TP
4024 .B \f[CB]\-XX:MaxPermSize=\f[R]\f[I]size\f[R]
4025 Sets the maximum permanent generation space size (in bytes).
4026 This option was deprecated in JDK 8 and superseded by the
4027 \f[CB]\-XX:MaxMetaspaceSize\f[R] option.
4028 .RS
4029 .RE
4030 .TP
4031 .B \f[CB]\-XX:PermSize=\f[R]\f[I]size\f[R]
4032 Sets the space (in bytes) allocated to the permanent generation that
4033 triggers a garbage collection if it\[aq]s exceeded.
4034 This option was deprecated in JDK 8 and superseded by the
4035 \f[CB]\-XX:MetaspaceSize\f[R] option.
4036 .RS
4037 .RE
4038 .SH REMOVED JAVA OPTIONS
4039 .PP
4040 No documented \f[CB]java\f[R] options have been removed in JDK 14.












4041 .PP
4042 For the lists and descriptions of options removed in previous releases
4043 see the \f[I]Removed Java Options\f[R] section in:
4044 .IP \[bu] 2
4045 \f[B]Java Platform, Standard Edition Tools Reference, Release 13\f[R]
4046 [https://docs.oracle.com/en/java/javase/13/docs/specs/man/java.html]
4047 .IP \[bu] 2
4048 \f[B]Java Platform, Standard Edition Tools Reference, Release 12\f[R]
4049 [https://docs.oracle.com/en/java/javase/12/tools/java.html#GUID\-3B1CE181\-CD30\-4178\-9602\-230B800D4FAE]
4050 .IP \[bu] 2
4051 \f[B]Java Platform, Standard Edition Tools Reference, Release 11\f[R]
4052 [https://docs.oracle.com/en/java/javase/11/tools/java.html#GUID\-741FC470\-AA3E\-494A\-8D2B\-1B1FE4A990D1]
4053 .IP \[bu] 2
4054 \f[B]Java Platform, Standard Edition Tools Reference, Release 10\f[R]
4055 [https://docs.oracle.com/javase/10/tools/java.htm#JSWOR624]
4056 .IP \[bu] 2
4057 \f[B]Java Platform, Standard Edition Tools Reference, Release 9\f[R]
4058 [https://docs.oracle.com/javase/9/tools/java.htm#JSWOR624]
4059 .IP \[bu] 2
4060 \f[B]Java Platform, Standard Edition Tools Reference, Release 8 for
4061 Oracle JDK on Windows\f[R]
4062 [https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html#BGBCIEFC]
4063 .IP \[bu] 2
4064 \f[B]Java Platform, Standard Edition Tools Reference, Release 8 for
4065 Oracle JDK on Solaris, Linux, and macOS\f[R]
4066 [https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html#BGBCIEFC]
4067 .SH JAVA COMMAND\-LINE ARGUMENT FILES


4098 Use white space or new line characters to separate arguments included in
4099 the file.
4100 .IP \[bu] 2
4101 White space includes a white space character, \f[CB]\\t\f[R],
4102 \f[CB]\\n\f[R], \f[CB]\\r\f[R], and \f[CB]\\f\f[R].
4103 .RS 2
4104 .PP
4105 For example, it is possible to have a path with a space, such as
4106 \f[CB]c:\\Program\ Files\f[R] that can be specified as either
4107 \f[CB]"c:\\\\Program\ Files"\f[R] or, to avoid an escape,
4108 \f[CB]c:\\Program"\ "Files\f[R].
4109 .RE
4110 .IP \[bu] 2
4111 Any option that contains spaces, such as a path component, must be
4112 within quotation marks using quotation (\[aq]"\[aq]) characters in its
4113 entirety.
4114 .IP \[bu] 2
4115 A string within quotation marks may contain the characters \f[CB]\\n\f[R],
4116 \f[CB]\\r\f[R], \f[CB]\\t\f[R], and \f[CB]\\f\f[R].
4117 They are converted to their respective ASCII codes.

4118 .IP \[bu] 2
4119 If a file name contains embedded spaces, then put the whole file name in
4120 double quotation marks.
4121 .IP \[bu] 2
4122 File names in an argument file are relative to the current directory,
4123 not to the location of the argument file.
4124 .IP \[bu] 2
4125 Use the number sign \f[CB]#\f[R] in the argument file to identify
4126 comments.
4127 All characters following the \f[CB]#\f[R] are ignored until the end of
4128 line.
4129 .IP \[bu] 2
4130 Additional at sign \f[CB]\@\f[R] prefixes to \f[CB]\@\f[R] prefixed options
4131 act as an escape, (the first \f[CB]\@\f[R] is removed and the rest of the
4132 arguments are presented to the launcher literally).
4133 .IP \[bu] 2
4134 Lines may be continued using the continuation character (\f[CB]\\\f[R]) at
4135 the end\-of\-line.
4136 The two lines are concatenated with the leading white spaces trimmed.
4137 To prevent trimming the leading white spaces, a continuation character
4138 (\f[CB]\\\f[R]) may be placed at the first column.
4139 .IP \[bu] 2
4140 Because backslash (\\) is an escape character, a backslash character
4141 must be escaped with another backslash character.
4142 .IP \[bu] 2
4143 Partial quote is allowed and is closed by an end\-of\-file.
4144 .IP \[bu] 2
4145 An open quote stops at end\-of\-line unless \f[CB]\\\f[R] is the last
4146 character, which then joins the next line by removing all leading white
4147 space characters.
4148 .IP \[bu] 2
4149 Wildcards (*) aren\[aq]t allowed in these lists (such as specifying
4150 \f[CB]*.java\f[R]).
4151 .IP \[bu] 2
4152 Use of the at sign (\f[CB]\@\f[R]) to recursively interpret files
4153 isn\[aq]t supported.
4154 .SS Example of Open or Partial Quotes in an Argument File
4155 .PP
4156 In the argument file,
4157 .IP
4158 .nf
4159 \f[CB]
4160 \-cp\ "lib/
4161 cool/
4162 app/
4163 jars
4164 \f[R]
4165 .fi
4166 .PP
4167 this is interpreted as:
4168 .RS
4169 .PP
4170 \f[CB]\-cp\ lib/cool/app/jars\f[R]
4171 .RE
4172 .SS Example of a Backslash Character Escaped with Another Backslash
4173 Character in an Argument File
4174 .PP
4175 To output the following:
4176 .RS
4177 .PP
4178 \f[CB]\-cp\ c:\\Program\ Files\ (x86)\\Java\\jre\\lib\\ext;c:\\Program\ Files\\Java\\jre9\\lib\\ext\f[R]
4179 .RE
4180 .PP
4181 The backslash character must be specified in the argument file as:
4182 .RS
4183 .PP
4184 \f[CB]\-cp\ "c:\\\\Program\ Files\ (x86)\\\\Java\\\\jre\\\\lib\\\\ext;c:\\\\Program\ Files\\\\Java\\\\jre9\\\\lib\\\\ext"\f[R]
4185 .RE
4186 .SS Example of an EOL Escape Used to Force Concatenation of Lines in an
4187 Argument File
4188 .PP
4189 In the argument file,
4190 .IP
4191 .nf
4192 \f[CB]
4193 \-cp\ "/lib/cool\ app/jars:\\
4194 \ \ \ \ /lib/another\ app/jars"
4195 \f[R]
4196 .fi
4197 .PP
4198 This is interpreted as:
4199 .RS
4200 .PP
4201 \f[CB]\-cp\ /lib/cool\ app/jars:/lib/another\ app/jars\f[R]
4202 .RE
4203 .SS Example of Line Continuation with Leading Spaces in an Argument File
4204 .PP
4205 In the argument file,
4206 .IP
4207 .nf
4208 \f[CB]
4209 \-cp\ "/lib/cool\\
4210 \\app/jars???
4211 \f[R]
4212 .fi
4213 .PP
4214 This is interpreted as:
4215 .PP
4216 \f[CB]\-cp\ /lib/cool\ app/jars\f[R]
4217 .SS Examples of Using Single Argument File
4218 .PP
4219 You can use a single argument file, such as \f[CB]myargumentfile\f[R] in
4220 the following example, to hold all required \f[CB]java\f[R] arguments:
4221 .RS
4222 .PP
4223 \f[CB]java\ \@myargumentfile\f[R]
4224 .RE
4225 .SS Examples of Using Argument Files with Paths
4226 .PP
4227 You can include relative paths in argument files; however, they\[aq]re
4228 relative to the current working directory and not to the paths of the
4229 argument files themselves.
4230 In the following example, \f[CB]path1/options\f[R] and


4979 out\-of\-range, then an appropriate error message is displayed.
4980 .PP
4981 Whether they\[aq]re set ergonomically, in a command line, by an input
4982 tool, or through the APIs (for example, classes contained in the package
4983 \f[CB]java.lang.management\f[R]) the values provided to all Java Virtual
4984 Machine (JVM) command\-line flags are validated.
4985 Ergonomics are described in Java Platform, Standard Edition HotSpot
4986 Virtual Machine Garbage Collection Tuning Guide.
4987 .PP
4988 Range and constraints are validated either when all flags have their
4989 values set during JVM initialization or a flag\[aq]s value is changed
4990 during runtime (for example using the \f[CB]jcmd\f[R] tool).
4991 The JVM is terminated if a value violates either the range or constraint
4992 check and an appropriate error message is printed on the error stream.
4993 .PP
4994 For example, if a flag violates a range or a constraint check, then the
4995 JVM exits with an error:
4996 .IP
4997 .nf
4998 \f[CB]
4999 java\ \-XX:AllocatePrefetchStyle=5\ \-version
5000 intx\ AllocatePrefetchStyle=5\ is\ outside\ the\ allowed\ range\ [\ 0\ ...\ 3\ ]
5001 Improperly\ specified\ VM\ option\ \[aq]AllocatePrefetchStyle=5\[aq]
5002 Error:\ Could\ not\ create\ the\ Java\ Virtual\ Machine.
5003 Error:\ A\ fatal\ exception\ has\ occurred.\ Program\ will\ exit.
5004 \f[R]
5005 .fi
5006 .PP
5007 The flag \f[CB]\-XX:+PrintFlagsRanges\f[R] prints the range of all the
5008 flags.
5009 This flag allows automatic testing of the flags by the values provided
5010 by the ranges.
5011 For the flags that have the ranges specified, the type, name, and the
5012 actual range is printed in the output.
5013 .PP
5014 For example,
5015 .IP
5016 .nf
5017 \f[CB]
5018 intx\ \ \ ThreadStackSize\ [\ 0\ ...\ 9007199254740987\ ]\ {pd\ product}
5019 \f[R]
5020 .fi
5021 .PP
5022 For the flags that don\[aq]t have the range specified, the values


5656 archive:
5657 .RS 4
5658 .RS
5659 .PP
5660 \f[CB]java\ \-XX:SharedArchiveFile=common.jsa\ \-cp\ common.jar:hello.jar:hi.jar\ Hello\f[R]
5661 .RE
5662 .RS
5663 .PP
5664 \f[CB]java\ \-XX:SharedArchiveFile=common.jsa\ \-cp\ common.jar:hello.jar:hi.jar\ Hi\f[R]
5665 .RE
5666 .RE
5667 .SS Specifying Additional Shared Data Added to an Archive File
5668 .PP
5669 The \f[CB]SharedArchiveConfigFile\f[R] option is used to specify
5670 additional shared data to add to the archive file.
5671 .RS
5672 .PP
5673 \f[CB]\-XX:SharedArchiveConfigFile=\f[R]\f[I]shared_config_file\f[R]
5674 .RE
5675 .PP
5676 JDK 9 and later supports adding both symbols and string objects to an
5677 archive for memory sharing when you have multiple JVM processes running
5678 on the same host.
5679 An example of this is having multiple JVM processes that use the same
5680 set of Java EE classes.
5681 When these common classes are loaded and used, new symbols and strings
5682 may be created and added to the JVM\[aq]s internal "symbol" and "string"
5683 tables.
5684 At runtime, the symbols or string objects mapped from the archive file
5685 can be shared across multiple JVM processes, resulting in a reduction of
5686 overall memory usage.
5687 In addition, archiving strings also provides added performance benefits
5688 in both startup time and runtime execution.
5689 .PP
5690 In JDK 10 and later, CONSTANT_String entries in archived classes are
5691 resolved to interned String objects at dump time, and all interned
5692 String objects are archived.
5693 However, even though all CONSTANT_String literals in all archived
5694 classes are resolved, it might still beneficial to add additional
5695 strings that are not string literals in class files, but are likely to
5696 be used by your application at run time.
5697 .PP
5698 Symbol data should be generated by the \f[CB]jcmd\f[R] tool attaching to a
5699 running JVM process.
5700 See \f[B]jcmd\f[R].
5701 .PP
5702 The following is an example of the symbol dumping command in
5703 \f[CB]jcmd\f[R]:
5704 .RS
5705 .PP
5706 \f[CB]jcmd\f[R] \f[I]pid\f[R] \f[CB]VM.symboltable\ \-verbose\f[R]
5707 .RE
5708 .RS
5709 .PP
5710 \f[B]Note:\f[R] The first line (process ID) and the second line
5711 (\f[CB]\@VERSION\ ...\f[R]) of this \f[CB]jcmd\f[R] output should be
5712 excluded from the configuration file.
5713 .RE
5714 .SS Example of a Configuration File
5715 .PP
5716 The following is an example of a configuration file:
5717 .IP
5718 .nf
5719 \f[CB]
5720 VERSION:\ 1.0
5721 \@SECTION:\ Symbol
5722 10\ \-1:\ linkMethod
5723 \f[R]


< prev index next >