1 .\"t
   2 .\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
   3 .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 .\"
   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
  46 or
  47 .PP
  48 \f[CB]java\f[R] [\f[I]options\f[R]] \f[CB]\-\-module\f[R]
  49 \f[I]module\f[R][\f[CB]/\f[R]\f[I]mainclass\f[R]] [\f[I]args\f[R] ...]
  50 .PP
  51 To launch a single source\-file program:
  52 .PP
  53 \f[CB]java\f[R] [\f[I]options\f[R]] \f[I]source\-file\f[R] [\f[I]args\f[R]
  54 \&...]
  55 .TP
  56 .B \f[I]options\f[R]
  57 Optional: Specifies command\-line options separated by spaces.
  58 See \f[B]Overview of Java Options\f[R] for a description of available
  59 options.
  60 .RS
  61 .RE
  62 .TP
  63 .B \f[I]mainclass\f[R]
  64 Specifies the name of the class to be launched.
  65 Command\-line entries following \f[CB]classname\f[R] are the arguments for
  66 the main method.
  67 .RS
  68 .RE
  69 .TP
  70 .B \f[CB]\-jar\f[R] \f[I]jarfile\f[R]
  71 Executes a program encapsulated in a JAR file.
  72 The \f[I]jarfile\f[R] argument is the name of a JAR file with a manifest
  73 that contains a line in the form \f[CB]Main\-Class:\f[R]\f[I]classname\f[R]
  74 that defines the class with the
  75 \f[CB]public\ static\ void\ main(String[]\ args)\f[R] method that serves
  76 as your application\[aq]s starting point.
  77 When you use \f[CB]\-jar\f[R], the specified JAR file is the source of all
  78 user classes, and other class path settings are ignored.
  79 If you\[aq]re using JAR files, then see \f[B]jar\f[R].
  80 .RS
  81 .RE
  82 .TP
  83 .B \f[CB]\-m\f[R] or \f[CB]\-\-module\f[R] \f[I]module\f[R][\f[CB]/\f[R]\f[I]mainclass\f[R]]
  84 Executes the main class in a module specified by \f[I]mainclass\f[R] if
  85 it is given, or, if it is not given, the value in the \f[I]module\f[R].
  86 In other words, \f[I]mainclass\f[R] can be used when it is not specified
  87 by the module, or to override the value when it is specified.
  88 .RS
  89 .PP
  90 See \f[B]Standard Options for Java\f[R].
  91 .RE
  92 .TP
  93 .B \f[I]source\-file\f[R]
  94 Only used to launch a single source\-file program.
  95 Specifies the source file that contains the main class when using
  96 source\-file mode.
  97 See \f[B]Using Source\-File Mode to Launch Single\-File Source\-Code
  98 Programs\f[R]
  99 .RS
 100 .RE
 101 .TP
 102 .B \f[I]args\f[R] ...
 103 Optional: Arguments following \f[I]mainclass\f[R], \f[I]source\-file\f[R],
 104 \f[CB]\-jar\f[R] \f[I]jarfile\f[R], and \f[CB]\-m\f[R] or \f[CB]\-\-module\f[R]
 105 \f[I]module\f[R]\f[CB]/\f[R]\f[I]mainclass\f[R] are passed as arguments to
 106 the main class.
 107 .RS
 108 .RE
 109 .SH DESCRIPTION
 110 .PP
 111 The \f[CB]java\f[R] command starts a Java application.
 112 It does this by starting the Java Virtual Machine (JVM), loading the
 113 specified class, and calling that class\[aq]s \f[CB]main()\f[R] method.
 114 The method must be declared \f[CB]public\f[R] and \f[CB]static\f[R], it must
 115 not return any value, and it must accept a \f[CB]String\f[R] array as a
 116 parameter.
 117 The method declaration has the following form:
 118 .RS
 119 .PP
 120 \f[CB]public\ static\ void\ main(String[]\ args)\f[R]
 121 .RE
 122 .PP
 123 In source\-file mode, the \f[CB]java\f[R] command can launch a class
 124 declared in a source file.
 125 See \f[B]Using Source\-File Mode to Launch Single\-File Source\-Code
 126 Programs\f[R] for a description of using the source\-file mode.
 127 .RS
 128 .PP
 129 \f[B]Note:\f[R] You can use the \f[CB]JDK_JAVA_OPTIONS\f[R] launcher
 130 environment variable to prepend its content to the actual command line
 131 of the \f[CB]java\f[R] launcher.
 132 See \f[B]Using the JDK_JAVA_OPTIONS Launcher Environment Variable\f[R].
 133 .RE
 134 .PP
 135 By default, the first argument that isn\[aq]t an option of the
 136 \f[CB]java\f[R] command is the fully qualified name of the class to be
 137 called.
 138 If \f[CB]\-jar\f[R] is specified, then its argument is the name of the JAR
 139 file containing class and resource files for the application.
 140 The startup class must be indicated by the \f[CB]Main\-Class\f[R] manifest
 141 header in its manifest file.
 142 .PP
 143 Arguments after the class file name or the JAR file name are passed to
 144 the \f[CB]main()\f[R] method.
 145 .SS \f[CB]javaw\f[R]
 146 .PP
 147 \f[B]Windows:\f[R] The \f[CB]javaw\f[R] command is identical to
 148 \f[CB]java\f[R], except that with \f[CB]javaw\f[R] there\[aq]s no associated
 149 console window.
 150 Use \f[CB]javaw\f[R] when you don\[aq]t want a command prompt window to
 151 appear.
 152 The \f[CB]javaw\f[R] launcher will, however, display a dialog box with
 153 error information if a launch fails.
 154 .SH USING SOURCE\-FILE MODE TO LAUNCH SINGLE\-FILE SOURCE\-CODE PROGRAMS
 155 .PP
 156 To launch a class declared in a source file, run the \f[CB]java\f[R]
 157 launcher in source\-file mode.
 158 Entering source\-file mode is determined by two items on the
 159 \f[CB]java\f[R] command line:
 160 .IP \[bu] 2
 161 The first item on the command line that is not an option or part of an
 162 option.
 163 In other words, the item in the command line that would otherwise be the
 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
 206 \f[CB]java\ HelloWorld.java\f[R]
 207 .RE
 208 .PP
 209 The example illustrates that the class can be in a named package, and
 210 does not need to be in the unnamed package.
 211 This use of source\-file mode is informally equivalent to using the
 212 following two commands where \f[CB]hello.World\f[R] is the name of the
 213 class in the package:
 214 .IP
 215 .nf
 216 \f[CB]
 217 javac\ \-d\ <memory>\ HelloWorld.java
 218 java\ \-cp\ <memory>\ hello.World
 219 \f[R]
 220 .fi
 221 .PP
 222 \f[B]In source\-file mode, any additional command\-line options are
 223 processed as follows:\f[R]
 224 .IP \[bu] 2
 225 The launcher scans the options specified before the source file for any
 226 that are relevant in order to compile the source file.
 227 .RS 2
 228 .PP
 229 This includes: \f[CB]\-\-class\-path\f[R], \f[CB]\-\-module\-path\f[R],
 230 \f[CB]\-\-add\-exports\f[R], \f[CB]\-\-add\-modules\f[R],
 231 \f[CB]\-\-limit\-modules\f[R], \f[CB]\-\-patch\-module\f[R],
 232 \f[CB]\-\-upgrade\-module\-path\f[R], and any variant forms of those
 233 options.
 234 It also includes the new \f[CB]\-\-enable\-preview\f[R] option, described
 235 in JEP 12.
 236 .RE
 237 .IP \[bu] 2
 238 No provision is made to pass any additional options to the compiler,
 239 such as \f[CB]\-processor\f[R] or \f[CB]\-Werror\f[R].
 240 .IP \[bu] 2
 241 Command\-line argument files (\f[CB]\@\f[R]\-files) may be used in the
 242 standard way.
 243 Long lists of arguments for either the VM or the program being invoked
 244 may be placed in files specified on the command\-line by prefixing the
 245 filename with an \f[CB]\@\f[R] character.
 246 .PP
 247 \f[B]In source\-file mode, compilation proceeds as follows:\f[R]
 248 .IP \[bu] 2
 249 Any command\-line options that are relevant to the compilation
 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,
 291 as though \f[CB]\-\-add\-modules=ALL\-DEFAULT\f[R] is in effect.
 292 This is in addition to any other \f[CB]\-\-add\-module\f[R] options that
 293 may be have been specified on the command line.
 294 .IP \[bu] 2
 295 Any arguments appearing after the name of the file on the command line
 296 are passed to the standard main method in the obvious way.
 297 .IP \[bu] 2
 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]
 339 $\ export\ JDK_JAVA_OPTIONS=\[aq]\-g\ \@file1\ \-Dprop=value\ \@file2\ \-Dws.prop="white\ spaces"\[aq]
 340 $\ java\ \-Xint\ \@file3
 341 \f[R]
 342 .fi
 343 .PP
 344 is equivalent to the command line:
 345 .IP
 346 .nf
 347 \f[CB]
 348 java\ \-g\ \@file1\ \-Dprop=value\ \@file2\ \-Dws.prop="white\ spaces"\ \-Xint\ \@file3
 349 \f[R]
 350 .fi
 351 .SH OVERVIEW OF JAVA OPTIONS
 352 .PP
 353 The \f[CB]java\f[R] command supports a wide range of options in the
 354 following categories:
 355 .IP \[bu] 2
 356 \f[B]Standard Options for Java\f[R]: Options guaranteed to be supported
 357 by all implementations of the Java Virtual Machine (JVM).
 358 They\[aq]re used for common actions, such as checking the version of the
 359 JRE, setting the class path, enabling verbose output, and so on.
 360 .IP \[bu] 2
 361 \f[B]Extra Options for Java\f[R]: General purpose options that are
 362 specific to the Java HotSpot Virtual Machine.
 363 They aren\[aq]t guaranteed to be supported by all JVM implementations,
 364 and are subject to change.
 365 These options start with \f[CB]\-X\f[R].
 366 .PP
 367 The advanced options aren\[aq]t recommended for casual use.
 368 These are developer options used for tuning specific areas of the Java
 369 HotSpot Virtual Machine operation that often have specific system
 370 requirements and may require privileged access to system configuration
 371 parameters.
 372 Several examples of performance tuning are provided in \f[B]Performance
 373 Tuning Examples\f[R].
 374 These options aren\[aq]t guaranteed to be supported by all JVM
 375 implementations and are subject to change.
 376 Advanced options start with \f[CB]\-XX\f[R].
 377 .IP \[bu] 2
 378 \f[B]Advanced Runtime Options for Java\f[R]: Control the runtime behavior
 379 of the Java HotSpot VM.
 380 .IP \[bu] 2
 381 \f[B]Advanced JIT Compiler Options for java\f[R]: Control the dynamic
 382 just\-in\-time (JIT) compilation performed by the Java HotSpot VM.
 383 .IP \[bu] 2
 384 \f[B]Advanced Serviceability Options for Java\f[R]: Enable gathering
 385 system information and performing extensive debugging.
 386 .IP \[bu] 2
 387 \f[B]Advanced Garbage Collection Options for Java\f[R]: Control how
 388 garbage collection (GC) is performed by the Java HotSpot
 389 .PP
 390 Boolean options are used to either enable a feature that\[aq]s disabled
 391 by default or disable a feature that\[aq]s enabled by default.
 392 Such options don\[aq]t require a parameter.
 393 Boolean \f[CB]\-XX\f[R] options are enabled using the plus sign
 394 (\f[CB]\-XX:+\f[R]\f[I]OptionName\f[R]) and disabled using the minus sign
 395 (\f[CB]\-XX:\-\f[R]\f[I]OptionName\f[R]).
 396 .PP
 397 For options that require an argument, the argument may be separated from
 398 the option name by a space, a colon (:), or an equal sign (=), or the
 399 argument may directly follow the option (the exact syntax differs for
 400 each option).
 401 If you\[aq]re expected to specify the size in bytes, then you can use no
 402 suffix, or use the suffix \f[CB]k\f[R] or \f[CB]K\f[R] for kilobytes (KB),
 403 \f[CB]m\f[R] or \f[CB]M\f[R] for megabytes (MB), or \f[CB]g\f[R] or \f[CB]G\f[R]
 404 for gigabytes (GB).
 405 For example, to set the size to 8 GB, you can specify either
 406 \f[CB]8g\f[R], \f[CB]8192m\f[R], \f[CB]8388608k\f[R], or \f[CB]8589934592\f[R]
 407 as the argument.
 408 If you are expected to specify the percentage, then use a number from 0
 409 to 1.
 410 For example, specify \f[CB]0.25\f[R] for 25%.
 411 .PP
 412 The following sections describe the options that are obsolete,
 413 deprecated, and removed:
 414 .IP \[bu] 2
 415 \f[B]Deprecated Java Options\f[R]: Accepted and acted upon \-\-\- a
 416 warning is issued when they\[aq]re used.
 417 .IP \[bu] 2
 418 \f[B]Obsolete Java Options\f[R]: Accepted but ignored \-\-\- a warning is
 419 issued when they\[aq]re used.
 420 .IP \[bu] 2
 421 \f[B]Removed Java Options\f[R]: Removed \-\-\- using them results in an
 422 error.
 423 .SH STANDARD OPTIONS FOR JAVA
 424 .PP
 425 These are the most commonly used options supported by all
 426 implementations of the JVM.
 427 .RS
 428 .PP
 429 \f[B]Note:\f[R] To specify an argument for a long option, you can use
 430 either \f[CB]\-\-\f[R]\f[I]name\f[R]\f[CB]=\f[R]\f[I]value\f[R] or
 431 \f[CB]\-\-\f[R]\f[I]name\f[R] \f[I]value\f[R].
 432 .RE
 433 .TP
 434 .B \f[CB]\-agentlib:\f[R]\f[I]libname\f[R][\f[CB]=\f[R]\f[I]options\f[R]]
 435 Loads the specified native agent library.
 436 After the library name, a comma\-separated list of options specific to
 437 the library can be used.
 438 .RS
 439 .IP \[bu] 2
 440 \f[B]Oracle Solaris, Linux, and macOS:\f[R] If the option
 441 \f[CB]\-agentlib:foo\f[R] is specified, then the JVM attempts to load the
 442 library named \f[CB]libfoo.so\f[R] in the location specified by the
 443 \f[CB]LD_LIBRARY_PATH\f[R] system variable (on macOS this variable is
 444 \f[CB]DYLD_LIBRARY_PATH\f[R]).
 445 .IP \[bu] 2
 446 \f[B]Windows:\f[R] If the option \f[CB]\-agentlib:foo\f[R] is specified,
 447 then the JVM attempts to load the library named \f[CB]foo.dll\f[R] in the
 448 location specified by the \f[CB]PATH\f[R] system variable.
 449 .RS 2
 450 .PP
 451 The following example shows how to load the Java Debug Wire Protocol
 452 (JDWP) library and listen for the socket connection on port 8000,
 453 suspending the JVM before the main class loads:
 454 .RS
 455 .PP
 456 \f[CB]\-agentlib:jdwp=transport=dt_socket,server=y,address=8000\f[R]
 457 .RE
 458 .RE
 459 .RE
 460 .TP
 461 .B \f[CB]\-agentpath:\f[R]\f[I]pathname\f[R][\f[CB]=\f[R]\f[I]options\f[R]]
 462 Loads the native agent library specified by the absolute path name.
 463 This option is equivalent to \f[CB]\-agentlib\f[R] but uses the full path
 464 and file name of the library.
 465 .RS
 466 .RE
 467 .TP
 468 .B \f[CB]\-\-class\-path\f[R] \f[I]classpath\f[R], \f[CB]\-classpath\f[R] \f[I]classpath\f[R], or \f[CB]\-cp\f[R] \f[I]classpath\f[R]
 469 A semicolon (\f[CB];\f[R]) separated list of directories, JAR archives,
 470 and ZIP archives to search for class files.
 471 .RS
 472 .PP
 473 Specifying \f[I]classpath\f[R] overrides any setting of the
 474 \f[CB]CLASSPATH\f[R] environment variable.
 475 If the class path option isn\[aq]t used and \f[I]classpath\f[R] isn\[aq]t
 476 set, then the user class path consists of the current directory (.).
 477 .PP
 478 As a special convenience, a class path element that contains a base name
 479 of an asterisk (*) is considered equivalent to specifying a list of all
 480 the files in the directory with the extension \f[CB]\&.jar\f[R] or
 481 \f[CB]\&.JAR\f[R] .
 482 A Java program can\[aq]t tell the difference between the two
 483 invocations.
 484 For example, if the directory mydir contains \f[CB]a.jar\f[R] and
 485 \f[CB]b.JAR\f[R], then the class path element mydir/* is expanded to
 486 \f[CB]A.jar:b.JAR\f[R], except that the order of JAR files is unspecified.
 487 All \f[CB]\&.jar\f[R] files in the specified directory, even hidden ones,
 488 are included in the list.
 489 A class path entry consisting of an asterisk (*) expands to a list of
 490 all the jar files in the current directory.
 491 The \f[CB]CLASSPATH\f[R] environment variable, where defined, is similarly
 492 expanded.
 493 Any class path wildcard expansion that occurs before the Java VM is
 494 started.
 495 Java programs never see wildcards that aren\[aq]t expanded except by
 496 querying the environment, such as by calling
 497 \f[CB]System.getenv("CLASSPATH")\f[R].
 498 .RE
 499 .TP
 500 .B \f[CB]\-\-disable\-\@files\f[R]
 501 Can be used anywhere on the command line, including in an argument file,
 502 to prevent further \f[CB]\@filename\f[R] expansion.
 503 This option stops expanding \f[CB]\@\f[R]\-argfiles after the option.
 504 .RS
 505 .RE
 506 .TP
 507 .B \f[CB]\-\-enable\-preview\f[R]
 508 Allows classes to depend on \f[B]preview features\f[R]
 509 [https://docs.oracle.com/en/java/javase/12/language/index.html#JSLAN\-GUID\-5A82FE0E\-0CA4\-4F1F\-B075\-564874FE2823]
 510 of the release.
 511 .RS
 512 .RE
 513 .TP
 514 .B \f[CB]\-\-module\-path\f[R] \f[I]modulepath\f[R]... or \f[CB]\-p\f[R] \f[I]modulepath\f[R]
 515 A semicolon (\f[CB];\f[R]) separated list of directories in which each
 516 directory is a directory of modules.
 517 .RS
 518 .RE
 519 .TP
 520 .B \f[CB]\-\-upgrade\-module\-path\f[R] \f[I]modulepath\f[R]...
 521 A semicolon (\f[CB];\f[R]) separated list of directories in which each
 522 directory is a directory of modules that replace upgradeable modules in
 523 the runtime image.
 524 .RS
 525 .RE
 526 .TP
 527 .B \f[CB]\-\-add\-modules\f[R] \f[I]module\f[R][\f[CB],\f[R]\f[I]module\f[R]...]
 528 Specifies the root modules to resolve in addition to the initial module.
 529 \f[I]module\f[R] also can be \f[CB]ALL\-DEFAULT\f[R], \f[CB]ALL\-SYSTEM\f[R],
 530 and \f[CB]ALL\-MODULE\-PATH\f[R].
 531 .RS
 532 .RE
 533 .TP
 534 .B \f[CB]\-\-list\-modules\f[R]
 535 Lists the observable modules and then exits.
 536 .RS
 537 .RE
 538 .TP
 539 .B \f[CB]\-d\f[R] \f[I]module_name\f[R] or \f[CB]\-\-describe\-module\f[R] \f[I]module_name\f[R]
 540 Describes a specified module and then exits.
 541 .RS
 542 .RE
 543 .TP
 544 .B \f[CB]\-\-dry\-run\f[R]
 545 Creates the VM but doesn\[aq]t execute the main method.
 546 This \f[CB]\-\-dry\-run\f[R] option might be useful for validating the
 547 command\-line options such as the module system configuration.
 548 .RS
 549 .RE
 550 .TP
 551 .B \f[CB]\-\-validate\-modules\f[R]
 552 Validates all modules and exit.
 553 This option is helpful for finding conflicts and other errors with
 554 modules on the module path.
 555 .RS
 556 .RE
 557 .TP
 558 .B \f[CB]\-D\f[R]\f[I]property\f[R]\f[CB]=\f[R]\f[I]value\f[R]
 559 Sets a system property value.
 560 The \f[I]property\f[R] variable is a string with no spaces that
 561 represents the name of the property.
 562 The \f[I]value\f[R] variable is a string that represents the value of the
 563 property.
 564 If \f[I]value\f[R] is a string with spaces, then enclose it in quotation
 565 marks (for example \f[CB]\-Dfoo="foo\ bar"\f[R]).
 566 .RS
 567 .RE
 568 .TP
 569 .B \f[CB]\-disableassertions\f[R][\f[CB]:\f[R][\f[I]packagename\f[R]]...|\f[CB]:\f[R]\f[I]classname\f[R]] or \f[CB]\-da\f[R][\f[CB]:\f[R][\f[I]packagename\f[R]]...|\f[CB]:\f[R]\f[I]classname\f[R]]
 570 Disables assertions.
 571 By default, assertions are disabled in all packages and classes.
 572 With no arguments, \f[CB]\-disableassertions\f[R] (\f[CB]\-da\f[R]) disables
 573 assertions in all packages and classes.
 574 With the \f[I]packagename\f[R] argument ending in \f[CB]\&...\f[R], the
 575 switch disables assertions in the specified package and any subpackages.
 576 If the argument is simply \f[CB]\&...\f[R], then the switch disables
 577 assertions in the unnamed package in the current working directory.
 578 With the \f[I]classname\f[R] argument, the switch disables assertions in
 579 the specified class.
 580 .RS
 581 .PP
 582 The \f[CB]\-disableassertions\f[R] (\f[CB]\-da\f[R]) option applies to all
 583 class loaders and to system classes (which don\[aq]t have a class
 584 loader).
 585 There\[aq]s one exception to this rule: If the option is provided with
 586 no arguments, then it doesn\[aq]t apply to system classes.
 587 This makes it easy to disable assertions in all classes except for
 588 system classes.
 589 The \f[CB]\-disablesystemassertions\f[R] option enables you to disable
 590 assertions in all system classes.
 591 To explicitly enable assertions in specific packages or classes, use the
 592 \f[CB]\-enableassertions\f[R] (\f[CB]\-ea\f[R]) option.
 593 Both options can be used at the same time.
 594 For example, to run the \f[CB]MyClass\f[R] application with assertions
 595 enabled in the package \f[CB]com.wombat.fruitbat\f[R] (and any
 596 subpackages) but disabled in the class
 597 \f[CB]com.wombat.fruitbat.Brickbat\f[R], use the following command:
 598 .RS
 599 .PP
 600 \f[CB]java\ \-ea:com.wombat.fruitbat...\ \-da:com.wombat.fruitbat.Brickbat\ MyClass\f[R]
 601 .RE
 602 .RE
 603 .TP
 604 .B \f[CB]\-disablesystemassertions\f[R] or \f[CB]\-dsa\f[R]
 605 Disables assertions in all system classes.
 606 .RS
 607 .RE
 608 .TP
 609 .B \f[CB]\-enableassertions\f[R][\f[CB]:\f[R][\f[I]packagename\f[R]]...|\f[CB]:\f[R]\f[I]classname\f[R]] or \f[CB]\-ea\f[R][\f[CB]:\f[R][\f[I]packagename\f[R]]...|\f[CB]:\f[R]\f[I]classname\f[R]]
 610 Enables assertions.
 611 By default, assertions are disabled in all packages and classes.
 612 With no arguments, \f[CB]\-enableassertions\f[R] (\f[CB]\-ea\f[R]) enables
 613 assertions in all packages and classes.
 614 With the \f[I]packagename\f[R] argument ending in \f[CB]\&...\f[R], the
 615 switch enables assertions in the specified package and any subpackages.
 616 If the argument is simply \f[CB]\&...\f[R], then the switch enables
 617 assertions in the unnamed package in the current working directory.
 618 With the \f[I]classname\f[R] argument, the switch enables assertions in
 619 the specified class.
 620 .RS
 621 .PP
 622 The \f[CB]\-enableassertions\f[R] (\f[CB]\-ea\f[R]) option applies to all
 623 class loaders and to system classes (which don\[aq]t have a class
 624 loader).
 625 There\[aq]s one exception to this rule: If the option is provided with
 626 no arguments, then it doesn\[aq]t apply to system classes.
 627 This makes it easy to enable assertions in all classes except for system
 628 classes.
 629 The \f[CB]\-enablesystemassertions\f[R] option provides a separate switch
 630 to enable assertions in all system classes.
 631 To explicitly disable assertions in specific packages or classes, use
 632 the \f[CB]\-disableassertions\f[R] (\f[CB]\-da\f[R]) option.
 633 If a single command contains multiple instances of these switches, then
 634 they\[aq]re processed in order, before loading any classes.
 635 For example, to run the \f[CB]MyClass\f[R] application with assertions
 636 enabled only in the package \f[CB]com.wombat.fruitbat\f[R] (and any
 637 subpackages) but disabled in the class
 638 \f[CB]com.wombat.fruitbat.Brickbat\f[R], use the following command:
 639 .RS
 640 .PP
 641 \f[CB]java\ \-ea:com.wombat.fruitbat...\ \-da:com.wombat.fruitbat.Brickbat\ MyClass\f[R]
 642 .RE
 643 .RE
 644 .TP
 645 .B \f[CB]\-enablesystemassertions\f[R] or \f[CB]\-esa\f[R]
 646 Enables assertions in all system classes.
 647 .RS
 648 .RE
 649 .TP
 650 .B \f[CB]\-help\f[R], \f[CB]\-h\f[R], or \f[CB]\-?\f[R]
 651 Prints the help message to the error stream.
 652 .RS
 653 .RE
 654 .TP
 655 .B \f[CB]\-\-help\f[R]
 656 Prints the help message to the output stream.
 657 .RS
 658 .RE
 659 .TP
 660 .B \f[CB]\-javaagent:\f[R]\f[I]jarpath\f[R][\f[CB]=\f[R]\f[I]options\f[R]]
 661 Loads the specified Java programming language agent.
 662 See \f[CB]java.lang.instrument\f[R].
 663 .RS
 664 .RE
 665 .TP
 666 .B \f[CB]\-\-show\-version\f[R]
 667 Prints the product version to the output stream and continues.
 668 .RS
 669 .RE
 670 .TP
 671 .B \f[CB]\-showversion\f[R]
 672 Prints the product version to the error stream and continues.
 673 .RS
 674 .RE
 675 .TP
 676 .B \f[CB]\-\-show\-module\-resolution\f[R]
 677 Shows module resolution output during startup.
 678 .RS
 679 .RE
 680 .TP
 681 .B \f[CB]\-splash:\f[R]\f[I]imagepath\f[R]
 682 Shows the splash screen with the image specified by \f[I]imagepath\f[R].
 683 HiDPI scaled images are automatically supported and used if available.
 684 The unscaled image file name, such as \f[CB]image.ext\f[R], should always
 685 be passed as the argument to the \f[CB]\-splash\f[R] option.
 686 The most appropriate scaled image provided is picked up automatically.
 687 .RS
 688 .PP
 689 For example, to show the \f[CB]splash.gif\f[R] file from the
 690 \f[CB]images\f[R] directory when starting your application, use the
 691 following option:
 692 .RS
 693 .PP
 694 \f[CB]\-splash:images/splash.gif\f[R]
 695 .RE
 696 .PP
 697 See the SplashScreen API documentation for more information.
 698 .RE
 699 .TP
 700 .B \f[CB]\-verbose:class\f[R]
 701 Displays information about each loaded class.
 702 .RS
 703 .RE
 704 .TP
 705 .B \f[CB]\-verbose:gc\f[R]
 706 Displays information about each garbage collection (GC) event.
 707 .RS
 708 .RE
 709 .TP
 710 .B \f[CB]\-verbose:jni\f[R]
 711 Displays information about the use of native methods and other Java
 712 Native Interface (JNI) activity.
 713 .RS
 714 .RE
 715 .TP
 716 .B \f[CB]\-verbose:module\f[R]
 717 Displays information about the modules in use.
 718 .RS
 719 .RE
 720 .TP
 721 .B \f[CB]\-\-version\f[R]
 722 Prints product version to the output stream and exits.
 723 .RS
 724 .RE
 725 .TP
 726 .B \f[CB]\-version\f[R]
 727 Prints product version to the error stream and exits.
 728 .RS
 729 .RE
 730 .TP
 731 .B \f[CB]\-X\f[R]
 732 Prints the help on extra options to the error stream.
 733 .RS
 734 .RE
 735 .TP
 736 .B \f[CB]\-\-help\-extra\f[R]
 737 Prints the help on extra options to the output stream.
 738 .RS
 739 .RE
 740 .TP
 741 .B \f[CB]\@\f[R]\f[I]argfile\f[R]
 742 Specifies one or more argument files prefixed by \f[CB]\@\f[R] used by the
 743 \f[CB]java\f[R] command.
 744 It isn\[aq]t uncommon for the \f[CB]java\f[R] command line to be very long
 745 because of the \f[CB]\&.jar\f[R] files needed in the classpath.
 746 The \f[CB]\@\f[R]\f[I]argfile\f[R] option overcomes command\-line length
 747 limitations by enabling the launcher to expand the contents of argument
 748 files after shell expansion, but before argument processing.
 749 Contents in the argument files are expanded because otherwise, they
 750 would be specified on the command line until the
 751 \f[CB]\-\-disable\-\@files\f[R] option was encountered.
 752 .RS
 753 .PP
 754 The argument files can also contain the main class name and all options.
 755 If an argument file contains all of the options required by the
 756 \f[CB]java\f[R] command, then the command line could simply be:
 757 .RS
 758 .PP
 759 \f[CB]java\ \@\f[R]\f[I]argfile\f[R]
 760 .RE
 761 .PP
 762 See \f[B]java Command\-Line Argument Files\f[R] for a description and
 763 examples of using \f[CB]\@\f[R]\-argfiles.
 764 .RE
 765 .SH EXTRA OPTIONS FOR JAVA
 766 .PP
 767 The following \f[CB]java\f[R] options are general purpose options that are
 768 specific to the Java HotSpot Virtual Machine.
 769 .TP
 770 .B \f[CB]\-Xbatch\f[R]
 771 Disables background compilation.
 772 By default, the JVM compiles the method as a background task, running
 773 the method in interpreter mode until the background compilation is
 774 finished.
 775 The \f[CB]\-Xbatch\f[R] flag disables background compilation so that
 776 compilation of all methods proceeds as a foreground task until
 777 completed.
 778 This option is equivalent to \f[CB]\-XX:\-BackgroundCompilation\f[R].
 779 .RS
 780 .RE
 781 .TP
 782 .B \f[CB]\-Xbootclasspath/a:\f[R]\f[I]directories\f[R]|\f[I]zip\f[R]|\f[I]JAR\-files\f[R]
 783 Specifies a list of directories, JAR files, and ZIP archives to append
 784 to the end of the default bootstrap class path.
 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
 863 young generation to 256 MB using various units:
 864 .RS
 865 .IP
 866 .nf
 867 \f[CB]
 868 \-Xmn256m
 869 \-Xmn262144k
 870 \-Xmn268435456
 871 \f[R]
 872 .fi
 873 .PP
 874 Instead of the \f[CB]\-Xmn\f[R] option to set both the initial and maximum
 875 size of the heap for the young generation, you can use
 876 \f[CB]\-XX:NewSize\f[R] to set the initial size and
 877 \f[CB]\-XX:MaxNewSize\f[R] to set the maximum size.
 878 .RE
 879 .TP
 880 .B \f[CB]\-Xms\f[R] \f[I]size\f[R]
 881 Sets the minimum and initial size (in bytes) of the heap.
 882 This value must be a multiple of 1024 and greater than 1 MB.
 883 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
 884 \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]
 885 to indicate gigabytes.
 886 The following examples show how to set the size of allocated memory to 6
 887 MB using various units:
 888 .RS
 889 .IP
 890 .nf
 891 \f[CB]
 892 \-Xms6291456
 893 \-Xms6144k
 894 \-Xms6m
 895 \f[R]
 896 .fi
 897 .PP
 898 Instead of the \f[CB]\-Xms\f[R] option to set both the minimum and initial
 899 size of the heap, you can use \f[CB]\-XX:MinHeapSize\f[R] to set the
 900 minimum size and \f[CB]\-XX:InitialHeapSize\f[R] to set the initial size.
 901 .PP
 902 If you don\[aq]t set this option, the initial size is set as the sum of
 903 the sizes allocated for the old generation and the young generation.
 904 The initial size of the heap for the young generation can be set using
 905 the \f[CB]\-Xmn\f[R] option or the \f[CB]\-XX:NewSize\f[R] option.
 906 .RE
 907 .TP
 908 .B \f[CB]\-Xmx\f[R] \f[I]size\f[R]
 909 Specifies the maximum size (in bytes) of the heap.
 910 This value must be a multiple of 1024 and greater than 2 MB.
 911 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
 912 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
 913 \f[CB]G\f[R] to indicate gigabytes.
 914 The default value is chosen at runtime based on system configuration.
 915 For server deployments, \f[CB]\-Xms\f[R] and \f[CB]\-Xmx\f[R] are often set
 916 to the same value.
 917 The following examples show how to set the maximum allowed size of
 918 allocated memory to 80 MB using various units:
 919 .RS
 920 .IP
 921 .nf
 922 \f[CB]
 923 \-Xmx83886080
 924 \-Xmx81920k
 925 \-Xmx80m
 926 \f[R]
 927 .fi
 928 .PP
 929 The \f[CB]\-Xmx\f[R] option is equivalent to \f[CB]\-XX:MaxHeapSize\f[R].
 930 .RE
 931 .TP
 932 .B \f[CB]\-Xnoclassgc\f[R]
 933 Disables garbage collection (GC) of classes.
 934 This can save some GC time, which shortens interruptions during the
 935 application run.
 936 When you specify \f[CB]\-Xnoclassgc\f[R] at startup, the class objects in
 937 the application are left untouched during GC and are always be
 938 considered live.
 939 This can result in more memory being permanently occupied which, if not
 940 used carefully, throws an out\-of\-memory exception.
 941 .RS
 942 .RE
 943 .TP
 944 .B \f[CB]\-Xrs\f[R]
 945 Reduces the use of operating system signals by the JVM.
 946 Shutdown hooks enable the orderly shutdown of a Java application by
 947 running user cleanup code (such as closing database connections) at
 948 shutdown, even if the JVM terminates abruptly.
 949 .RS
 950 .IP \[bu] 2
 951 \f[B]Oracle Solaris, Linux, and macOS:\f[R]
 952 .RS 2
 953 .IP \[bu] 2
 954 The JVM catches signals to implement shutdown hooks for unexpected
 955 termination.
 956 The JVM uses \f[CB]SIGHUP\f[R], \f[CB]SIGINT\f[R], and \f[CB]SIGTERM\f[R] to
 957 initiate the running of shutdown hooks.
 958 .IP \[bu] 2
 959 Applications embedding the JVM frequently need to trap signals such as
 960 \f[CB]SIGINT\f[R] or \f[CB]SIGTERM\f[R], which can lead to interference with
 961 the JVM signal handlers.
 962 The \f[CB]\-Xrs\f[R] option is available to address this issue.
 963 When \f[CB]\-Xrs\f[R] is used, the signal masks for \f[CB]SIGINT\f[R],
 964 \f[CB]SIGTERM\f[R], \f[CB]SIGHUP\f[R], and \f[CB]SIGQUIT\f[R] aren\[aq]t
 965 changed by the JVM, and signal handlers for these signals aren\[aq]t
 966 installed.
 967 .RE
 968 .IP \[bu] 2
 969 \f[B]Windows:\f[R]
 970 .RS 2
 971 .IP \[bu] 2
 972 The JVM watches for console control events to implement shutdown hooks
 973 for unexpected termination.
 974 Specifically, the JVM registers a console control handler that begins
 975 shutdown\-hook processing and returns \f[CB]TRUE\f[R] for
 976 \f[CB]CTRL_C_EVENT\f[R], \f[CB]CTRL_CLOSE_EVENT\f[R],
 977 \f[CB]CTRL_LOGOFF_EVENT\f[R], and \f[CB]CTRL_SHUTDOWN_EVENT\f[R].
 978 .IP \[bu] 2
 979 The JVM uses a similar mechanism to implement the feature of dumping
 980 thread stacks for debugging purposes.
 981 The JVM uses \f[CB]CTRL_BREAK_EVENT\f[R] to perform thread dumps.
 982 .IP \[bu] 2
 983 If the JVM is run as a service (for example, as a servlet engine for a
 984 web server), then it can receive \f[CB]CTRL_LOGOFF_EVENT\f[R] but
 985 shouldn\[aq]t initiate shutdown because the operating system doesn\[aq]t
 986 actually terminate the process.
 987 To avoid possible interference such as this, the \f[CB]\-Xrs\f[R] option
 988 can be used.
 989 When the \f[CB]\-Xrs\f[R] option is used, the JVM doesn\[aq]t install a
 990 console control handler, implying that it doesn\[aq]t watch for or
 991 process \f[CB]CTRL_C_EVENT\f[R], \f[CB]CTRL_CLOSE_EVENT\f[R],
 992 \f[CB]CTRL_LOGOFF_EVENT\f[R], or \f[CB]CTRL_SHUTDOWN_EVENT\f[R].
 993 .RE
 994 .PP
 995 There are two consequences of specifying \f[CB]\-Xrs\f[R]:
 996 .IP \[bu] 2
 997 \f[B]Oracle Solaris, Linux, and macOS:\f[R] \f[CB]SIGQUIT\f[R] thread dumps
 998 aren\[aq]t available.
 999 .IP \[bu] 2
1000 \f[B]Windows:\f[R] Ctrl + Break thread dumps aren\[aq]t available.
1001 .PP
1002 User code is responsible for causing shutdown hooks to run, for example,
1003 by calling the \f[CB]System.exit()\f[R] when the JVM is to be terminated.
1004 .RE
1005 .TP
1006 .B \f[CB]\-Xshare:\f[R]\f[I]mode\f[R]
1007 Sets the class data sharing (CDS) mode.
1008 .RS
1009 .PP
1010 Possible \f[I]mode\f[R] arguments for this option include the following:
1011 .TP
1012 .B \f[CB]auto\f[R]
1013 Use shared class data if possible (default).
1014 .RS
1015 .RE
1016 .TP
1017 .B \f[CB]on\f[R]
1018 Require using shared class data, otherwise fail.
1019 .RS
1020 .RE
1021 .RS
1022 .PP
1023 \f[B]Note:\f[R] The \f[CB]\-Xshare:on\f[R] option is used for testing
1024 purposes only and may cause intermittent failures due to the use of
1025 address space layout randomization by the operation system.
1026 This option should not be used in production environments.
1027 .RE
1028 .TP
1029 .B \f[CB]off\f[R]
1030 Do not attempt to use shared class data.
1031 .RS
1032 .RE
1033 .RE
1034 .TP
1035 .B \f[CB]\-XshowSettings\f[R]
1036 Shows all settings and then continues.
1037 .RS
1038 .RE
1039 .TP
1040 .B \f[CB]\-XshowSettings:\f[R]\f[I]category\f[R]
1041 Shows settings and continues.
1042 Possible \f[I]category\f[R] arguments for this option include the
1043 following:
1044 .RS
1045 .TP
1046 .B \f[CB]all\f[R]
1047 Shows all categories of settings.
1048 This is the default value.
1049 .RS
1050 .RE
1051 .TP
1052 .B \f[CB]locale\f[R]
1053 Shows settings related to locale.
1054 .RS
1055 .RE
1056 .TP
1057 .B \f[CB]properties\f[R]
1058 Shows settings related to system properties.
1059 .RS
1060 .RE
1061 .TP
1062 .B \f[CB]vm\f[R]
1063 Shows the settings of the JVM.
1064 .RS
1065 .RE
1066 .TP
1067 .B \f[CB]system\f[R]
1068 \f[B]Linux:\f[R] Shows host system or container configuration and
1069 continues.
1070 .RS
1071 .RE
1072 .RE
1073 .TP
1074 .B \f[CB]\-Xss\f[R] \f[I]size\f[R]
1075 Sets the thread stack size (in bytes).
1076 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate KB, \f[CB]m\f[R] or
1077 \f[CB]M\f[R] to indicate MB, or \f[CB]g\f[R] or \f[CB]G\f[R] to indicate GB.
1078 The default value depends on the platform:
1079 .RS
1080 .IP \[bu] 2
1081 Linux/x64 (64\-bit): 1024 KB
1082 .IP \[bu] 2
1083 macOS (64\-bit): 1024 KB
1084 .IP \[bu] 2
1085 Oracle Solaris (64\-bit): 1024 KB
1086 .IP \[bu] 2
1087 Windows: The default value depends on virtual memory
1088 .PP
1089 The following examples set the thread stack size to 1024 KB in different
1090 units:
1091 .IP
1092 .nf
1093 \f[CB]
1094 \-Xss1m
1095 \-Xss1024k
1096 \-Xss1048576
1097 \f[R]
1098 .fi
1099 .PP
1100 This option is similar to \f[CB]\-XX:ThreadStackSize\f[R].
1101 .RE
1102 .TP
1103 .B \f[CB]\-\-add\-reads\f[R] \f[I]module\f[R]\f[CB]=\f[R]\f[I]target\-module\f[R](\f[CB],\f[R]\f[I]target\-module\f[R])*
1104 Updates \f[I]module\f[R] to read the \f[I]target\-module\f[R], regardless
1105 of the module declaration.
1106 \f[I]target\-module\f[R] can be all unnamed to read all unnamed modules.
1107 .RS
1108 .RE
1109 .TP
1110 .B \f[CB]\-\-add\-exports\f[R] \f[I]module\f[R]\f[CB]/\f[R]\f[I]package\f[R]\f[CB]=\f[R]\f[I]target\-module\f[R](\f[CB],\f[R]\f[I]target\-module\f[R])*
1111 Updates \f[I]module\f[R] to export \f[I]package\f[R] to
1112 \f[I]target\-module\f[R], regardless of module declaration.
1113 The \f[I]target\-module\f[R] can be all unnamed to export to all unnamed
1114 modules.
1115 .RS
1116 .RE
1117 .TP
1118 .B \f[CB]\-\-add\-opens\f[R] \f[I]module\f[R]\f[CB]/\f[R]\f[I]package\f[R]\f[CB]=\f[R]\f[I]target\-module\f[R](\f[CB],\f[R]\f[I]target\-module\f[R])*
1119 Updates \f[I]module\f[R] to open \f[I]package\f[R] to
1120 \f[I]target\-module\f[R], regardless of module declaration.
1121 .RS
1122 .RE
1123 .TP
1124 .B \f[CB]\-\-illegal\-access=\f[R]\f[I]parameter\f[R]
1125 When present at run time, \f[CB]\-\-illegal\-access=\f[R] takes a keyword
1126 \f[I]parameter\f[R] to specify a mode of operation:
1127 .RS
1128 .RS
1129 .PP
1130 \f[B]Note:\f[R] This option will be removed in a future release.
1131 .RE
1132 .IP \[bu] 2
1133 \f[CB]permit\f[R]: This mode opens each package in each module in the
1134 run\-time image to code in all unnamed modules ( such as code on the
1135 class path), if that package existed in JDK 8.
1136 This enables both static access, (for example, by compiled bytecode, and
1137 deep reflective access) through the platform\[aq]s various reflection
1138 APIs.
1139 The first reflective\-access operation to any such package causes a
1140 warning to be issued.
1141 However, no warnings are issued after the first occurrence.
1142 This single warning describes how to enable further warnings.
1143 This mode is the default for the current JDK but will change in a future
1144 release.
1145 .IP \[bu] 2
1146 \f[CB]warn\f[R]: This mode is identical to \f[CB]permit\f[R] except that a
1147 warning message is issued for each illegal reflective\-access operation.
1148 .IP \[bu] 2
1149 \f[CB]debug\f[R]: This mode is identical to \f[CB]warn\f[R] except that both
1150 a warning message and a stack trace are issued for each illegal
1151 reflective\-access operation.
1152 .IP \[bu] 2
1153 \f[CB]deny\f[R]: This mode disables all illegal\-access operations except
1154 for those enabled by other command\-line options, such as
1155 \f[CB]\-\-add\-opens\f[R].
1156 This mode will become the default in a future release.
1157 .PP
1158 The default mode, \f[CB]\-\-illegal\-access=permit\f[R], is intended to
1159 make you aware of code on the class path that reflectively accesses any
1160 JDK\-internal APIs at least once.
1161 To learn about all such accesses, you can use the \f[CB]warn\f[R] or the
1162 \f[CB]debug\f[R] modes.
1163 For each library or framework on the class path that requires illegal
1164 access, you have two options:
1165 .IP \[bu] 2
1166 If the component\[aq]s maintainers have already released a fixed version
1167 that no longer uses JDK\-internal APIs then you can consider upgrading
1168 to that version.
1169 .IP \[bu] 2
1170 If the component still needs to be fixed, then you can contact its
1171 maintainers and ask them to replace their use of JDK\-internal APIs with
1172 the proper exported APIs.
1173 .PP
1174 If you must continue to use a component that requires illegal access,
1175 then you can eliminate the warning messages by using one or more
1176 \f[CB]\-\-add\-opens\f[R] options to open only those internal packages to
1177 which access is required.
1178 .PP
1179 To verify that your application is ready for a future version of the
1180 JDK, run it with \f[CB]\-\-illegal\-access=deny\f[R] along with any
1181 necessary \f[CB]\-\-add\-opens\f[R] options.
1182 Any remaining illegal\-access errors will most likely be due to static
1183 references from compiled code to JDK\-internal APIs.
1184 You can identify those by running the \f[B]jdeps\f[R] tool with the
1185 \f[CB]\-\-jdk\-internals\f[R] option.
1186 For performance reasons, the current JDK does not issue warnings for
1187 illegal static\-access operations.
1188 .RE
1189 .TP
1190 .B \f[CB]\-\-limit\-modules\f[R] \f[I]module\f[R][\f[CB],\f[R]\f[I]module\f[R]...]
1191 Specifies the limit of the universe of observable modules.
1192 .RS
1193 .RE
1194 .TP
1195 .B \f[CB]\-\-patch\-module\f[R] \f[I]module\f[R]\f[CB]=\f[R]\f[I]file\f[R](\f[CB];\f[R]\f[I]file\f[R])*
1196 Overrides or augments a module with classes and resources in JAR files
1197 or directories.
1198 .RS
1199 .RE
1200 .TP
1201 .B \f[CB]\-\-source\f[R] \f[I]version\f[R]
1202 Sets the version of the source in source\-file mode.
1203 .RS
1204 .RE
1205 .SH EXTRA OPTIONS FOR MACOS
1206 .PP
1207 The following extra options are macOS specific.
1208 .TP
1209 .B \f[CB]\-XstartOnFirstThread\f[R]
1210 Runs the \f[CB]main()\f[R] method on the first (AppKit) thread.
1211 .RS
1212 .RE
1213 .TP
1214 .B \f[CB]\-Xdock:name=\f[R]\f[I]application_name\f[R]
1215 Overrides the default application name displayed in dock.
1216 .RS
1217 .RE
1218 .TP
1219 .B \f[CB]\-Xdock:icon=\f[R]\f[I]path_to_icon_file\f[R]
1220 Overrides the default icon displayed in dock.
1221 .RS
1222 .RE
1223 .SH ADVANCED OPTIONS FOR JAVA
1224 .PP
1225 These \f[CB]java\f[R] options can be used to enable other advanced
1226 options.
1227 .TP
1228 .B \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R]
1229 Unlocks the options intended for diagnosing the JVM.
1230 By default, this option is disabled and diagnostic options aren\[aq]t
1231 available.
1232 .RS
1233 .PP
1234 Command line options that are enabled with the use of this option are
1235 not supported.
1236 If you encounter issues while using any of these options, it is very
1237 likely that you will be required to reproduce the problem without using
1238 any of these unsupported options before Oracle Support can assist with
1239 an investigation.
1240 It is also possible that any of these options may be removed or their
1241 behavior changed without any warning.
1242 .RE
1243 .TP
1244 .B \f[CB]\-XX:+UnlockExperimentalVMOptions\f[R]
1245 Unlocks the options that provide experimental features in the JVM.
1246 By default, this option is disabled and experimental features aren\[aq]t
1247 available.
1248 .RS
1249 .RE
1250 .SH ADVANCED RUNTIME OPTIONS FOR JAVA
1251 .PP
1252 These \f[CB]java\f[R] options control the runtime behavior of the Java
1253 HotSpot VM.
1254 .TP
1255 .B \f[CB]\-XX:ActiveProcessorCount=\f[R]\f[I]x\f[R]
1256 Overrides the number of CPUs that the VM will use to calculate the size
1257 of thread pools it will use for various operations such as Garbage
1258 Collection and ForkJoinPool.
1259 .RS
1260 .PP
1261 The VM normally determines the number of available processors from the
1262 operating system.
1263 This flag can be useful for partitioning CPU resources when running
1264 multiple Java processes in docker containers.
1265 This flag is honored even if \f[CB]UseContainerSupport\f[R] is not
1266 enabled.
1267 See \f[CB]\-XX:\-UseContainerSupport\f[R] for a description of enabling
1268 and disabling container support.
1269 .RE
1270 .TP
1271 .B \f[CB]\-XX:AllocateHeapAt=\f[R]\f[I]path\f[R]
1272 Takes a path to the file system and uses memory mapping to allocate the
1273 object heap on the memory device.
1274 Using this option enables the HotSpot VM to allocate the Java object
1275 heap on an alternative memory device, such as an NV\-DIMM, specified by
1276 the user.
1277 .RS
1278 .PP
1279 Alternative memory devices that have the same semantics as DRAM,
1280 including the semantics of atomic operations, can be used instead of
1281 DRAM for the object heap without changing the existing application code.
1282 All other memory structures (such as the code heap, metaspace, and
1283 thread stacks) continue to reside in DRAM.
1284 .PP
1285 Some operating systems expose non\-DRAM memory through the file system.
1286 Memory\-mapped files in these file systems bypass the page cache and
1287 provide a direct mapping of virtual memory to the physical memory on the
1288 device.
1289 The existing heap related flags (such as \f[CB]\-Xmx\f[R] and
1290 \f[CB]\-Xms\f[R]) and garbage\-collection related flags continue to work
1291 as before.
1292 .RE
1293 .TP
1294 .B \f[CB]\-XX:\-CompactStrings\f[R]
1295 Disables the Compact Strings feature.
1296 By default, this option is enabled.
1297 When this option is enabled, Java Strings containing only single\-byte
1298 characters are internally represented and stored as
1299 single\-byte\-per\-character Strings using ISO\-8859\-1 / Latin\-1
1300 encoding.
1301 This reduces, by 50%, the amount of space required for Strings
1302 containing only single\-byte characters.
1303 For Java Strings containing at least one multibyte character: these are
1304 represented and stored as 2 bytes per character using UTF\-16 encoding.
1305 Disabling the Compact Strings feature forces the use of UTF\-16 encoding
1306 as the internal representation for all Java Strings.
1307 .RS
1308 .PP
1309 Cases where it may be beneficial to disable Compact Strings include the
1310 following:
1311 .IP \[bu] 2
1312 When it\[aq]s known that an application overwhelmingly will be
1313 allocating multibyte character Strings
1314 .IP \[bu] 2
1315 In the unexpected event where a performance regression is observed in
1316 migrating from Java SE 8 to Java SE 9 and an analysis shows that Compact
1317 Strings introduces the regression
1318 .PP
1319 In both of these scenarios, disabling Compact Strings makes sense.
1320 .RE
1321 .TP
1322 .B \f[CB]\-XX:ErrorFile=\f[R]\f[I]filename\f[R]
1323 Specifies the path and file name to which error data is written when an
1324 irrecoverable error occurs.
1325 By default, this file is created in the current working directory and
1326 named \f[CB]hs_err_pid\f[R]\f[I]pid\f[R]\f[CB]\&.log\f[R] where \f[I]pid\f[R]
1327 is the identifier of the process that encountered the error.
1328 .RS
1329 .PP
1330 The following example shows how to set the default log file (note that
1331 the identifier of the process is specified as \f[CB]%p\f[R]):
1332 .RS
1333 .PP
1334 \f[CB]\-XX:ErrorFile=./hs_err_pid%p.log\f[R]
1335 .RE
1336 .IP \[bu] 2
1337 \f[B]Oracle Solaris, Linux, and macOS:\f[R] The following example shows
1338 how to set the error log to \f[CB]/var/log/java/java_error.log\f[R]:
1339 .RS 2
1340 .RS
1341 .PP
1342 \f[CB]\-XX:ErrorFile=/var/log/java/java_error.log\f[R]
1343 .RE
1344 .RE
1345 .IP \[bu] 2
1346 \f[B]Windows:\f[R] The following example shows how to set the error log
1347 file to \f[CB]C:/log/java/java_error.log\f[R]:
1348 .RS 2
1349 .RS
1350 .PP
1351 \f[CB]\-XX:ErrorFile=C:/log/java/java_error.log\f[R]
1352 .RE
1353 .RE
1354 .PP
1355 If the file exists, and is writeable, then it will be overwritten.
1356 Otherwise, if the file can\[aq]t be created in the specified directory
1357 (due to insufficient space, permission problem, or another issue), then
1358 the file is created in the temporary directory for the operating system:
1359 .IP \[bu] 2
1360 \f[B]Oracle Solaris, Linux, and macOS:\f[R] The temporary directory is
1361 \f[CB]/tmp\f[R].
1362 .IP \[bu] 2
1363 \f[B]Windows:\f[R] The temporary directory is specified by the value of
1364 the \f[CB]TMP\f[R] environment variable; if that environment variable
1365 isn\[aq]t defined, then the value of the \f[CB]TEMP\f[R] environment
1366 variable is used.
1367 .RE
1368 .TP
1369 .B \f[CB]\-XX:+ExtensiveErrorReports\f[R]
1370 Enables the reporting of more extensive error information in the
1371 \f[CB]ErrorFile\f[R].
1372 This option can be turned on in environments where maximal information
1373 is desired \- even if the resulting logs may be quite large and/or
1374 contain information that might be considered sensitive.
1375 The information can vary from release to release, and across different
1376 platforms.
1377 By default this option is disabled.
1378 .RS
1379 .RE
1380 .TP
1381 .B \f[CB]\-XX:FlightRecorderOptions=\f[R]\f[I]parameter\f[R]\f[CB]=\f[R]\f[I]value\f[R] (or)\f[CB]\-XX:FlightRecorderOptions:\f[R]\f[I]parameter\f[R]\f[CB]=\f[R]\f[I]value\f[R]
1382 Sets the parameters that control the behavior of JFR.
1383 .RS
1384 .PP
1385 The following list contains the available JFR
1386 \f[I]parameter\f[R]\f[CB]=\f[R]\f[I]value\f[R] entries:
1387 .TP
1388 .B \f[CB]globalbuffersize=\f[R]\f[I]size\f[R]
1389 Specifies the total amount of primary memory used for data retention.
1390 The default value is based on the value specified for
1391 \f[CB]memorysize\f[R].
1392 Change the \f[CB]memorysize\f[R] parameter to alter the size of global
1393 buffers.
1394 .RS
1395 .RE
1396 .TP
1397 .B \f[CB]maxchunksize=\f[R]\f[I]size\f[R]
1398 Specifies the maximum size (in bytes) of the data chunks in a recording.
1399 Append \f[CB]m\f[R] or \f[CB]M\f[R] to specify the size in megabytes (MB),
1400 or \f[CB]g\f[R] or \f[CB]G\f[R] to specify the size in gigabytes (GB).
1401 By default, the maximum size of data chunks is set to 12 MB.
1402 The minimum allowed is 1 MB.
1403 .RS
1404 .RE
1405 .TP
1406 .B \f[CB]memorysize=\f[R]\f[I]size\f[R]
1407 Determines how much buffer memory should be used, and sets the
1408 \f[CB]globalbuffersize\f[R] and \f[CB]numglobalbuffers\f[R] parameters based
1409 on the size specified.
1410 Append \f[CB]m\f[R] or \f[CB]M\f[R] to specify the size in megabytes (MB),
1411 or \f[CB]g\f[R] or \f[CB]G\f[R] to specify the size in gigabytes (GB).
1412 By default, the memory size is set to 10 MB.
1413 .RS
1414 .RE
1415 .TP
1416 .B \f[CB]numglobalbuffers\f[R]
1417 Specifies the number of global buffers used.
1418 The default value is based on the memory size specified.
1419 Change the \f[CB]memorysize\f[R] parameter to alter the number of global
1420 buffers.
1421 .RS
1422 .RE
1423 .TP
1424 .B \f[CB]old\-object\-queue\-size=number\-of\-objects\f[R]
1425 Maximum number of old objects to track.
1426 By default, the number of objects is set to 256.
1427 .RS
1428 .RE
1429 .TP
1430 .B \f[CB]repository=\f[R]\f[I]path\f[R]
1431 Specifies the repository (a directory) for temporary disk storage.
1432 By default, the system\[aq]s temporary directory is used.
1433 .RS
1434 .RE
1435 .TP
1436 .B \f[CB]retransform=\f[R]{\f[CB]true\f[R]|\f[CB]false\f[R]}
1437 Specifies whether event classes should be retransformed using JVMTI.
1438 If false, instrumentation is added when event classes are loaded.
1439 By default, this parameter is enabled.
1440 .RS
1441 .RE
1442 .TP
1443 .B \f[CB]samplethreads=\f[R]{\f[CB]true\f[R]|\f[CB]false\f[R]}
1444 Specifies whether thread sampling is enabled.
1445 Thread sampling occurs only if the sampling event is enabled along with
1446 this parameter.
1447 By default, this parameter is enabled.
1448 .RS
1449 .RE
1450 .TP
1451 .B \f[CB]stackdepth=\f[R]\f[I]depth\f[R]
1452 Stack depth for stack traces.
1453 By default, the depth is set to 64 method calls.
1454 The maximum is 2048.
1455 Values greater than 64 could create significant overhead and reduce
1456 performance.
1457 .RS
1458 .RE
1459 .TP
1460 .B \f[CB]threadbuffersize=\f[R]\f[I]size\f[R]
1461 Specifies the per\-thread local buffer size (in bytes).
1462 By default, the local buffer size is set to 8 kilobytes, with a minimum
1463 value of 4 kilobytes.
1464 Overriding this parameter could reduce performance and is not
1465 recommended.
1466 .RS
1467 .RE
1468 .PP
1469 You can specify values for multiple parameters by separating them with a
1470 comma.
1471 .RE
1472 .TP
1473 .B \f[CB]\-XX:LargePageSizeInBytes=\f[R]\f[I]size\f[R]
1474 Sets the maximum size (in bytes) for large pages used for the Java heap.
1475 The \f[I]size\f[R] argument must be a power of 2 (2, 4, 8, 16, and so
1476 on).
1477 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
1478 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
1479 \f[CB]G\f[R] to indicate gigabytes.
1480 By default, the size is set to 0, meaning that the JVM chooses the size
1481 for large pages automatically.
1482 See \f[B]Large Pages\f[R].
1483 .RS
1484 .PP
1485 The following example describes how to set the large page size to 4
1486 megabytes (MB):
1487 .RS
1488 .PP
1489 \f[CB]\-XX:LargePageSizeInBytes=4m\f[R]
1490 .RE
1491 .RE
1492 .TP
1493 .B \f[CB]\-XX:MaxDirectMemorySize=\f[R]\f[I]size\f[R]
1494 Sets the maximum total size (in bytes) of the \f[CB]java.nio\f[R] package,
1495 direct\-buffer allocations.
1496 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
1497 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
1498 \f[CB]G\f[R] to indicate gigabytes.
1499 By default, the size is set to 0, meaning that the JVM chooses the size
1500 for NIO direct\-buffer allocations automatically.
1501 .RS
1502 .PP
1503 The following examples illustrate how to set the NIO size to 1024 KB in
1504 different units:
1505 .IP
1506 .nf
1507 \f[CB]
1508 \-XX:MaxDirectMemorySize=1m
1509 \-XX:MaxDirectMemorySize=1024k
1510 \-XX:MaxDirectMemorySize=1048576
1511 \f[R]
1512 .fi
1513 .RE
1514 .TP
1515 .B \f[CB]\-XX:\-MaxFDLimit\f[R]
1516 Disables the attempt to set the soft limit for the number of open file
1517 descriptors to the hard limit.
1518 By default, this option is enabled on all platforms, but is ignored on
1519 Windows.
1520 The only time that you may need to disable this is on Mac OS, where its
1521 use imposes a maximum of 10240, which is lower than the actual system
1522 maximum.
1523 .RS
1524 .RE
1525 .TP
1526 .B \f[CB]\-XX:NativeMemoryTracking=\f[R]\f[I]mode\f[R]
1527 Specifies the mode for tracking JVM native memory usage.
1528 Possible \f[I]mode\f[R] arguments for this option include the following:
1529 .RS
1530 .TP
1531 .B \f[CB]off\f[R]
1532 Instructs not to track JVM native memory usage.
1533 This is the default behavior if you don\[aq]t specify the
1534 \f[CB]\-XX:NativeMemoryTracking\f[R] option.
1535 .RS
1536 .RE
1537 .TP
1538 .B \f[CB]summary\f[R]
1539 Tracks memory usage only by JVM subsystems, such as Java heap, class,
1540 code, and thread.
1541 .RS
1542 .RE
1543 .TP
1544 .B \f[CB]detail\f[R]
1545 In addition to tracking memory usage by JVM subsystems, track memory
1546 usage by individual \f[CB]CallSite\f[R], individual virtual memory region
1547 and its committed regions.
1548 .RS
1549 .RE
1550 .RE
1551 .TP
1552 .B \f[CB]\-XX:ObjectAlignmentInBytes=\f[R]\f[I]alignment\f[R]
1553 Sets the memory alignment of Java objects (in bytes).
1554 By default, the value is set to 8 bytes.
1555 The specified value should be a power of 2, and must be within the range
1556 of 8 and 256 (inclusive).
1557 This option makes it possible to use compressed pointers with large Java
1558 heap sizes.
1559 .RS
1560 .PP
1561 The heap size limit in bytes is calculated as:
1562 .RS
1563 .PP
1564 \f[CB]4GB\ *\ ObjectAlignmentInBytes\f[R]
1565 .RE
1566 .RS
1567 .PP
1568 \f[B]Note:\f[R] As the alignment value increases, the unused space
1569 between objects also increases.
1570 As a result, you may not realize any benefits from using compressed
1571 pointers with large Java heap sizes.
1572 .RE
1573 .RE
1574 .TP
1575 .B \f[CB]\-XX:OnError=\f[R]\f[I]string\f[R]
1576 Sets a custom command or a series of semicolon\-separated commands to
1577 run when an irrecoverable error occurs.
1578 If the string contains spaces, then it must be enclosed in quotation
1579 marks.
1580 .RS
1581 .IP \[bu] 2
1582 \f[B]Oracle Solaris, Linux, and macOS:\f[R] The following example shows
1583 how the \f[CB]\-XX:OnError\f[R] option can be used to run the
1584 \f[CB]gcore\f[R] command to create a core image, and start the
1585 \f[CB]gdb\f[R] debugger to attach to the process in case of an
1586 irrecoverable error (the \f[CB]%p\f[R] designates the current process
1587 identifier):
1588 .RS 2
1589 .RS
1590 .PP
1591 \f[CB]\-XX:OnError="gcore\ %p;gdb\ \-p\ %p"\f[R]
1592 .RE
1593 .RE
1594 .IP \[bu] 2
1595 \f[B]Windows:\f[R] The following example shows how the
1596 \f[CB]\-XX:OnError\f[R] option can be used to run the
1597 \f[CB]userdump.exe\f[R] utility to obtain a crash dump in case of an
1598 irrecoverable error (the \f[CB]%p\f[R] designates the current process
1599 identifier).
1600 This example assumes that the path to the \f[CB]userdump.exe\f[R] utility
1601 is specified in the \f[CB]PATH\f[R] environment variable:
1602 .RS 2
1603 .RS
1604 .PP
1605 \f[CB]\-XX:OnError="userdump.exe\ %p"\f[R]
1606 .RE
1607 .RE
1608 .RE
1609 .TP
1610 .B \f[CB]\-XX:OnOutOfMemoryError=\f[R]\f[I]string\f[R]
1611 Sets a custom command or a series of semicolon\-separated commands to
1612 run when an \f[CB]OutOfMemoryError\f[R] exception is first thrown.
1613 If the string contains spaces, then it must be enclosed in quotation
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
1655 .B \f[CB]\-XX:SharedArchiveConfigFile\f[R]=\f[I]shared_config_file\f[R]
1656 Specifies additional shared data added to the archive file.
1657 .RS
1658 .RE
1659 .TP
1660 .B \f[CB]\-XX:SharedClassListFile=\f[R]\f[I]file_name\f[R]
1661 Specifies the text file that contains the names of the classes to store
1662 in the class data sharing (CDS) archive.
1663 This file contains the full name of one class per line, except slashes
1664 (\f[CB]/\f[R]) replace dots (\f[CB]\&.\f[R]).
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.
1718 Append \f[CB]s\f[R] to specify the time in seconds, \f[CB]m\f[R] for
1719 minutes, \f[CB]h\f[R] for hours, or \f[CB]d\f[R] for days (for example,
1720 specifying \f[CB]10m\f[R] means 10 minutes).
1721 By default, there\[aq]s no delay, and this parameter is set to 0.
1722 .RS
1723 .RE
1724 .TP
1725 .B \f[CB]disk=\f[R]{\f[CB]true\f[R]|\f[CB]false\f[R]}
1726 Specifies whether to write data to disk while recording.
1727 By default, this parameter is enabled.
1728 .RS
1729 .RE
1730 .TP
1731 .B \f[CB]dumponexit=\f[R]{\f[CB]true\f[R]|\f[CB]false\f[R]}
1732 Specifies if the running recording is dumped when the JVM shuts down.
1733 If enabled and a \f[CB]filename\f[R] is not entered, the recording is
1734 written to a file in the directory where the process was started.
1735 The file name is a system\-generated name that contains the process ID,
1736 recording ID, and current timestamp, similar to
1737 \f[CB]hotspot\-pid\-47496\-id\-1\-2018_01_25_19_10_41.jfr\f[R].
1738 By default, this parameter is disabled.
1739 .RS
1740 .RE
1741 .TP
1742 .B \f[CB]duration=\f[R]\f[I]time\f[R]
1743 Specifies the duration of the recording.
1744 Append \f[CB]s\f[R] to specify the time in seconds, \f[CB]m\f[R] for
1745 minutes, \f[CB]h\f[R] for hours, or \f[CB]d\f[R] for days (for example,
1746 specifying \f[CB]5h\f[R] means 5 hours).
1747 By default, the duration isn\[aq]t limited, and this parameter is set to
1748 0.
1749 .RS
1750 .RE
1751 .TP
1752 .B \f[CB]filename=\f[R]\f[I]path\f[R]
1753 Specifies the path and name of the file to which the recording is
1754 written when the recording is stopped, for example:
1755 .RS
1756 .IP \[bu] 2
1757 \f[CB]recording.jfr\f[R]
1758 .IP \[bu] 2
1759 \f[CB]/home/user/recordings/recording.jfr\f[R]
1760 .IP \[bu] 2
1761 \f[CB]c:\\recordings\\recording.jfr\f[R]
1762 .RE
1763 .TP
1764 .B \f[CB]name=\f[R]\f[I]identifier\f[R]
1765 Takes both the name and the identifier of a recording.
1766 .RS
1767 .RE
1768 .TP
1769 .B \f[CB]maxage=\f[R]\f[I]time\f[R]
1770 Specifies the maximum age of disk data to keep for the recording.
1771 This parameter is valid only when the \f[CB]disk\f[R] parameter is set to
1772 \f[CB]true\f[R].
1773 Append \f[CB]s\f[R] to specify the time in seconds, \f[CB]m\f[R] for
1774 minutes, \f[CB]h\f[R] for hours, or \f[CB]d\f[R] for days (for example,
1775 specifying \f[CB]30s\f[R] means 30 seconds).
1776 By default, the maximum age isn\[aq]t limited, and this parameter is set
1777 to \f[CB]0s\f[R].
1778 .RS
1779 .RE
1780 .TP
1781 .B \f[CB]maxsize=\f[R]\f[I]size\f[R]
1782 Specifies the maximum size (in bytes) of disk data to keep for the
1783 recording.
1784 This parameter is valid only when the \f[CB]disk\f[R] parameter is set to
1785 \f[CB]true\f[R].
1786 The value must not be less than the value for the \f[CB]maxchunksize\f[R]
1787 parameter set with \f[CB]\-XX:FlightRecorderOptions\f[R].
1788 Append \f[CB]m\f[R] or \f[CB]M\f[R] to specify the size in megabytes, or
1789 \f[CB]g\f[R] or \f[CB]G\f[R] to specify the size in gigabytes.
1790 By default, the maximum size of disk data isn\[aq]t limited, and this
1791 parameter is set to \f[CB]0\f[R].
1792 .RS
1793 .RE
1794 .TP
1795 .B \f[CB]path\-to\-gc\-roots=\f[R]{\f[CB]true\f[R]|\f[CB]false\f[R]}
1796 Specifies whether to collect the path to garbage collection (GC) roots
1797 at the end of a recording.
1798 By default, this parameter is disabled.
1799 .RS
1800 .PP
1801 The path to GC roots is useful for finding memory leaks, but collecting
1802 it is time\-consuming.
1803 Enable this option only when you start a recording for an application
1804 that you suspect has a memory leak.
1805 If the \f[CB]settings\f[R] parameter is set to \f[CB]profile\f[R], the stack
1806 trace from where the potential leaking object was allocated is included
1807 in the information collected.
1808 .RE
1809 .TP
1810 .B \f[CB]settings=\f[R]\f[I]path\f[R]
1811 Specifies the path and name of the event settings file (of type JFC).
1812 By default, the \f[CB]default.jfc\f[R] file is used, which is located in
1813 \f[CB]JRE_HOME/lib/jfr\f[R].
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
1855 .PP
1856 This option is similar to \f[CB]\-Xss\f[R].
1857 .RE
1858 .TP
1859 .B \f[CB]\-XX:\-UseBiasedLocking\f[R]
1860 Disables the use of biased locking.
1861 Some applications with significant amounts of uncontended
1862 synchronization may attain significant speedups with this flag enabled,
1863 but applications with certain patterns of locking may see slowdowns.
1864 \&.
1865 .RS
1866 .PP
1867 By default, this option is enabled.
1868 .RE
1869 .TP
1870 .B \f[CB]\-XX:\-UseCompressedOops\f[R]
1871 Disables the use of compressed pointers.
1872 By default, this option is enabled, and compressed pointers are used.
1873 This will automatically limit the maximum ergonomically determined Java
1874 heap size to the maximum amount of memory that can be covered by
1875 compressed pointers.
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
1919 .PP
1920 See \f[B]Large Pages\f[R].
1921 .RE
1922 .TP
1923 .B \f[CB]\-XX:+UseLargePages\f[R]
1924 Enables the use of large page memory.
1925 By default, this option is disabled and large page memory isn\[aq]t
1926 used.
1927 .RS
1928 .PP
1929 See \f[B]Large Pages\f[R].
1930 .RE
1931 .TP
1932 .B \f[CB]\-XX:+UseTransparentHugePages\f[R]
1933 \f[B]Linux only:\f[R] Enables the use of large pages that can dynamically
1934 grow or shrink.
1935 This option is disabled by default.
1936 You may encounter performance problems with transparent huge pages as
1937 the OS moves other pages around to create huge pages; this option is
1938 made available for experimentation.
1939 .RS
1940 .RE
1941 .TP
1942 .B \f[CB]\-XX:+AllowUserSignalHandlers\f[R]
1943 Enables installation of signal handlers by the application.
1944 By default, this option is disabled and the application isn\[aq]t
1945 allowed to install signal handlers.
1946 .RS
1947 .RE
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
2111 If the method is specified without the signature, then the command is
2112 applied to all methods with the specified name.
2113 However, you can also specify the signature of the method in the class
2114 file format.
2115 In this case, you should enclose the arguments in quotation marks,
2116 because otherwise the shell treats the semicolon as a command end.
2117 For example, if you want to exclude only the \f[CB]indexOf(String)\f[R]
2118 method of the \f[CB]String\f[R] class from being compiled, use the
2119 following:
2120 .RS
2121 .PP
2122 \f[CB]\-XX:CompileCommand="exclude,java/lang/String.indexOf,(Ljava/lang/String;)I"\f[R]
2123 .RE
2124 .PP
2125 You can also use the asterisk (*) as a wildcard for class and method
2126 names.
2127 For example, to exclude all \f[CB]indexOf()\f[R] methods in all classes
2128 from being compiled, use the following:
2129 .RS
2130 .PP
2131 \f[CB]\-XX:CompileCommand=exclude,*.indexOf\f[R]
2132 .RE
2133 .PP
2134 The commas and periods are aliases for spaces, making it easier to pass
2135 compiler commands through a shell.
2136 You can pass arguments to \f[CB]\-XX:CompileCommand\f[R] using spaces as
2137 separators by enclosing the argument in quotation marks:
2138 .RS
2139 .PP
2140 \f[CB]\-XX:CompileCommand="exclude\ java/lang/String\ indexOf"\f[R]
2141 .RE
2142 .PP
2143 Note that after parsing the commands passed on the command line using
2144 the \f[CB]\-XX:CompileCommand\f[R] options, the JIT compiler then reads
2145 commands from the \f[CB]\&.hotspot_compiler\f[R] file.
2146 You can add commands to this file or specify a different file using the
2147 \f[CB]\-XX:CompileCommandFile\f[R] option.
2148 .PP
2149 To add several commands, either specify the \f[CB]\-XX:CompileCommand\f[R]
2150 option multiple times, or separate each argument with the new line
2151 separator (\f[CB]\\n\f[R]).
2152 The following commands are available:
2153 .TP
2154 .B \f[CB]break\f[R]
2155 Sets a breakpoint when debugging the JVM to stop at the beginning of
2156 compilation of the specified method.
2157 .RS
2158 .RE
2159 .TP
2160 .B \f[CB]compileonly\f[R]
2161 Excludes all methods from compilation except for the specified method.
2162 As an alternative, you can use the \f[CB]\-XX:CompileOnly\f[R] option,
2163 which lets you specify several methods.
2164 .RS
2165 .RE
2166 .TP
2167 .B \f[CB]dontinline\f[R]
2168 Prevents inlining of the specified method.
2169 .RS
2170 .RE
2171 .TP
2172 .B \f[CB]exclude\f[R]
2173 Excludes the specified method from compilation.
2174 .RS
2175 .RE
2176 .TP
2177 .B \f[CB]help\f[R]
2178 Prints a help message for the \f[CB]\-XX:CompileCommand\f[R] option.
2179 .RS
2180 .RE
2181 .TP
2182 .B \f[CB]inline\f[R]
2183 Attempts to inline the specified method.
2184 .RS
2185 .RE
2186 .TP
2187 .B \f[CB]log\f[R]
2188 Excludes compilation logging (with the \f[CB]\-XX:+LogCompilation\f[R]
2189 option) for all methods except for the specified method.
2190 By default, logging is performed for all compiled methods.
2191 .RS
2192 .RE
2193 .TP
2194 .B \f[CB]option\f[R]
2195 Passes a JIT compilation option to the specified method in place of the
2196 last argument (\f[CB]option\f[R]).
2197 The compilation option is set at the end, after the method name.
2198 For example, to enable the \f[CB]BlockLayoutByFrequency\f[R] option for
2199 the \f[CB]append()\f[R] method of the \f[CB]StringBuffer\f[R] class, use the
2200 following:
2201 .RS
2202 .RS
2203 .PP
2204 \f[CB]\-XX:CompileCommand=option,java/lang/StringBuffer.append,BlockLayoutByFrequency\f[R]
2205 .RE
2206 .PP
2207 You can specify multiple compilation options, separated by commas or
2208 spaces.
2209 .RE
2210 .TP
2211 .B \f[CB]print\f[R]
2212 Prints generated assembler code after compilation of the specified
2213 method.
2214 .RS
2215 .RE
2216 .TP
2217 .B \f[CB]quiet\f[R]
2218 Instructs not to print the compile commands.
2219 By default, the commands that you specify with the
2220 \f[CB]\-XX:CompileCommand\f[R] option are printed; for example, if you
2221 exclude from compilation the \f[CB]indexOf()\f[R] method of the
2222 \f[CB]String\f[R] class, then the following is printed to standard output:
2223 .RS
2224 .RS
2225 .PP
2226 \f[CB]CompilerOracle:\ exclude\ java/lang/String.indexOf\f[R]
2227 .RE
2228 .PP
2229 You can suppress this by specifying the
2230 \f[CB]\-XX:CompileCommand=quiet\f[R] option before other
2231 \f[CB]\-XX:CompileCommand\f[R] options.
2232 .RE
2233 .RE
2234 .TP
2235 .B \f[CB]\-XX:CompileCommandFile=\f[R]\f[I]filename\f[R]
2236 Sets the file from which JIT compiler commands are read.
2237 By default, the \f[CB]\&.hotspot_compiler\f[R] file is used to store
2238 commands performed by the JIT compiler.
2239 .RS
2240 .PP
2241 Each line in the command file represents a command, a class name, and a
2242 method name for which the command is used.
2243 For example, this line prints assembly code for the \f[CB]toString()\f[R]
2244 method of the \f[CB]String\f[R] class:
2245 .RS
2246 .PP
2247 \f[CB]print\ java/lang/String\ toString\f[R]
2248 .RE
2249 .PP
2250 If you\[aq]re using commands for the JIT compiler to perform on methods,
2251 then see the \f[CB]\-XX:CompileCommand\f[R] option.
2252 .RE
2253 .TP
2254 .B \f[CB]\-XX:CompilerDirectivesFile=\f[R]\f[I]file\f[R]
2255 Adds directives from a file to the directives stack when a program
2256 starts.
2257 See \f[B]Compiler Control\f[R]
2258 [https://docs.oracle.com/en/java/javase/12/vm/compiler\-control1.html#GUID\-94AD8194\-786A\-4F19\-BFFF\-278F8E237F3A].
2259 .RS
2260 .PP
2261 The \f[CB]\-XX:CompilerDirectivesFile\f[R] option has to be used together
2262 with the \f[CB]\-XX:UnlockDiagnosticVMOptions\f[R] option that unlocks
2263 diagnostic JVM options.
2264 .RE
2265 .TP
2266 .B \f[CB]\-XX:+CompilerDirectivesPrint\f[R]
2267 Prints the directives stack when the program starts or when a new
2268 directive is added.
2269 .RS
2270 .PP
2271 The \f[CB]\-XX:+CompilerDirectivesPrint\f[R] option has to be used
2272 together with the \f[CB]\-XX:UnlockDiagnosticVMOptions\f[R] option that
2273 unlocks diagnostic JVM options.
2274 .RE
2275 .TP
2276 .B \f[CB]\-XX:CompileOnly=\f[R]\f[I]methods\f[R]
2277 Sets the list of methods (separated by commas) to which compilation
2278 should be restricted.
2279 Only the specified methods are compiled.
2280 Specify each method with the full class name (including the packages and
2281 subpackages).
2282 For example, to compile only the \f[CB]length()\f[R] method of the
2283 \f[CB]String\f[R] class and the \f[CB]size()\f[R] method of the
2284 \f[CB]List\f[R] class, use the following:
2285 .RS
2286 .RS
2287 .PP
2288 \f[CB]\-XX:CompileOnly=java/lang/String.length,java/util/List.size\f[R]
2289 .RE
2290 .PP
2291 Note that the full class name is specified, including all packages and
2292 subpackages separated by a slash (\f[CB]/\f[R]).
2293 For easier cut and paste operations, it\[aq]s also possible to use the
2294 method name format produced by the \f[CB]\-XX:+PrintCompilation\f[R] and
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.
2493 .RS
2494 .RE
2495 .TP
2496 .B \f[CB]\-XX:+PrintCompilation\f[R]
2497 Enables verbose diagnostic output from the JVM by printing a message to
2498 the console every time a method is compiled.
2499 This lets you to see which methods actually get compiled.
2500 By default, this option is disabled and diagnostic output isn\[aq]t
2501 printed.
2502 .RS
2503 .PP
2504 You can also log compilation activity to a file by using the
2505 \f[CB]\-XX:+LogCompilation\f[R] option.
2506 .RE
2507 .TP
2508 .B \f[CB]\-XX:+PrintInlining\f[R]
2509 Enables printing of inlining decisions.
2510 This let\[aq]s you see which methods are getting inlined.
2511 .RS
2512 .PP
2513 By default, this option is disabled and inlining information isn\[aq]t
2514 printed.
2515 The \f[CB]\-XX:+PrintInlining\f[R] option has to be used together with the
2516 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R] option that unlocks diagnostic
2517 JVM options.
2518 .RE
2519 .TP
2520 .B \f[CB]\-XX:ReservedCodeCacheSize=\f[R]\f[I]size\f[R]
2521 Sets the maximum code cache size (in bytes) for JIT\-compiled code.
2522 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
2523 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
2524 \f[CB]G\f[R] to indicate gigabytes.
2525 The default maximum code cache size is 240 MB; if you disable tiered
2526 compilation with the option \f[CB]\-XX:\-TieredCompilation\f[R], then the
2527 default size is 48 MB.
2528 This option has a limit of 2 GB; otherwise, an error is generated.
2529 The maximum code cache size shouldn\[aq]t be less than the initial code
2530 cache size; see the option \f[CB]\-XX:InitialCodeCacheSize\f[R].
2531 .RS
2532 .RE
2533 .TP
2534 .B \f[CB]\-XX:RTMAbortRatio=\f[R]\f[I]abort_ratio\f[R]
2535 Specifies the RTM abort ratio is specified as a percentage (%) of all
2536 executed RTM transactions.
2537 If a number of aborted transactions becomes greater than this ratio,
2538 then the compiled code is deoptimized.
2539 This ratio is used when the \f[CB]\-XX:+UseRTMDeopt\f[R] option is
2540 enabled.
2541 The default value of this option is 50.
2542 This means that the compiled code is deoptimized if 50% of all
2543 transactions are aborted.
2544 .RS
2545 .RE
2546 .TP
2547 .B \f[CB]\-XX:RTMRetryCount=\f[R]\f[I]number_of_retries\f[R]
2548 Specifies the number of times that the RTM locking code is retried, when
2549 it is aborted or busy, before falling back to the normal locking
2550 mechanism.
2551 The default value for this option is 5.
2552 The \f[CB]\-XX:UseRTMLocking\f[R] option must be enabled.
2553 .RS
2554 .RE
2555 .TP
2556 .B \f[CB]\-XX:+SegmentedCodeCache\f[R]
2557 Enables segmentation of the code cache.
2558 Without the \f[CB]\-XX:+SegmentedCodeCache\f[R], the code cache consists
2559 of one large segment.
2560 With \f[CB]\-XX:+SegmentedCodeCache\f[R], we have separate segments for
2561 nonmethod, profiled method, and nonprofiled method code.
2562 These segments aren\[aq]t resized at runtime.
2563 The feature is enabled by default if tiered compilation is enabled
2564 (\f[CB]\-XX:+TieredCompilation\f[R] ) and
2565 \f[CB]\-XX:ReservedCodeCacheSize\f[R] >= 240 MB.
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.
2867 An RTM lock is a lock that has been delegated to the TSX\[aq]s system.
2868 .PP
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
2916 .RE
2917 .TP
2918 .B \f[CB]\-XX:+ExtendedDTraceProbes\f[R]
2919 \f[B]Oracle Solaris, Linux, and macOS:\f[R] Enables additional
2920 \f[CB]dtrace\f[R] tool probes that affect the performance.
2921 By default, this option is disabled and \f[CB]dtrace\f[R] performs only
2922 standard probes.
2923 .RS
2924 .RE
2925 .TP
2926 .B \f[CB]\-XX:+HeapDumpOnOutOfMemoryError\f[R]
2927 Enables the dumping of the Java heap to a file in the current directory
2928 by using the heap profiler (HPROF) when a
2929 \f[CB]java.lang.OutOfMemoryError\f[R] exception is thrown.
2930 You can explicitly set the heap dump file path and name using the
2931 \f[CB]\-XX:HeapDumpPath\f[R] option.
2932 By default, this option is disabled and the heap isn\[aq]t dumped when
2933 an \f[CB]OutOfMemoryError\f[R] exception is thrown.
2934 .RS
2935 .RE
2936 .TP
2937 .B \f[CB]\-XX:HeapDumpPath=path\f[R]
2938 Sets the path and file name for writing the heap dump provided by the
2939 heap profiler (HPROF) when the \f[CB]\-XX:+HeapDumpOnOutOfMemoryError\f[R]
2940 option is set.
2941 By default, the file is created in the current working directory, and
2942 it\[aq]s named \f[CB]java_pid<pid>.hprof\f[R] where \f[CB]<pid>\f[R] is the
2943 identifier of the process that caused the error.
2944 The following example shows how to set the default file explicitly
2945 (\f[CB]%p\f[R] represents the current process identifier):
2946 .RS
2947 .RS
2948 .PP
2949 \f[CB]\-XX:HeapDumpPath=./java_pid%p.hprof\f[R]
2950 .RE
2951 .IP \[bu] 2
2952 \f[B]Oracle Solaris, Linux, and macOS:\f[R] The following example shows
2953 how to set the heap dump file to
2954 \f[CB]/var/log/java/java_heapdump.hprof\f[R]:
2955 .RS 2
2956 .RS
2957 .PP
2958 \f[CB]\-XX:HeapDumpPath=/var/log/java/java_heapdump.hprof\f[R]
2959 .RE
2960 .RE
2961 .IP \[bu] 2
2962 \f[B]Windows:\f[R] The following example shows how to set the heap dump
2963 file to \f[CB]C:/log/java/java_heapdump.log\f[R]:
2964 .RS 2
2965 .RS
2966 .PP
2967 \f[CB]\-XX:HeapDumpPath=C:/log/java/java_heapdump.log\f[R]
2968 .RE
2969 .RE
2970 .RE
2971 .TP
2972 .B \f[CB]\-XX:LogFile=\f[R]\f[I]path\f[R]
2973 Sets the path and file name to where log data is written.
2974 By default, the file is created in the current working directory, and
2975 it\[aq]s named \f[CB]hotspot.log\f[R].
2976 .RS
2977 .IP \[bu] 2
2978 \f[B]Oracle Solaris, Linux, and macOS:\f[R] The following example shows
2979 how to set the log file to \f[CB]/var/log/java/hotspot.log\f[R]:
2980 .RS 2
2981 .RS
2982 .PP
2983 \f[CB]\-XX:LogFile=/var/log/java/hotspot.log\f[R]
2984 .RE
2985 .RE
2986 .IP \[bu] 2
2987 \f[B]Windows:\f[R] The following example shows how to set the log file to
2988 \f[CB]C:/log/java/hotspot.log\f[R]:
2989 .RS 2
2990 .RS
2991 .PP
2992 \f[CB]\-XX:LogFile=C:/log/java/hotspot.log\f[R]
2993 .RE
2994 .RE
2995 .RE
2996 .TP
2997 .B \f[CB]\-XX:+PrintClassHistogram\f[R]
2998 Enables printing of a class instance histogram after one of the
2999 following events:
3000 .RS
3001 .IP \[bu] 2
3002 \f[B]Oracle Solaris, Linux, and macOS:\f[R] \f[CB]Control+Break\f[R]
3003 .IP \[bu] 2
3004 \f[B]Windows:\f[R] \f[CB]Control+C\f[R] (\f[CB]SIGTERM\f[R])
3005 .PP
3006 By default, this option is disabled.
3007 .PP
3008 Setting this option is equivalent to running the \f[CB]jmap\ \-histo\f[R]
3009 command, or the \f[CB]jcmd\f[R] \f[I]pid\f[R] \f[CB]GC.class_histogram\f[R]
3010 command, where \f[I]pid\f[R] is the current Java process identifier.
3011 .RE
3012 .TP
3013 .B \f[CB]\-XX:+PrintConcurrentLocks\f[R]
3014 Enables printing of \f[CB]java.util.concurrent\f[R] locks after one of the
3015 following events:
3016 .RS
3017 .IP \[bu] 2
3018 \f[B]Oracle Solaris, Linux, and macOS:\f[R] \f[CB]Control+Break\f[R]
3019 .IP \[bu] 2
3020 \f[B]Windows:\f[R] \f[CB]Control+C\f[R] (\f[CB]SIGTERM\f[R])
3021 .PP
3022 By default, this option is disabled.
3023 .PP
3024 Setting this option is equivalent to running the \f[CB]jstack\ \-l\f[R]
3025 command or the \f[CB]jcmd\f[R] \f[I]pid\f[R] \f[CB]Thread.print\ \-l\f[R]
3026 command, where \f[I]pid\f[R] is the current Java process identifier.
3027 .RE
3028 .TP
3029 .B \f[CB]\-XX:+PrintFlagsRanges\f[R]
3030 Prints the range specified and allows automatic testing of the values.
3031 See \f[B]Validate Java Virtual Machine Flag Arguments\f[R].
3032 .RS
3033 .RE
3034 .TP
3035 .B \f[CB]\-XX:+PerfDataSaveToFile\f[R]
3036 If enabled, saves \f[B]jstat\f[R] binary data when the Java application
3037 exits.
3038 This binary data is saved in a file named
3039 \f[CB]hsperfdata_\f[R]\f[I]pid\f[R], where \f[I]pid\f[R] is the process
3040 identifier of the Java application that you ran.
3041 Use the \f[CB]jstat\f[R] command to display the performance data contained
3042 in this file as follows:
3043 .RS
3044 .RS
3045 .PP
3046 \f[CB]jstat\ \-class\ file:///\f[R]\f[I]path\f[R]\f[CB]/hsperfdata_\f[R]\f[I]pid\f[R]
3047 .RE
3048 .RS
3049 .PP
3050 \f[CB]jstat\ \-gc\ file:///\f[R]\f[I]path\f[R]\f[CB]/hsperfdata_\f[R]\f[I]pid\f[R]
3051 .RE
3052 .RE
3053 .TP
3054 .B \f[CB]\-XX:+UsePerfData\f[R]
3055 Enables the \f[CB]perfdata\f[R] feature.
3056 This option is enabled by default to allow JVM monitoring and
3057 performance testing.
3058 Disabling it suppresses the creation of the \f[CB]hsperfdata_userid\f[R]
3059 directories.
3060 To disable the \f[CB]perfdata\f[R] feature, specify
3061 \f[CB]\-XX:\-UsePerfData\f[R].
3062 .RS
3063 .RE
3064 .SH ADVANCED GARBAGE COLLECTION OPTIONS FOR JAVA
3065 .PP
3066 These \f[CB]java\f[R] options control how garbage collection (GC) is
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
3107 \f[CB]System.gc()\f[R] are processed.
3108 If processing of calls to \f[CB]System.gc()\f[R] is disabled, then the JVM
3109 still performs GC when necessary.
3110 .RS
3111 .RE
3112 .TP
3113 .B \f[CB]\-XX:+ExplicitGCInvokesConcurrent\f[R]
3114 Enables invoking of concurrent GC by using the \f[CB]System.gc()\f[R]
3115 request.
3116 This option is disabled by default and can be enabled only with the
3117 \f[CB]\-XX:+UseG1GC\f[R] option.
3118 .RS
3119 .RE
3120 .TP
3121 .B \f[CB]\-XX:G1AdaptiveIHOPNumInitialSamples=\f[R]\f[I]number\f[R]
3122 When \f[CB]\-XX:UseAdaptiveIHOP\f[R] is enabled, this option sets the
3123 number of completed marking cycles used to gather samples until G1
3124 adaptively determines the optimum value of
3125 \f[CB]\-XX:InitiatingHeapOccupancyPercent\f[R].
3126 Before, G1 uses the value of
3127 \f[CB]\-XX:InitiatingHeapOccupancyPercent\f[R] directly for this purpose.
3128 The default value is 3.
3129 .RS
3130 .RE
3131 .TP
3132 .B \f[CB]\-XX:G1HeapRegionSize=size\f[R]
3133 Sets the size of the regions into which the Java heap is subdivided when
3134 using the garbage\-first (G1) collector.
3135 The value is a power of 2 and can range from 1 MB to 32 MB.
3136 The default region size is determined ergonomically based on the heap
3137 size with a goal of approximately 2048 regions.
3138 .RS
3139 .PP
3140 The following example sets the size of the subdivisions to 16 MB:
3141 .RS
3142 .PP
3143 \f[CB]\-XX:G1HeapRegionSize=16m\f[R]
3144 .RE
3145 .RE
3146 .TP
3147 .B \f[CB]\-XX:G1HeapWastePercent=\f[R]\f[I]percent\f[R]
3148 Sets the percentage of heap that you\[aq]re willing to waste.
3149 The Java HotSpot VM doesn\[aq]t initiate the mixed garbage collection
3150 cycle when the reclaimable percentage is less than the heap waste
3151 percentage.
3152 The default is 5 percent.
3153 .RS
3154 .RE
3155 .TP
3156 .B \f[CB]\-XX:G1MaxNewSizePercent=\f[R]\f[I]percent\f[R]
3157 Sets the percentage of the heap size to use as the maximum for the young
3158 generation size.
3159 The default value is 60 percent of your Java heap.
3160 .RS
3161 .PP
3162 This is an experimental flag.
3163 This setting replaces the \f[CB]\-XX:DefaultMaxNewGenPercent\f[R] setting.
3164 .RE
3165 .TP
3166 .B \f[CB]\-XX:G1MixedGCCountTarget=\f[R]\f[I]number\f[R]
3167 Sets the target number of mixed garbage collections after a marking
3168 cycle to collect old regions with at most
3169 \f[CB]G1MixedGCLIveThresholdPercent\f[R] live data.
3170 The default is 8 mixed garbage collections.
3171 The goal for mixed collections is to be within this target number.
3172 .RS
3173 .RE
3174 .TP
3175 .B \f[CB]\-XX:G1MixedGCLiveThresholdPercent=\f[R]\f[I]percent\f[R]
3176 Sets the occupancy threshold for an old region to be included in a mixed
3177 garbage collection cycle.
3178 The default occupancy is 85 percent.
3179 .RS
3180 .PP
3181 This is an experimental flag.
3182 This setting replaces the
3183 \f[CB]\-XX:G1OldCSetRegionLiveThresholdPercent\f[R] setting.
3184 .RE
3185 .TP
3186 .B \f[CB]\-XX:G1NewSizePercent=\f[R]\f[I]percent\f[R]
3187 Sets the percentage of the heap to use as the minimum for the young
3188 generation size.
3189 The default value is 5 percent of your Java heap.
3190 .RS
3191 .PP
3192 This is an experimental flag.
3193 This setting replaces the \f[CB]\-XX:DefaultMinNewGenPercent\f[R] setting.
3194 .RE
3195 .TP
3196 .B \f[CB]\-XX:G1OldCSetRegionThresholdPercent=\f[R]\f[I]percent\f[R]
3197 Sets an upper limit on the number of old regions to be collected during
3198 a mixed garbage collection cycle.
3199 The default is 10 percent of the Java heap.
3200 .RS
3201 .RE
3202 .TP
3203 .B \f[CB]\-XX:G1ReservePercent=\f[R]\f[I]percent\f[R]
3204 Sets the percentage of the heap (0 to 50) that\[aq]s reserved as a false
3205 ceiling to reduce the possibility of promotion failure for the G1
3206 collector.
3207 When you increase or decrease the percentage, ensure that you adjust the
3208 total Java heap by the same amount.
3209 By default, this option is set to 10%.
3210 .RS
3211 .PP
3212 The following example sets the reserved heap to 20%:
3213 .RS
3214 .PP
3215 \f[CB]\-XX:G1ReservePercent=20\f[R]
3216 .RE
3217 .RE
3218 .TP
3219 .B \f[CB]\-XX:+G1UseAdaptiveIHOP\f[R]
3220 Controls adaptive calculation of the old generation occupancy to start
3221 background work preparing for an old generation collection.
3222 If enabled, G1 uses \f[CB]\-XX:InitiatingHeapOccupancyPercent\f[R] for the
3223 first few times as specified by the value of
3224 \f[CB]\-XX:G1AdaptiveIHOPNumInitialSamples\f[R], and after that adaptively
3225 calculates a new optimum value for the initiating occupancy
3226 automatically.
3227 Otherwise, the old generation collection process always starts at the
3228 old generation occupancy determined by
3229 \f[CB]\-XX:InitiatingHeapOccupancyPercent\f[R].
3230 .RS
3231 .PP
3232 The default is enabled.
3233 .RE
3234 .TP
3235 .B \f[CB]\-XX:InitialHeapSize=\f[R]\f[I]size\f[R]
3236 Sets the initial size (in bytes) of the memory allocation pool.
3237 This value must be either 0, or a multiple of 1024 and greater than 1
3238 MB.
3239 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
3240 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
3241 \f[CB]G\f[R] to indicate gigabytes.
3242 The default value is selected at run time based on the system
3243 configuration.
3244 .RS
3245 .PP
3246 The following examples show how to set the size of allocated memory to 6
3247 MB using various units:
3248 .IP
3249 .nf
3250 \f[CB]
3251 \-XX:InitialHeapSize=6291456
3252 \-XX:InitialHeapSize=6144k
3253 \-XX:InitialHeapSize=6m
3254 \f[R]
3255 .fi
3256 .PP
3257 If you set this option to 0, then the initial size is set as the sum of
3258 the sizes allocated for the old generation and the young generation.
3259 The size of the heap for the young generation can be set using the
3260 \f[CB]\-XX:NewSize\f[R] option.
3261 .RE
3262 .TP
3263 .B \f[CB]\-XX:InitialRAMPercentage=\f[R]\f[I]percent\f[R]
3264 Sets the initial amount of memory that the JVM will use for the Java
3265 heap before applying ergonomics heuristics as a percentage of the
3266 maximum amount determined as described in the \f[CB]\-XX:MaxRAM\f[R]
3267 option.
3268 The default value is 1.5625 percent.
3269 .RS
3270 .PP
3271 The following example shows how to set the percentage of the initial
3272 amount of memory used for the Java heap:
3273 .RS
3274 .PP
3275 \f[CB]\-XX:InitialRAMPercentage=5\f[R]
3276 .RE
3277 .RE
3278 .TP
3279 .B \f[CB]\-XX:InitialSurvivorRatio=\f[R]\f[I]ratio\f[R]
3280 Sets the initial survivor space ratio used by the throughput garbage
3281 collector (which is enabled by the \f[CB]\-XX:+UseParallelGC\f[R] and/or
3282 \f[CB]\-XX:+UseParallelOldGC\f[R] options).
3283 Adaptive sizing is enabled by default with the throughput garbage
3284 collector by using the \f[CB]\-XX:+UseParallelGC\f[R] and
3285 \f[CB]\-XX:+UseParallelOldGC\f[R] options, and the survivor space is
3286 resized according to the application behavior, starting with the initial
3287 value.
3288 If adaptive sizing is disabled (using the
3289 \f[CB]\-XX:\-UseAdaptiveSizePolicy\f[R] option), then the
3290 \f[CB]\-XX:SurvivorRatio\f[R] option should be used to set the size of the
3291 survivor space for the entire execution of the application.
3292 .RS
3293 .PP
3294 The following formula can be used to calculate the initial size of
3295 survivor space (S) based on the size of the young generation (Y), and
3296 the initial survivor space ratio (R):
3297 .RS
3298 .PP
3299 \f[CB]S=Y/(R+2)\f[R]
3300 .RE
3301 .PP
3302 The 2 in the equation denotes two survivor spaces.
3303 The larger the value specified as the initial survivor space ratio, the
3304 smaller the initial survivor space size.
3305 .PP
3306 By default, the initial survivor space ratio is set to 8.
3307 If the default value for the young generation space size is used (2 MB),
3308 then the initial size of the survivor space is 0.2 MB.
3309 .PP
3310 The following example shows how to set the initial survivor space ratio
3311 to 4:
3312 .RS
3313 .PP
3314 \f[CB]\-XX:InitialSurvivorRatio=4\f[R]
3315 .RE
3316 .RE
3317 .TP
3318 .B \f[CB]\-XX:InitiatingHeapOccupancyPercent=\f[R]\f[I]percent\f[R]
3319 Sets the percentage of the old generation occupancy (0 to 100) at which
3320 to start the first few concurrent marking cycles for the G1 garbage
3321 collector.
3322 .RS
3323 .PP
3324 By default, the initiating value is set to 45%.
3325 A value of 0 implies nonstop concurrent GC cycles from the beginning
3326 until G1 adaptively sets this value.
3327 .PP
3328 See also the \f[CB]\-XX:G1UseAdaptiveIHOP\f[R] and
3329 \f[CB]\-XX:G1AdaptiveIHOPNumInitialSamples\f[R] options.
3330 .PP
3331 The following example shows how to set the initiating heap occupancy to
3332 75%:
3333 .RS
3334 .PP
3335 \f[CB]\-XX:InitiatingHeapOccupancyPercent=75\f[R]
3336 .RE
3337 .RE
3338 .TP
3339 .B \f[CB]\-XX:MaxGCPauseMillis=\f[R]\f[I]time\f[R]
3340 Sets a target for the maximum GC pause time (in milliseconds).
3341 This is a soft goal, and the JVM will make its best effort to achieve
3342 it.
3343 The specified value doesn\[aq]t adapt to your heap size.
3344 By default, for G1 the maximum pause time target is 200 milliseconds.
3345 The other generational collectors do not use a pause time goal by
3346 default.
3347 .RS
3348 .PP
3349 The following example shows how to set the maximum target pause time to
3350 500 ms:
3351 .RS
3352 .PP
3353 \f[CB]\-XX:MaxGCPauseMillis=500\f[R]
3354 .RE
3355 .RE
3356 .TP
3357 .B \f[CB]\-XX:MaxHeapSize=\f[R]\f[I]size\f[R]
3358 Sets the maximum size (in byes) of the memory allocation pool.
3359 This value must be a multiple of 1024 and greater than 2 MB.
3360 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
3361 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
3362 \f[CB]G\f[R] to indicate gigabytes.
3363 The default value is selected at run time based on the system
3364 configuration.
3365 For server deployments, the options \f[CB]\-XX:InitialHeapSize\f[R] and
3366 \f[CB]\-XX:MaxHeapSize\f[R] are often set to the same value.
3367 .RS
3368 .PP
3369 The following examples show how to set the maximum allowed size of
3370 allocated memory to 80 MB using various units:
3371 .IP
3372 .nf
3373 \f[CB]
3374 \-XX:MaxHeapSize=83886080
3375 \-XX:MaxHeapSize=81920k
3376 \-XX:MaxHeapSize=80m
3377 \f[R]
3378 .fi
3379 .PP
3380 The \f[CB]\-XX:MaxHeapSize\f[R] option is equivalent to \f[CB]\-Xmx\f[R].
3381 .RE
3382 .TP
3383 .B \f[CB]\-XX:MaxHeapFreeRatio=\f[R]\f[I]percent\f[R]
3384 Sets the maximum allowed percentage of free heap space (0 to 100) after
3385 a GC event.
3386 If free heap space expands above this value, then the heap is shrunk.
3387 By default, this value is set to 70%.
3388 .RS
3389 .PP
3390 Minimize the Java heap size by lowering the values of the parameters
3391 \f[CB]MaxHeapFreeRatio\f[R] (default value is 70%) and
3392 \f[CB]MinHeapFreeRatio\f[R] (default value is 40%) with the command\-line
3393 options \f[CB]\-XX:MaxHeapFreeRatio\f[R] and
3394 \f[CB]\-XX:MinHeapFreeRatio\f[R].
3395 Lowering \f[CB]MaxHeapFreeRatio\f[R] to as low as 10% and
3396 \f[CB]MinHeapFreeRatio\f[R] to 5% has successfully reduced the heap size
3397 without too much performance regression; however, results may vary
3398 greatly depending on your application.
3399 Try different values for these parameters until they\[aq]re as low as
3400 possible yet still retain acceptable performance.
3401 .RS
3402 .PP
3403 \f[CB]\-XX:MaxHeapFreeRatio=10\ \-XX:MinHeapFreeRatio=5\f[R]
3404 .RE
3405 .PP
3406 Customers trying to keep the heap small should also add the option
3407 \f[CB]\-XX:\-ShrinkHeapInSteps\f[R].
3408 See \f[B]Performance Tuning Examples\f[R] for a description of using this
3409 option to keep the Java heap small by reducing the dynamic footprint for
3410 embedded applications.
3411 .RE
3412 .TP
3413 .B \f[CB]\-XX:MaxMetaspaceSize=\f[R]\f[I]size\f[R]
3414 Sets the maximum amount of native memory that can be allocated for class
3415 metadata.
3416 By default, the size isn\[aq]t limited.
3417 The amount of metadata for an application depends on the application
3418 itself, other running applications, and the amount of memory available
3419 on the system.
3420 .RS
3421 .PP
3422 The following example shows how to set the maximum class metadata size
3423 to 256 MB:
3424 .RS
3425 .PP
3426 \f[CB]\-XX:MaxMetaspaceSize=256m\f[R]
3427 .RE
3428 .RE
3429 .TP
3430 .B \f[CB]\-XX:MaxNewSize=\f[R]\f[I]size\f[R]
3431 Sets the maximum size (in bytes) of the heap for the young generation
3432 (nursery).
3433 The default value is set ergonomically.
3434 .RS
3435 .RE
3436 .TP
3437 .B \f[CB]\-XX:MaxRAM=\f[R]\f[I]size\f[R]
3438 Sets the maximum amount of memory that the JVM may use for the Java heap
3439 before applying ergonomics heuristics.
3440 The default value is the maximum amount of available memory to the JVM
3441 process or 128 GB, whichever is lower.
3442 .RS
3443 .PP
3444 The maximum amount of available memory to the JVM process is the minimum
3445 of the machine\[aq]s physical memory and any constraints set by the
3446 environment (e.g.
3447 container).
3448 .PP
3449 Specifying this option disables automatic use of compressed oops if the
3450 combined result of this and other options influencing the maximum amount
3451 of memory is larger than the range of memory addressable by compressed
3452 oops.
3453 See \f[CB]\-XX:UseCompressedOops\f[R] for further information about
3454 compressed oops.
3455 .PP
3456 The following example shows how to set the maximum amount of available
3457 memory for sizing the Java heap to 2 GB:
3458 .RS
3459 .PP
3460 \f[CB]\-XX:MaxRAM=2G\f[R]
3461 .RE
3462 .RE
3463 .TP
3464 .B \f[CB]\-XX:MaxRAMPercentage=\f[R]\f[I]percent\f[R]
3465 Sets the maximum amount of memory that the JVM may use for the Java heap
3466 before applying ergonomics heuristics as a percentage of the maximum
3467 amount determined as described in the \f[CB]\-XX:MaxRAM\f[R] option.
3468 The default value is 25 percent.
3469 .RS
3470 .PP
3471 Specifying this option disables automatic use of compressed oops if the
3472 combined result of this and other options influencing the maximum amount
3473 of memory is larger than the range of memory addressable by compressed
3474 oops.
3475 See \f[CB]\-XX:UseCompressedOops\f[R] for further information about
3476 compressed oops.
3477 .PP
3478 The following example shows how to set the percentage of the maximum
3479 amount of memory used for the Java heap:
3480 .RS
3481 .PP
3482 \f[CB]\-XX:MaxRAMPercentage=75\f[R]
3483 .RE
3484 .RE
3485 .TP
3486 .B \f[CB]\-XX:MinRAMPercentage=\f[R]\f[I]percent\f[R]
3487 Sets the maximum amount of memory that the JVM may use for the Java heap
3488 before applying ergonomics heuristics as a percentage of the maximum
3489 amount determined as described in the \f[CB]\-XX:MaxRAM\f[R] option for
3490 small heaps.
3491 A small heap is a heap of approximately 125 MB.
3492 The default value is 50 percent.
3493 .RS
3494 .PP
3495 The following example shows how to set the percentage of the maximum
3496 amount of memory used for the Java heap for small heaps:
3497 .RS
3498 .PP
3499 \f[CB]\-XX:MinRAMPercentage=75\f[R]
3500 .RE
3501 .RE
3502 .TP
3503 .B \f[CB]\-XX:MaxTenuringThreshold=\f[R]\f[I]threshold\f[R]
3504 Sets the maximum tenuring threshold for use in adaptive GC sizing.
3505 The largest value is 15.
3506 The default value is 15 for the parallel (throughput) collector.
3507 .RS
3508 .PP
3509 The following example shows how to set the maximum tenuring threshold to
3510 10:
3511 .RS
3512 .PP
3513 \f[CB]\-XX:MaxTenuringThreshold=10\f[R]
3514 .RE
3515 .RE
3516 .TP
3517 .B \f[CB]\-XX:MetaspaceSize=\f[R]\f[I]size\f[R]
3518 Sets the size of the allocated class metadata space that triggers a
3519 garbage collection the first time it\[aq]s exceeded.
3520 This threshold for a garbage collection is increased or decreased
3521 depending on the amount of metadata used.
3522 The default size depends on the platform.
3523 .RS
3524 .RE
3525 .TP
3526 .B \f[CB]\-XX:MinHeapFreeRatio=\f[R]\f[I]percent\f[R]
3527 Sets the minimum allowed percentage of free heap space (0 to 100) after
3528 a GC event.
3529 If free heap space falls below this value, then the heap is expanded.
3530 By default, this value is set to 40%.
3531 .RS
3532 .PP
3533 Minimize Java heap size by lowering the values of the parameters
3534 \f[CB]MaxHeapFreeRatio\f[R] (default value is 70%) and
3535 \f[CB]MinHeapFreeRatio\f[R] (default value is 40%) with the command\-line
3536 options \f[CB]\-XX:MaxHeapFreeRatio\f[R] and
3537 \f[CB]\-XX:MinHeapFreeRatio\f[R].
3538 Lowering \f[CB]MaxHeapFreeRatio\f[R] to as low as 10% and
3539 \f[CB]MinHeapFreeRatio\f[R] to 5% has successfully reduced the heap size
3540 without too much performance regression; however, results may vary
3541 greatly depending on your application.
3542 Try different values for these parameters until they\[aq]re as low as
3543 possible, yet still retain acceptable performance.
3544 .RS
3545 .PP
3546 \f[CB]\-XX:MaxHeapFreeRatio=10\ \-XX:MinHeapFreeRatio=5\f[R]
3547 .RE
3548 .PP
3549 Customers trying to keep the heap small should also add the option
3550 \f[CB]\-XX:\-ShrinkHeapInSteps\f[R].
3551 See \f[B]Performance Tuning Examples\f[R] for a description of using this
3552 option to keep the Java heap small by reducing the dynamic footprint for
3553 embedded applications.
3554 .RE
3555 .TP
3556 .B \f[CB]\-XX:MinHeapSize=\f[R]\f[I]size\f[R]
3557 Sets the minimum size (in bytes) of the memory allocation pool.
3558 This value must be either 0, or a multiple of 1024 and greater than 1
3559 MB.
3560 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
3561 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
3562 \f[CB]G\f[R] to indicate gigabytes.
3563 The default value is selected at run time based on the system
3564 configuration.
3565 .RS
3566 .PP
3567 The following examples show how to set the mimimum size of allocated
3568 memory to 6 MB using various units:
3569 .IP
3570 .nf
3571 \f[CB]
3572 \-XX:MinHeapSize=6291456
3573 \-XX:MinHeapSize=6144k
3574 \-XX:MinHeapSize=6m
3575 \f[R]
3576 .fi
3577 .PP
3578 If you set this option to 0, then the minimum size is set to the same
3579 value as the initial size.
3580 .RE
3581 .TP
3582 .B \f[CB]\-XX:NewRatio=\f[R]\f[I]ratio\f[R]
3583 Sets the ratio between young and old generation sizes.
3584 By default, this option is set to 2.
3585 The following example shows how to set the young\-to\-old ratio to 1:
3586 .RS
3587 .RS
3588 .PP
3589 \f[CB]\-XX:NewRatio=1\f[R]
3590 .RE
3591 .RE
3592 .TP
3593 .B \f[CB]\-XX:NewSize=\f[R]\f[I]size\f[R]
3594 Sets the initial size (in bytes) of the heap for the young generation
3595 (nursery).
3596 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
3597 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
3598 \f[CB]G\f[R] to indicate gigabytes.
3599 .RS
3600 .PP
3601 The young generation region of the heap is used for new objects.
3602 GC is performed in this region more often than in other regions.
3603 If the size for the young generation is too low, then a large number of
3604 minor GCs are performed.
3605 If the size is too high, then only full GCs are performed, which can
3606 take a long time to complete.
3607 It is recommended that you keep the size for the young generation
3608 greater than 25% and less than 50% of the overall heap size.
3609 .PP
3610 The following examples show how to set the initial size of the young
3611 generation to 256 MB using various units:
3612 .IP
3613 .nf
3614 \f[CB]
3615 \-XX:NewSize=256m
3616 \-XX:NewSize=262144k
3617 \-XX:NewSize=268435456
3618 \f[R]
3619 .fi
3620 .PP
3621 The \f[CB]\-XX:NewSize\f[R] option is equivalent to \f[CB]\-Xmn\f[R].
3622 .RE
3623 .TP
3624 .B \f[CB]\-XX:ParallelGCThreads=\f[R]\f[I]threads\f[R]
3625 Sets the number of the stop\-the\-world (STW) worker threads.
3626 The default value depends on the number of CPUs available to the JVM and
3627 the garbage collector selected.
3628 .RS
3629 .PP
3630 For example, to set the number of threads for G1 GC to 2, specify the
3631 following option:
3632 .RS
3633 .PP
3634 \f[CB]\-XX:ParallelGCThreads=2\f[R]
3635 .RE
3636 .RE
3637 .TP
3638 .B \f[CB]\-XX:+ParallelRefProcEnabled\f[R]
3639 Enables parallel reference processing.
3640 By default, this option is disabled.
3641 .RS
3642 .RE
3643 .TP
3644 .B \f[CB]\-XX:+PrintAdaptiveSizePolicy\f[R]
3645 Enables printing of information about adaptive\-generation sizing.
3646 By default, this option is disabled.
3647 .RS
3648 .RE
3649 .TP
3650 .B \f[CB]\-XX:+ScavengeBeforeFullGC\f[R]
3651 Enables GC of the young generation before each full GC.
3652 This option is enabled by default.
3653 It is recommended that you \f[I]don\[aq]t\f[R] disable it, because
3654 scavenging the young generation before a full GC can reduce the number
3655 of objects reachable from the old generation space into the young
3656 generation space.
3657 To disable GC of the young generation before each full GC, specify the
3658 option \f[CB]\-XX:\-ScavengeBeforeFullGC\f[R].
3659 .RS
3660 .RE
3661 .TP
3662 .B \f[CB]\-XX:SoftRefLRUPolicyMSPerMB=\f[R]\f[I]time\f[R]
3663 Sets the amount of time (in milliseconds) a softly reachable object is
3664 kept active on the heap after the last time it was referenced.
3665 The default value is one second of lifetime per free megabyte in the
3666 heap.
3667 The \f[CB]\-XX:SoftRefLRUPolicyMSPerMB\f[R] option accepts integer values
3668 representing milliseconds per one megabyte of the current heap size (for
3669 Java HotSpot Client VM) or the maximum possible heap size (for Java
3670 HotSpot Server VM).
3671 This difference means that the Client VM tends to flush soft references
3672 rather than grow the heap, whereas the Server VM tends to grow the heap
3673 rather than flush soft references.
3674 In the latter case, the value of the \f[CB]\-Xmx\f[R] option has a
3675 significant effect on how quickly soft references are garbage collected.
3676 .RS
3677 .PP
3678 The following example shows how to set the value to 2.5 seconds:
3679 .PP
3680 \f[CB]\-XX:SoftRefLRUPolicyMSPerMB=2500\f[R]
3681 .RE
3682 .TP
3683 .B \f[CB]\-XX:\-ShrinkHeapInSteps\f[R]
3684 Incrementally reduces the Java heap to the target size, specified by the
3685 option \f[CB]\-XX:MaxHeapFreeRatio\f[R].
3686 This option is enabled by default.
3687 If disabled, then it immediately reduces the Java heap to the target
3688 size instead of requiring multiple garbage collection cycles.
3689 Disable this option if you want to minimize the Java heap size.
3690 You will likely encounter performance degradation when this option is
3691 disabled.
3692 .RS
3693 .PP
3694 See \f[B]Performance Tuning Examples\f[R] for a description of using the
3695 \f[CB]MaxHeapFreeRatio\f[R] option to keep the Java heap small by reducing
3696 the dynamic footprint for embedded applications.
3697 .RE
3698 .TP
3699 .B \f[CB]\-XX:StringDeduplicationAgeThreshold=\f[R]\f[I]threshold\f[R]
3700 Identifies \f[CB]String\f[R] objects reaching the specified age that are
3701 considered candidates for deduplication.
3702 An object\[aq]s age is a measure of how many times it has survived
3703 garbage collection.
3704 This is sometimes referred to as tenuring.
3705 .RS
3706 .RS
3707 .PP
3708 \f[B]Note:\f[R] \f[CB]String\f[R] objects that are promoted to an old heap
3709 region before this age has been reached are always considered candidates
3710 for deduplication.
3711 The default value for this option is \f[CB]3\f[R].
3712 See the \f[CB]\-XX:+UseStringDeduplication\f[R] option.
3713 .RE
3714 .RE
3715 .TP
3716 .B \f[CB]\-XX:SurvivorRatio=\f[R]\f[I]ratio\f[R]
3717 Sets the ratio between eden space size and survivor space size.
3718 By default, this option is set to 8.
3719 The following example shows how to set the eden/survivor space ratio to
3720 4:
3721 .RS
3722 .RS
3723 .PP
3724 \f[CB]\-XX:SurvivorRatio=4\f[R]
3725 .RE
3726 .RE
3727 .TP
3728 .B \f[CB]\-XX:TargetSurvivorRatio=\f[R]\f[I]percent\f[R]
3729 Sets the desired percentage of survivor space (0 to 100) used after
3730 young garbage collection.
3731 By default, this option is set to 50%.
3732 .RS
3733 .PP
3734 The following example shows how to set the target survivor space ratio
3735 to 30%:
3736 .RS
3737 .PP
3738 \f[CB]\-XX:TargetSurvivorRatio=30\f[R]
3739 .RE
3740 .RE
3741 .TP
3742 .B \f[CB]\-XX:TLABSize=\f[R]\f[I]size\f[R]
3743 Sets the initial size (in bytes) of a thread\-local allocation buffer
3744 (TLAB).
3745 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
3746 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
3747 \f[CB]G\f[R] to indicate gigabytes.
3748 If this option is set to 0, then the JVM selects the initial size
3749 automatically.
3750 .RS
3751 .PP
3752 The following example shows how to set the initial TLAB size to 512 KB:
3753 .RS
3754 .PP
3755 \f[CB]\-XX:TLABSize=512k\f[R]
3756 .RE
3757 .RE
3758 .TP
3759 .B \f[CB]\-XX:+UseAdaptiveSizePolicy\f[R]
3760 Enables the use of adaptive generation sizing.
3761 This option is enabled by default.
3762 To disable adaptive generation sizing, specify
3763 \f[CB]\-XX:\-UseAdaptiveSizePolicy\f[R] and set the size of the memory
3764 allocation pool explicitly.
3765 See the \f[CB]\-XX:SurvivorRatio\f[R] option.
3766 .RS
3767 .RE
3768 .TP
3769 .B \f[CB]\-XX:+UseG1GC\f[R]
3770 Enables the use of the garbage\-first (G1) garbage collector.
3771 It\[aq]s a server\-style garbage collector, targeted for multiprocessor
3772 machines with a large amount of RAM.
3773 This option meets GC pause time goals with high probability, while
3774 maintaining good throughput.
3775 The G1 collector is recommended for applications requiring large heaps
3776 (sizes of around 6 GB or larger) with limited GC latency requirements (a
3777 stable and predictable pause time below 0.5 seconds).
3778 By default, this option is enabled and G1 is used as the default garbage
3779 collector.
3780 .RS
3781 .RE
3782 .TP
3783 .B \f[CB]\-XX:+UseGCOverheadLimit\f[R]
3784 Enables the use of a policy that limits the proportion of time spent by
3785 the JVM on GC before an \f[CB]OutOfMemoryError\f[R] exception is thrown.
3786 This option is enabled, by default, and the parallel GC will throw an
3787 \f[CB]OutOfMemoryError\f[R] if more than 98% of the total time is spent on
3788 garbage collection and less than 2% of the heap is recovered.
3789 When the heap is small, this feature can be used to prevent applications
3790 from running for long periods of time with little or no progress.
3791 To disable this option, specify the option
3792 \f[CB]\-XX:\-UseGCOverheadLimit\f[R].
3793 .RS
3794 .RE
3795 .TP
3796 .B \f[CB]\-XX:+UseNUMA\f[R]
3797 Enables performance optimization of an application on a machine with
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
3838 collector.
3839 .RS
3840 .PP
3841 String deduplication reduces the memory footprint of \f[CB]String\f[R]
3842 objects on the Java heap by taking advantage of the fact that many
3843 \f[CB]String\f[R] objects are identical.
3844 Instead of each \f[CB]String\f[R] object pointing to its own character
3845 array, identical \f[CB]String\f[R] objects can point to and share the same
3846 character array.
3847 .RE
3848 .TP
3849 .B \f[CB]\-XX:+UseTLAB\f[R]
3850 Enables the use of thread\-local allocation blocks (TLABs) in the young
3851 generation space.
3852 This option is enabled by default.
3853 To disable the use of TLABs, specify the option \f[CB]\-XX:\-UseTLAB\f[R].
3854 .RS
3855 .RE
3856 .TP
3857 .B \f[CB]\-XX:+UseZGC\f[R]
3858 Enables the use of the Z garbage collector.
3859 This garbage collector is best for providing lowest latency with large
3860 Java heaps at some throughput cost.
3861 This is an experimental garbage collector, you need to specify
3862 \f[CB]\-XX:+UnlockExperimentalVMOptions\f[R] before \f[CB]\-XX:+UseZGC\f[R]
3863 on the command line.
3864 .RS
3865 .PP
3866 Example:
3867 .RS
3868 .PP
3869 \f[CB]\-XX:+UnlockExperimentalVMOptions\ \-XX:+UseZGC\f[R]
3870 .RE
3871 .RE
3872 .SH DEPRECATED JAVA OPTIONS
3873 .PP
3874 These \f[CB]java\f[R] options are deprecated and might be removed in a
3875 future JDK release.
3876 They\[aq]re still accepted and acted upon, but a warning is issued when
3877 they\[aq]re used.
3878 .TP
3879 .B \f[CB]\-Xfuture\f[R]
3880 Enables strict class\-file format checks that enforce close conformance
3881 to the class\-file format specification.
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
3922 amount determined as described in the \f[CB]\-XX:MaxRAM\f[R] option.
3923 The default value is 4.
3924 .RS
3925 .PP
3926 Specifying this option disables automatic use of compressed oops if the
3927 combined result of this and other options influencing the maximum amount
3928 of memory is larger than the range of memory addressable by compressed
3929 oops.
3930 See \f[CB]\-XX:UseCompressedOops\f[R] for further information about
3931 compressed oops.
3932 .PP
3933 Use the option \f[CB]\-XX:MaxRAMPercentage\f[R] instead.
3934 .RE
3935 .TP
3936 .B \f[CB]\-XX:MinRAMFraction=\f[R]\f[I]ratio\f[R]
3937 Sets the maximum amount of memory that the JVM may use for the Java heap
3938 before applying ergonomics heuristics as a fraction of the maximum
3939 amount determined as described in the \f[CB]\-XX:MaxRAM\f[R] option for
3940 small heaps.
3941 A small heap is a heap of approximately 125 MB.
3942 The default value is 2.
3943 .RS
3944 .PP
3945 Use the option \f[CB]\-XX:MinRAMPercentage\f[R] instead.
3946 .RE
3947 .TP
3948 .B \f[CB]\-XX:+TraceClassLoading\f[R]
3949 Enables tracing of classes as they are loaded.
3950 By default, this option is disabled and classes aren\[aq]t traced.
3951 .RS
3952 .PP
3953 The replacement Unified Logging syntax is
3954 \f[CB]\-Xlog:class+load=\f[R]\f[I]level\f[R].
3955 See \f[B]Enable Logging with the JVM Unified Logging Framework\f[R]
3956 .PP
3957 Use \f[I]level\f[R]=\f[CB]info\f[R] for regular information, or
3958 \f[I]level\f[R]=\f[CB]debug\f[R] for additional information.
3959 In Unified Logging syntax, \f[CB]\-verbose:class\f[R] equals
3960 \f[CB]\-Xlog:class+load=info,class+unload=info\f[R].
3961 .RE
3962 .TP
3963 .B \f[CB]\-XX:+TraceClassLoadingPreorder\f[R]
3964 Enables tracing of all loaded classes in the order in which they\[aq]re
3965 referenced.
3966 By default, this option is disabled and classes aren\[aq]t traced.
3967 .RS
3968 .PP
3969 The replacement Unified Logging syntax is
3970 \f[CB]\-Xlog:class+preorder=debug\f[R].
3971 See \f[B]Enable Logging with the JVM Unified Logging Framework\f[R].
3972 .RE
3973 .TP
3974 .B \f[CB]\-XX:+TraceClassResolution\f[R]
3975 Enables tracing of constant pool resolutions.
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
4068 .PP
4069 You can shorten or simplify the \f[CB]java\f[R] command by using
4070 \f[CB]\@\f[R] argument files to specify one or more text files that
4071 contain arguments, such as options and class names, which are passed to
4072 the \f[CB]java\f[R] command.
4073 This let\[aq]s you to create \f[CB]java\f[R] commands of any length on any
4074 operating system.
4075 .PP
4076 In the command line, use the at sign (\f[CB]\@\f[R]) prefix to identify an
4077 argument file that contains \f[CB]java\f[R] options and class names.
4078 When the \f[CB]java\f[R] command encounters a file beginning with the at
4079 sign (\f[CB]\@\f[R]), it expands the contents of that file into an
4080 argument list just as they would be specified on the command line.
4081 .PP
4082 The \f[CB]java\f[R] launcher expands the argument file contents until it
4083 encounters the \f[CB]\-\-disable\-\@files\f[R] option.
4084 You can use the \f[CB]\-\-disable\-\@files\f[R] option anywhere on the
4085 command line, including in an argument file, to stop \f[CB]\@\f[R]
4086 argument files expansion.
4087 .PP
4088 The following items describe the syntax of \f[CB]java\f[R] argument files:
4089 .IP \[bu] 2
4090 The argument file must contain only ASCII characters or characters in
4091 system default encoding that\[aq]s ASCII friendly, such as UTF\-8.
4092 .IP \[bu] 2
4093 The argument file size must not exceed MAXINT (2,147,483,647) bytes.
4094 .IP \[bu] 2
4095 The launcher doesn\[aq]t expand wildcards that are present within an
4096 argument file.
4097 .IP \[bu] 2
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
4231 \f[CB]path2/options\f[R] represent argument files with different paths.
4232 Any relative paths that they contain are relative to the current working
4233 directory and not to the argument files:
4234 .RS
4235 .PP
4236 \f[CB]java\ \@path1/options\ \@path2/classes\f[R]
4237 .RE
4238 .SH CODE HEAP STATE ANALYTICS
4239 .SS Overview
4240 .PP
4241 There are occasions when having insight into the current state of the
4242 JVM code heap would be helpful to answer questions such as:
4243 .IP \[bu] 2
4244 Why was the JIT turned off and then on again and again?
4245 .IP \[bu] 2
4246 Where has all the code heap space gone?
4247 .IP \[bu] 2
4248 Why is the method sweeper not working effectively?
4249 .PP
4250 To provide this insight, a code heap state analytics feature has been
4251 implemented that enables on\-the\-fly analysis of the code heap.
4252 The analytics process is divided into two parts.
4253 The first part examines the entire code heap and aggregates all
4254 information that is believed to be useful or important.
4255 The second part consists of several independent steps that print the
4256 collected information with an emphasis on different aspects of the data.
4257 Data collection and printing are done on an "on request" basis.
4258 .SS Syntax
4259 .PP
4260 Requests for real\-time, on\-the\-fly analysis can be issued with the
4261 following command:
4262 .RS
4263 .PP
4264 \f[CB]jcmd\f[R] \f[I]pid\f[R] \f[CB]Compiler.CodeHeap_Analytics\f[R]
4265 [\f[I]function\f[R]] [\f[I]granularity\f[R]]
4266 .RE
4267 .PP
4268 If you are only interested in how the code heap looks like after running
4269 a sample workload, you can use the command line option:
4270 .RS
4271 .PP
4272 \f[CB]\-Xlog:codecache=Trace\f[R]
4273 .RE
4274 .PP
4275 To see the code heap state when a "CodeCache full" condition exists,
4276 start the VM with the command line option:
4277 .RS
4278 .PP
4279 \f[CB]\-Xlog:codecache=Debug\f[R]
4280 .RE
4281 .PP
4282 See \f[B]CodeHeap State Analytics (OpenJDK)\f[R]
4283 [https://bugs.openjdk.java.net/secure/attachment/75649/JVM_CodeHeap_StateAnalytics_V2.pdf]
4284 for a detailed description of the code heap state analytics feature, the
4285 supported functions, and the granularity options.
4286 .SH ENABLE LOGGING WITH THE JVM UNIFIED LOGGING FRAMEWORK
4287 .PP
4288 You use the \f[CB]\-Xlog\f[R] option to configure or enable logging with
4289 the Java Virtual Machine (JVM) unified logging framework.
4290 .SS Synopsis
4291 .RS
4292 .PP
4293 \f[CB]\-Xlog\f[R][\f[CB]:\f[R][\f[I]what\f[R]][\f[CB]:\f[R][\f[I]output\f[R]][\f[CB]:\f[R][\f[I]decorators\f[R]][\f[CB]:\f[R]\f[I]output\-options\f[R][\f[CB],\f[R]...]]]]]
4294 .RE
4295 .TP
4296 .B \f[I]what\f[R]
4297 Specifies a combination of tags and levels of the form
4298 \f[I]tag1\f[R][\f[CB]+\f[R]\f[I]tag2\f[R]...][\f[CB]*\f[R]][\f[CB]=\f[R]\f[I]level\f[R]][\f[CB],\f[R]...].
4299 Unless the wildcard (\f[CB]*\f[R]) is specified, only log messages tagged
4300 with exactly the tags specified are matched.
4301 See \f[B]\-Xlog Tags and Levels\f[R].
4302 .RS
4303 .RE
4304 .TP
4305 .B \f[I]output\f[R]
4306 Sets the type of output.
4307 Omitting the \f[I]output\f[R] type defaults to \f[CB]stdout\f[R].
4308 See \f[B]\-Xlog Output\f[R].
4309 .RS
4310 .RE
4311 .TP
4312 .B \f[I]decorators\f[R]
4313 Configures the output to use a custom set of decorators.
4314 Omitting \f[I]decorators\f[R] defaults to \f[CB]uptime\f[R],
4315 \f[CB]level\f[R], and \f[CB]tags\f[R].
4316 See \f[B]Decorations\f[R].
4317 .RS
4318 .RE
4319 .TP
4320 .B \f[I]output\-options\f[R]
4321 Sets the \f[CB]\-Xlog\f[R] logging output options.
4322 .RS
4323 .RE
4324 .SS Description
4325 .PP
4326 The Java Virtual Machine (JVM) unified logging framework provides a
4327 common logging system for all components of the JVM.
4328 GC logging for the JVM has been changed to use the new logging
4329 framework.
4330 The mapping of old GC flags to the corresponding new Xlog configuration
4331 is described in \f[B]Convert GC Logging Flags to Xlog\f[R].
4332 In addition, runtime logging has also been changed to use the JVM
4333 unified logging framework.
4334 The mapping of legacy runtime logging flags to the corresponding new
4335 Xlog configuration is described in \f[B]Convert Runtime Logging Flags to
4336 Xlog\f[R].
4337 .PP
4338 The following provides quick reference to the \f[CB]\-Xlog\f[R] command
4339 and syntax for options:
4340 .TP
4341 .B \f[CB]\-Xlog\f[R]
4342 Enables JVM logging on an \f[CB]info\f[R] level.
4343 .RS
4344 .RE
4345 .TP
4346 .B \f[CB]\-Xlog:help\f[R]
4347 Prints \f[CB]\-Xlog\f[R] usage syntax and available tags, levels, and
4348 decorators along with example command lines with explanations.
4349 .RS
4350 .RE
4351 .TP
4352 .B \f[CB]\-Xlog:disable\f[R]
4353 Turns off all logging and clears all configuration of the logging
4354 framework including the default configuration for warnings and errors.
4355 .RS
4356 .RE
4357 .TP
4358 .B \f[CB]\-Xlog\f[R][\f[CB]:\f[R]\f[I]option\f[R]]
4359 Applies multiple arguments in the order that they appear on the command
4360 line.
4361 Multiple \f[CB]\-Xlog\f[R] arguments for the same output override each
4362 other in their given order.
4363 .RS
4364 .PP
4365 The \f[I]option\f[R] is set as:
4366 .RS
4367 .PP
4368 [\f[I]tag\-selection\f[R]][\f[CB]:\f[R][\f[I]output\f[R]][\f[CB]:\f[R][\f[I]decorators\f[R]][\f[CB]:\f[R]\f[I]output\-options\f[R]]]]
4369 .RE
4370 .PP
4371 Omitting the \f[I]tag\-selection\f[R] defaults to a tag\-set of
4372 \f[CB]all\f[R] and a level of \f[CB]info\f[R].
4373 .RS
4374 .PP
4375 \f[I]tag\f[R][\f[CB]+\f[R]...] \f[CB]all\f[R]
4376 .RE
4377 .PP
4378 The \f[CB]all\f[R] tag is a meta tag consisting of all tag\-sets
4379 available.
4380 The asterisk \f[CB]*\f[R] in a tag set definition denotes a wildcard tag
4381 match.
4382 Matching with a wildcard selects all tag sets that contain \f[I]at
4383 least\f[R] the specified tags.
4384 Without the wildcard, only exact matches of the specified tag sets are
4385 selected.
4386 .PP
4387 \f[I]output\-options\f[R] is
4388 .RS
4389 .PP
4390 \f[CB]filecount=\f[R]\f[I]file\-count\f[R] \f[CB]filesize=\f[R]\f[I]file size
4391 with optional K, M or G suffix\f[R]
4392 .RE
4393 .RE
4394 .SS Default Configuration
4395 .PP
4396 When the \f[CB]\-Xlog\f[R] option and nothing else is specified on the
4397 command line, the default configuration is used.
4398 The default configuration logs all messages with a level that matches
4399 either warning or error regardless of what tags the message is
4400 associated with.
4401 The default configuration is equivalent to entering the following on the
4402 command line:
4403 .RS
4404 .PP
4405 \f[CB]\-Xlog:all=warning:stdout:uptime,level,tags\f[R]
4406 .RE
4407 .SS Controlling Logging at Runtime
4408 .PP
4409 Logging can also be controlled at run time through Diagnostic Commands
4410 (with the \f[B]jcmd\f[R] utility).
4411 Everything that can be specified on the command line can also be
4412 specified dynamically with the \f[CB]VM.log\f[R] command.
4413 As the diagnostic commands are automatically exposed as MBeans, you can
4414 use JMX to change logging configuration at run time.
4415 .SS \-Xlog Tags and Levels
4416 .PP
4417 Each log message has a level and a tag set associated with it.
4418 The level of the message corresponds to its details, and the tag set
4419 corresponds to what the message contains or which JVM component it
4420 involves (such as, \f[CB]gc\f[R], \f[CB]jit\f[R], or \f[CB]os\f[R]).
4421 Mapping GC flags to the Xlog configuration is described in \f[B]Convert
4422 GC Logging Flags to Xlog\f[R].
4423 Mapping legacy runtime logging flags to the corresponding Xlog
4424 configuration is described in \f[B]Convert Runtime Logging Flags to
4425 Xlog\f[R].
4426 .PP
4427 \f[B]Available log levels:\f[R]
4428 .IP \[bu] 2
4429 \f[CB]off\f[R]
4430 .IP \[bu] 2
4431 \f[CB]trace\f[R]
4432 .IP \[bu] 2
4433 \f[CB]debug\f[R]
4434 .IP \[bu] 2
4435 \f[CB]info\f[R]
4436 .IP \[bu] 2
4437 \f[CB]warning\f[R]
4438 .IP \[bu] 2
4439 \f[CB]error\f[R]
4440 .PP
4441 \f[B]Available log tags:\f[R]
4442 .PP
4443 There are literally dozens of log tags, which in the right combinations,
4444 will enable a range of logging output.
4445 The full set of available log tags can be seen using
4446 \f[CB]\-Xlog:help\f[R].
4447 Specifying \f[CB]all\f[R] instead of a tag combination matches all tag
4448 combinations.
4449 .SS \-Xlog Output
4450 .PP
4451 The \f[CB]\-Xlog\f[R] option supports the following types of outputs:
4452 .IP \[bu] 2
4453 \f[CB]stdout\f[R] \-\-\- Sends output to stdout
4454 .IP \[bu] 2
4455 \f[CB]stderr\f[R] \-\-\- Sends output to stderr
4456 .IP \[bu] 2
4457 \f[CB]file=\f[R]\f[I]filename\f[R] \-\-\- Sends output to text file(s).
4458 .PP
4459 When using \f[CB]file=\f[R]\f[I]filename\f[R], specifying \f[CB]%p\f[R]
4460 and/or \f[CB]%t\f[R] in the file name expands to the JVM\[aq]s PID and
4461 startup timestamp, respectively.
4462 You can also configure text files to handle file rotation based on file
4463 size and a number of files to rotate.
4464 For example, to rotate the log file every 10 MB and keep 5 files in
4465 rotation, specify the options \f[CB]filesize=10M,\ filecount=5\f[R].
4466 The target size of the files isn\[aq]t guaranteed to be exact, it\[aq]s
4467 just an approximate value.
4468 Files are rotated by default with up to 5 rotated files of target size
4469 20 MB, unless configured otherwise.
4470 Specifying \f[CB]filecount=0\f[R] means that the log file shouldn\[aq]t be
4471 rotated.
4472 There\[aq]s a possibility of the pre\-existing log file getting
4473 overwritten.
4474 .SS Decorations
4475 .PP
4476 Logging messages are decorated with information about the message.
4477 You can configure each output to use a custom set of decorators.
4478 The order of the output is always the same as listed in the table.
4479 You can configure the decorations to be used at run time.
4480 Decorations are prepended to the log message.
4481 For example:
4482 .IP
4483 .nf
4484 \f[CB]
4485 [6.567s][info][gc,old]\ Old\ collection\ complete
4486 \f[R]
4487 .fi
4488 .PP
4489 Omitting \f[CB]decorators\f[R] defaults to \f[CB]uptime\f[R],
4490 \f[CB]level\f[R], and \f[CB]tags\f[R].
4491 The \f[CB]none\f[R] decorator is special and is used to turn off all
4492 decorations.
4493 .PP
4494 \f[CB]time\f[R] (\f[CB]t\f[R]), \f[CB]utctime\f[R] (\f[CB]utc\f[R]),
4495 \f[CB]uptime\f[R] (\f[CB]u\f[R]), \f[CB]timemillis\f[R] (\f[CB]tm\f[R]),
4496 \f[CB]uptimemillis\f[R] (\f[CB]um\f[R]), \f[CB]timenanos\f[R] (\f[CB]tn\f[R]),
4497 \f[CB]uptimenanos\f[R] (\f[CB]un\f[R]), \f[CB]hostname\f[R] (\f[CB]hn\f[R]),
4498 \f[CB]pid\f[R] (\f[CB]p\f[R]), \f[CB]tid\f[R] (\f[CB]ti\f[R]), \f[CB]level\f[R]
4499 (\f[CB]l\f[R]), \f[CB]tags\f[R] (\f[CB]tg\f[R]) decorators can also be
4500 specified as \f[CB]none\f[R] for no decoration.
4501 .PP
4502 .TS
4503 tab(@);
4504 lw(14.9n) lw(55.1n).
4505 T{
4506 Decorations
4507 T}@T{
4508 Description
4509 T}
4510 _
4511 T{
4512 \f[CB]time\f[R] or \f[CB]t\f[R]
4513 T}@T{
4514 Current time and date in ISO\-8601 format.
4515 T}
4516 T{
4517 \f[CB]utctime\f[R] or \f[CB]utc\f[R]
4518 T}@T{
4519 Universal Time Coordinated or Coordinated Universal Time.
4520 T}
4521 T{
4522 \f[CB]uptime\f[R] or \f[CB]u\f[R]
4523 T}@T{
4524 Time since the start of the JVM in seconds and milliseconds.
4525 For example, 6.567s.
4526 T}
4527 T{
4528 \f[CB]timemillis\f[R] or \f[CB]tm\f[R]
4529 T}@T{
4530 The same value as generated by \f[CB]System.currentTimeMillis()\f[R]
4531 T}
4532 T{
4533 \f[CB]uptimemillis\f[R] or \f[CB]um\f[R]
4534 T}@T{
4535 Milliseconds since the JVM started.
4536 T}
4537 T{
4538 \f[CB]timenanos\f[R] or \f[CB]tn\f[R]
4539 T}@T{
4540 The same value generated by \f[CB]System.nanoTime()\f[R].
4541 T}
4542 T{
4543 \f[CB]uptimenanos\f[R] or \f[CB]un\f[R]
4544 T}@T{
4545 Nanoseconds since the JVM started.
4546 T}
4547 T{
4548 \f[CB]hostname\f[R] or \f[CB]hn\f[R]
4549 T}@T{
4550 The host name.
4551 T}
4552 T{
4553 \f[CB]pid\f[R] or \f[CB]p\f[R]
4554 T}@T{
4555 The process identifier.
4556 T}
4557 T{
4558 \f[CB]tid\f[R] or \f[CB]ti\f[R]
4559 T}@T{
4560 The thread identifier.
4561 T}
4562 T{
4563 \f[CB]level\f[R] or \f[CB]l\f[R]
4564 T}@T{
4565 The level associated with the log message.
4566 T}
4567 T{
4568 \f[CB]tags\f[R] or \f[CB]tg\f[R]
4569 T}@T{
4570 The tag\-set associated with the log message.
4571 T}
4572 .TE
4573 .SS Convert GC Logging Flags to Xlog
4574 .PP
4575 .TS
4576 tab(@);
4577 lw(22.4n) lw(16.5n) lw(31.2n).
4578 T{
4579 Legacy Garbage Collection (GC) Flag
4580 T}@T{
4581 Xlog Configuration
4582 T}@T{
4583 Comment
4584 T}
4585 _
4586 T{
4587 \f[CB]G1PrintHeapRegions\f[R]
4588 T}@T{
4589 \f[CB]\-Xlog:gc+region=trace\f[R]
4590 T}@T{
4591 Not Applicable
4592 T}
4593 T{
4594 \f[CB]GCLogFileSize\f[R]
4595 T}@T{
4596 No configuration available
4597 T}@T{
4598 Log rotation is handled by the framework.
4599 T}
4600 T{
4601 \f[CB]NumberOfGCLogFiles\f[R]
4602 T}@T{
4603 Not Applicable
4604 T}@T{
4605 Log rotation is handled by the framework.
4606 T}
4607 T{
4608 \f[CB]PrintAdaptiveSizePolicy\f[R]
4609 T}@T{
4610 \f[CB]\-Xlog:gc+ergo*=\f[R]\f[I]level\f[R]
4611 T}@T{
4612 Use a \f[I]level\f[R] of \f[CB]debug\f[R] for most of the information, or a
4613 \f[I]level\f[R] of \f[CB]trace\f[R] for all of what was logged for
4614 \f[CB]PrintAdaptiveSizePolicy\f[R].
4615 T}
4616 T{
4617 \f[CB]PrintGC\f[R]
4618 T}@T{
4619 \f[CB]\-Xlog:gc\f[R]
4620 T}@T{
4621 Not Applicable
4622 T}
4623 T{
4624 \f[CB]PrintGCApplicationConcurrentTime\f[R]
4625 T}@T{
4626 \f[CB]\-Xlog:safepoint\f[R]
4627 T}@T{
4628 Note that \f[CB]PrintGCApplicationConcurrentTime\f[R] and
4629 \f[CB]PrintGCApplicationStoppedTime\f[R] are logged on the same tag and
4630 aren\[aq]t separated in the new logging.
4631 T}
4632 T{
4633 \f[CB]PrintGCApplicationStoppedTime\f[R]
4634 T}@T{
4635 \f[CB]\-Xlog:safepoint\f[R]
4636 T}@T{
4637 Note that \f[CB]PrintGCApplicationConcurrentTime\f[R] and
4638 \f[CB]PrintGCApplicationStoppedTime\f[R] are logged on the same tag and
4639 not separated in the new logging.
4640 T}
4641 T{
4642 \f[CB]PrintGCCause\f[R]
4643 T}@T{
4644 Not Applicable
4645 T}@T{
4646 GC cause is now always logged.
4647 T}
4648 T{
4649 \f[CB]PrintGCDateStamps\f[R]
4650 T}@T{
4651 Not Applicable
4652 T}@T{
4653 Date stamps are logged by the framework.
4654 T}
4655 T{
4656 \f[CB]PrintGCDetails\f[R]
4657 T}@T{
4658 \f[CB]\-Xlog:gc*\f[R]
4659 T}@T{
4660 Not Applicable
4661 T}
4662 T{
4663 \f[CB]PrintGCID\f[R]
4664 T}@T{
4665 Not Applicable
4666 T}@T{
4667 GC ID is now always logged.
4668 T}
4669 T{
4670 \f[CB]PrintGCTaskTimeStamps\f[R]
4671 T}@T{
4672 \f[CB]\-Xlog:gc+task*=debug\f[R]
4673 T}@T{
4674 Not Applicable
4675 T}
4676 T{
4677 \f[CB]PrintGCTimeStamps\f[R]
4678 T}@T{
4679 Not Applicable
4680 T}@T{
4681 Time stamps are logged by the framework.
4682 T}
4683 T{
4684 \f[CB]PrintHeapAtGC\f[R]
4685 T}@T{
4686 \f[CB]\-Xlog:gc+heap=trace\f[R]
4687 T}@T{
4688 Not Applicable
4689 T}
4690 T{
4691 \f[CB]PrintReferenceGC\f[R]
4692 T}@T{
4693 \f[CB]\-Xlog:gc+ref*=debug\f[R]
4694 T}@T{
4695 Note that in the old logging, \f[CB]PrintReferenceGC\f[R] had an effect
4696 only if \f[CB]PrintGCDetails\f[R] was also enabled.
4697 T}
4698 T{
4699 \f[CB]PrintStringDeduplicationStatistics\f[R]
4700 T}@T{
4701 `\-Xlog:gc+stringdedup*=debug
4702 T}@T{
4703 ` Not Applicable
4704 T}
4705 T{
4706 \f[CB]PrintTenuringDistribution\f[R]
4707 T}@T{
4708 \f[CB]\-Xlog:gc+age*=\f[R]\f[I]level\f[R]
4709 T}@T{
4710 Use a \f[I]level\f[R] of \f[CB]debug\f[R] for the most relevant
4711 information, or a \f[I]level\f[R] of \f[CB]trace\f[R] for all of what was
4712 logged for \f[CB]PrintTenuringDistribution\f[R].
4713 T}
4714 T{
4715 \f[CB]UseGCLogFileRotation\f[R]
4716 T}@T{
4717 Not Applicable
4718 T}@T{
4719 What was logged for \f[CB]PrintTenuringDistribution\f[R].
4720 T}
4721 .TE
4722 .SS Convert Runtime Logging Flags to Xlog
4723 .PP
4724 .TS
4725 tab(@);
4726 lw(15.0n) lw(20.2n) lw(34.7n).
4727 T{
4728 Legacy Runtime Flag
4729 T}@T{
4730 Xlog Configuration
4731 T}@T{
4732 Comment
4733 T}
4734 _
4735 T{
4736 \f[CB]TraceExceptions\f[R]
4737 T}@T{
4738 \f[CB]\-Xlog:exceptions=info\f[R]
4739 T}@T{
4740 Not Applicable
4741 T}
4742 T{
4743 \f[CB]TraceClassLoading\f[R]
4744 T}@T{
4745 \f[CB]\-Xlog:class+load=\f[R]\f[I]level\f[R]
4746 T}@T{
4747 Use \f[I]level\f[R]=\f[CB]info\f[R] for regular information, or
4748 \f[I]level\f[R]=\f[CB]debug\f[R] for additional information.
4749 In Unified Logging syntax, \f[CB]\-verbose:class\f[R] equals
4750 \f[CB]\-Xlog:class+load=info,class+unload=info\f[R].
4751 T}
4752 T{
4753 \f[CB]TraceClassLoadingPreorder\f[R]
4754 T}@T{
4755 \f[CB]\-Xlog:class+preorder=debug\f[R]
4756 T}@T{
4757 Not Applicable
4758 T}
4759 T{
4760 \f[CB]TraceClassUnloading\f[R]
4761 T}@T{
4762 \f[CB]\-Xlog:class+unload=\f[R]\f[I]level\f[R]
4763 T}@T{
4764 Use \f[I]level\f[R]=\f[CB]info\f[R] for regular information, or
4765 \f[I]level\f[R]=\f[CB]trace\f[R] for additional information.
4766 In Unified Logging syntax, \f[CB]\-verbose:class\f[R] equals
4767 \f[CB]\-Xlog:class+load=info,class+unload=info\f[R].
4768 T}
4769 T{
4770 \f[CB]VerboseVerification\f[R]
4771 T}@T{
4772 \f[CB]\-Xlog:verification=info\f[R]
4773 T}@T{
4774 Not Applicable
4775 T}
4776 T{
4777 \f[CB]TraceClassPaths\f[R]
4778 T}@T{
4779 \f[CB]\-Xlog:class+path=info\f[R]
4780 T}@T{
4781 Not Applicable
4782 T}
4783 T{
4784 \f[CB]TraceClassResolution\f[R]
4785 T}@T{
4786 \f[CB]\-Xlog:class+resolve=debug\f[R]
4787 T}@T{
4788 Not Applicable
4789 T}
4790 T{
4791 \f[CB]TraceClassInitialization\f[R]
4792 T}@T{
4793 \f[CB]\-Xlog:class+init=info\f[R]
4794 T}@T{
4795 Not Applicable
4796 T}
4797 T{
4798 \f[CB]TraceLoaderConstraints\f[R]
4799 T}@T{
4800 \f[CB]\-Xlog:class+loader+constraints=info\f[R]
4801 T}@T{
4802 Not Applicable
4803 T}
4804 T{
4805 \f[CB]TraceClassLoaderData\f[R]
4806 T}@T{
4807 \f[CB]\-Xlog:class+loader+data=\f[R]\f[I]level\f[R]
4808 T}@T{
4809 Use \f[I]level\f[R]=\f[CB]debug\f[R] for regular information or
4810 \f[I]level\f[R]=\f[CB]trace\f[R] for additional information.
4811 T}
4812 T{
4813 \f[CB]TraceSafepointCleanupTime\f[R]
4814 T}@T{
4815 \f[CB]\-Xlog:safepoint+cleanup=info\f[R]
4816 T}@T{
4817 Not Applicable
4818 T}
4819 T{
4820 \f[CB]TraceSafepoint\f[R]
4821 T}@T{
4822 \f[CB]\-Xlog:safepoint=debug\f[R]
4823 T}@T{
4824 Not Applicable
4825 T}
4826 T{
4827 \f[CB]TraceMonitorInflation\f[R]
4828 T}@T{
4829 \f[CB]\-Xlog:monitorinflation=debug\f[R]
4830 T}@T{
4831 Not Applicable
4832 T}
4833 T{
4834 \f[CB]TraceBiasedLocking\f[R]
4835 T}@T{
4836 \f[CB]\-Xlog:biasedlocking=\f[R]\f[I]level\f[R]
4837 T}@T{
4838 Use \f[I]level\f[R]=\f[CB]info\f[R] for regular information, or
4839 \f[I]level\f[R]=\f[CB]trace\f[R] for additional information.
4840 T}
4841 T{
4842 \f[CB]TraceRedefineClasses\f[R]
4843 T}@T{
4844 \f[CB]\-Xlog:redefine+class*=\f[R]\f[I]level\f[R]
4845 T}@T{
4846 \f[I]level\f[R]=\f[CB]info\f[R], \f[CB]debug\f[R], and \f[CB]trace\f[R] provide
4847 increasing amounts of information.
4848 T}
4849 .TE
4850 .SS \-Xlog Usage Examples
4851 .PP
4852 The following are \f[CB]\-Xlog\f[R] examples.
4853 .TP
4854 .B \f[CB]\-Xlog\f[R]
4855 Logs all messages by using the \f[CB]info\f[R] level to \f[CB]stdout\f[R]
4856 with \f[CB]uptime\f[R], \f[CB]levels\f[R], and \f[CB]tags\f[R] decorations.
4857 This is equivalent to using:
4858 .RS
4859 .RS
4860 .PP
4861 \f[CB]\-Xlog:all=info:stdout:uptime,levels,tags\f[R]
4862 .RE
4863 .RE
4864 .TP
4865 .B \f[CB]\-Xlog:gc\f[R]
4866 Logs messages tagged with the \f[CB]gc\f[R] tag using \f[CB]info\f[R] level
4867 to \f[CB]stdout\f[R].
4868 The default configuration for all other messages at level
4869 \f[CB]warning\f[R] is in effect.
4870 .RS
4871 .RE
4872 .TP
4873 .B \f[CB]\-Xlog:gc,safepoint\f[R]
4874 Logs messages tagged either with the \f[CB]gc\f[R] or \f[CB]safepoint\f[R]
4875 tags, both using the \f[CB]info\f[R] level, to \f[CB]stdout\f[R], with
4876 default decorations.
4877 Messages tagged with both \f[CB]gc\f[R] and \f[CB]safepoint\f[R] won\[aq]t
4878 be logged.
4879 .RS
4880 .RE
4881 .TP
4882 .B \f[CB]\-Xlog:gc+ref=debug\f[R]
4883 Logs messages tagged with both \f[CB]gc\f[R] and \f[CB]ref\f[R] tags, using
4884 the \f[CB]debug\f[R] level to \f[CB]stdout\f[R], with default decorations.
4885 Messages tagged only with one of the two tags won\[aq]t be logged.
4886 .RS
4887 .RE
4888 .TP
4889 .B \f[CB]\-Xlog:gc=debug:file=gc.txt:none\f[R]
4890 Logs messages tagged with the \f[CB]gc\f[R] tag using the \f[CB]debug\f[R]
4891 level to a file called \f[CB]gc.txt\f[R] with no decorations.
4892 The default configuration for all other messages at level
4893 \f[CB]warning\f[R] is still in effect.
4894 .RS
4895 .RE
4896 .TP
4897 .B \f[CB]\-Xlog:gc=trace:file=gctrace.txt:uptimemillis,pids:filecount=5,filesize=1024\f[R]
4898 Logs messages tagged with the \f[CB]gc\f[R] tag using the \f[CB]trace\f[R]
4899 level to a rotating file set with 5 files with size 1 MB with the base
4900 name \f[CB]gctrace.txt\f[R] and uses decorations \f[CB]uptimemillis\f[R] and
4901 \f[CB]pid\f[R].
4902 .RS
4903 .PP
4904 The default configuration for all other messages at level
4905 \f[CB]warning\f[R] is still in effect.
4906 .RE
4907 .TP
4908 .B \f[CB]\-Xlog:gc::uptime,tid\f[R]
4909 Logs messages tagged with the \f[CB]gc\f[R] tag using the default
4910 \[aq]info\[aq] level to default the output \f[CB]stdout\f[R] and uses
4911 decorations \f[CB]uptime\f[R] and \f[CB]tid\f[R].
4912 The default configuration for all other messages at level
4913 \f[CB]warning\f[R] is still in effect.
4914 .RS
4915 .RE
4916 .TP
4917 .B \f[CB]\-Xlog:gc*=info,safepoint*=off\f[R]
4918 Logs messages tagged with at least \f[CB]gc\f[R] using the \f[CB]info\f[R]
4919 level, but turns off logging of messages tagged with \f[CB]safepoint\f[R].
4920 Messages tagged with both \f[CB]gc\f[R] and \f[CB]safepoint\f[R] won\[aq]t
4921 be logged.
4922 .RS
4923 .RE
4924 .TP
4925 .B \f[CB]\-Xlog:disable\ \-Xlog:safepoint=trace:safepointtrace.txt\f[R]
4926 Turns off all logging, including warnings and errors, and then enables
4927 messages tagged with \f[CB]safepoint\f[R]using \f[CB]trace\f[R]level to the
4928 file \f[CB]safepointtrace.txt\f[R].
4929 The default configuration doesn\[aq]t apply, because the command line
4930 started with \f[CB]\-Xlog:disable\f[R].
4931 .RS
4932 .RE
4933 .SS Complex \-Xlog Usage Examples
4934 .PP
4935 The following describes a few complex examples of using the
4936 \f[CB]\-Xlog\f[R] option.
4937 .TP
4938 .B \f[CB]\-Xlog:gc+class*=debug\f[R]
4939 Logs messages tagged with at least \f[CB]gc\f[R] and \f[CB]class\f[R] tags
4940 using the \f[CB]debug\f[R] level to \f[CB]stdout\f[R].
4941 The default configuration for all other messages at the level
4942 \f[CB]warning\f[R] is still in effect
4943 .RS
4944 .RE
4945 .TP
4946 .B \f[CB]\-Xlog:gc+meta*=trace,class*=off:file=gcmetatrace.txt\f[R]
4947 Logs messages tagged with at least the \f[CB]gc\f[R] and \f[CB]meta\f[R]
4948 tags using the \f[CB]trace\f[R] level to the file \f[CB]metatrace.txt\f[R]
4949 but turns off all messages tagged with \f[CB]class\f[R].
4950 Messages tagged with \f[CB]gc\f[R], \f[CB]meta\f[R], and \f[CB]class\f[R]
4951 aren\[aq]t be logged as \f[CB]class*\f[R] is set to off.
4952 The default configuration for all other messages at level
4953 \f[CB]warning\f[R] is in effect except for those that include
4954 \f[CB]class\f[R].
4955 .RS
4956 .RE
4957 .TP
4958 .B \f[CB]\-Xlog:gc+meta=trace\f[R]
4959 Logs messages tagged with exactly the \f[CB]gc\f[R] and \f[CB]meta\f[R] tags
4960 using the \f[CB]trace\f[R] level to \f[CB]stdout\f[R].
4961 The default configuration for all other messages at level
4962 \f[CB]warning\f[R] is still be in effect.
4963 .RS
4964 .RE
4965 .TP
4966 .B \f[CB]\-Xlog:gc+class+heap*=debug,meta*=warning,threads*=off\f[R]
4967 Logs messages tagged with at least \f[CB]gc\f[R], \f[CB]class\f[R], and
4968 \f[CB]heap\f[R] tags using the \f[CB]trace\f[R] level to \f[CB]stdout\f[R] but
4969 only log messages tagged with \f[CB]meta\f[R] with level.
4970 The default configuration for all other messages at the level
4971 \f[CB]warning\f[R] is in effect except for those that include
4972 \f[CB]threads\f[R].
4973 .RS
4974 .RE
4975 .SH VALIDATE JAVA VIRTUAL MACHINE FLAG ARGUMENTS
4976 .PP
4977 You use values provided to all Java Virtual Machine (JVM) command\-line
4978 flags for validation and, if the input value is invalid or
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
5023 aren\[aq]t displayed in the print out.
5024 For example:
5025 .IP
5026 .nf
5027 \f[CB]
5028 size_t\ NewSize\ \ \ \ \ \ \ \ \ [\ \ \ ...\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ]\ {product}
5029 \f[R]
5030 .fi
5031 .PP
5032 This helps to identify the flags that need to be implemented.
5033 The automatic testing framework can skip those flags that don\[aq]t have
5034 values and aren\[aq]t implemented.
5035 .SH LARGE PAGES
5036 .PP
5037 You use large pages, also known as huge pages, as memory pages that are
5038 significantly larger than the standard memory page size (which varies
5039 depending on the processor and operating system).
5040 Large pages optimize processor Translation\-Lookaside Buffers.
5041 .PP
5042 A Translation\-Lookaside Buffer (TLB) is a page translation cache that
5043 holds the most\-recently used virtual\-to\-physical address
5044 translations.
5045 A TLB is a scarce system resource.
5046 A TLB miss can be costly because the processor must then read from the
5047 hierarchical page table, which may require multiple memory accesses.
5048 By using a larger memory page size, a single TLB entry can represent a
5049 larger memory range.
5050 This results in less pressure on a TLB, and memory\-intensive
5051 applications may have better performance.
5052 .PP
5053 However, large pages page memory can negatively affect system
5054 performance.
5055 For example, when a large mount of memory is pinned by an application,
5056 it may create a shortage of regular memory and cause excessive paging in
5057 other applications and slow down the entire system.
5058 Also, a system that has been up for a long time could produce excessive
5059 fragmentation, which could make it impossible to reserve enough large
5060 page memory.
5061 When this happens, either the OS or JVM reverts to using regular pages.
5062 .PP
5063 Oracle Solaris, Linux, and Windows support large pages.
5064 .SS Large Pages Support for Oracle Solaris
5065 .PP
5066 Oracle Solaris includes Multiple Page Size Support (MPSS).
5067 No additional configuration is necessary.
5068 .SS Large Pages Support for Linux
5069 .PP
5070 The 2.6 kernel supports large pages.
5071 Some vendors have backported the code to their 2.4\-based releases.
5072 To check if your system can support large page memory, try the
5073 following:
5074 .IP
5075 .nf
5076 \f[CB]
5077 #\ cat\ /proc/meminfo\ |\ grep\ Huge
5078 HugePages_Total:\ 0
5079 HugePages_Free:\ 0
5080 Hugepagesize:\ 2048\ kB
5081 \f[R]
5082 .fi
5083 .PP
5084 If the output shows the three "Huge" variables, then your system can
5085 support large page memory but it needs to be configured.
5086 If the command prints nothing, then your system doesn\[aq]t support
5087 large pages.
5088 To configure the system to use large page memory, login as
5089 \f[CB]root\f[R], and then follow these steps:
5090 .IP "1." 3
5091 If you\[aq]re using the option \f[CB]\-XX:+UseSHM\f[R] (instead of
5092 \f[CB]\-XX:+UseHugeTLBFS\f[R]), then increase the \f[CB]SHMMAX\f[R] value.
5093 It must be larger than the Java heap size.
5094 On a system with 4 GB of physical RAM (or less), the following makes all
5095 the memory sharable:
5096 .RS 4
5097 .RS
5098 .PP
5099 \f[CB]#\ echo\ 4294967295\ >\ /proc/sys/kernel/shmmax\f[R]
5100 .RE
5101 .RE
5102 .IP "2." 3
5103 If you\[aq]re using the option \f[CB]\-XX:+UseSHM\f[R] or
5104 \f[CB]\-XX:+UseHugeTLBFS\f[R], then specify the number of large pages.
5105 In the following example, 3 GB of a 4 GB system are reserved for large
5106 pages (assuming a large page size of 2048kB, then 3 GB = 3 * 1024 MB =
5107 3072 MB = 3072 * 1024 kB = 3145728 kB and 3145728 kB / 2048 kB = 1536):
5108 .RS 4
5109 .RS
5110 .PP
5111 \f[CB]#\ echo\ 1536\ >\ /proc/sys/vm/nr_hugepages\f[R]
5112 .RE
5113 .RS
5114 .PP
5115 \f[B]Note:\f[R] The values contained in \f[CB]/proc\f[R] resets after you
5116 reboot your system, so may want to set them in an initialization script
5117 (for example, \f[CB]rc.local\f[R] or \f[CB]sysctl.conf\f[R]).
5118 .RE
5119 .RE
5120 .IP \[bu] 2
5121 If you configure (or resize) the OS kernel parameters
5122 \f[CB]/proc/sys/kernel/shmmax\f[R] or \f[CB]/proc/sys/vm/nr_hugepages\f[R],
5123 Java processes may allocate large pages for areas in addition to the
5124 Java heap.
5125 These steps can allocate large pages for the following areas:
5126 .RS 2
5127 .IP \[bu] 2
5128 Java heap
5129 .IP \[bu] 2
5130 Code cache
5131 .IP \[bu] 2
5132 The marking bitmap data structure for the parallel GC
5133 .PP
5134 Consequently, if you configure the \f[CB]nr_hugepages\f[R] parameter to
5135 the size of the Java heap, then the JVM can fail in allocating the code
5136 cache areas on large pages because these areas are quite large in size.
5137 .RE
5138 .SS Large Pages Support for Windows
5139 .PP
5140 To use large pages support on Windows, the administrator must first
5141 assign additional privileges to the user who is running the application:
5142 .IP "1." 3
5143 Select \f[B]Control Panel\f[R], \f[B]Administrative Tools\f[R], and then
5144 \f[B]Local Security Policy\f[R].
5145 .IP "2." 3
5146 Select \f[B]Local Policies\f[R] and then \f[B]User Rights Assignment\f[R].
5147 .IP "3." 3
5148 Double\-click \f[B]Lock pages in memory\f[R], then add users and/or
5149 groups.
5150 .IP "4." 3
5151 Reboot your system.
5152 .PP
5153 Note that these steps are required even if it\[aq]s the administrator
5154 who\[aq]s running the application, because administrators by default
5155 don\[aq]t have the privilege to lock pages in memory.
5156 .SH APPLICATION CLASS DATA SHARING
5157 .PP
5158 Application Class Data Sharing (AppCDS) extends class data sharing (CDS)
5159 to enable application classes to be placed in a shared archive.
5160 .PP
5161 In addition to the core library classes, AppCDS supports \f[B]Class Data
5162 Sharing\f[R]
5163 [https://docs.oracle.com/en/java/javase/12/vm/class\-data\-sharing.html#GUID\-7EAA3411\-8CF0\-4D19\-BD05\-DF5E1780AA91]
5164 from the following locations:
5165 .IP \[bu] 2
5166 Platform classes from the runtime image
5167 .IP \[bu] 2
5168 Application classes from the runtime image
5169 .IP \[bu] 2
5170 Application classes from the class path
5171 .IP \[bu] 2
5172 Application classes from the module path
5173 .PP
5174 Archiving application classes provides better start up time at runtime.
5175 When running multiple JVM processes, AppCDS also reduces the runtime
5176 footprint with memory sharing for read\-only metadata.
5177 .PP
5178 CDS/AppCDS supports archiving classes from JAR files only.
5179 .PP
5180 Prior to JDK 11, a non\-empty directory was reported as a fatal error in
5181 the following conditions:
5182 .IP \[bu] 2
5183 For base CDS, a non\-empty directory cannot exist in the
5184 \f[CB]\-Xbootclasspath/a\f[R] path
5185 .IP \[bu] 2
5186 With \f[CB]\-XX:+UseAppCDS\f[R], a non\-empty directory could not exist in
5187 the \f[CB]\-Xbootclasspath/a\f[R] path, class path, and module path.
5188 .PP
5189 In JDK 11 and later, \f[CB]\-XX:+UseAppCDS\f[R] is obsolete and the
5190 behavior for a non\-empty directory is based on the class types in the
5191 classlist.
5192 A non\-empty directory is reported as a fatal error in the following
5193 conditions:
5194 .IP \[bu] 2
5195 If application classes or platform classes are not loaded, dump time
5196 only reports an error if a non\-empty directory exists in
5197 \f[CB]\-Xbootclasspath/a\f[R] path
5198 .IP \[bu] 2
5199 If application classes or platform classes are loaded, dump time reports
5200 an error for a non\-empty directory that exists in
5201 \f[CB]\-Xbootclasspath/a\f[R] path, class path, or module path
5202 .PP
5203 In JDK 11 and later, using
5204 \f[CB]\-XX:DumpLoadedClassList=\f[R]\f[I]class_list_file\f[R] results a
5205 generated classlist with all classes (both system library classes and
5206 application classes) included.
5207 You no longer have to specify \f[CB]\-XX:+UseAppCDS\f[R] with
5208 \f[CB]\-XX:DumpLoadedClassList\f[R] to produce a complete class list.
5209 .PP
5210 In JDK 11 and later, because \f[CB]UseAppCDS\f[R] is obsolete,
5211 \f[CB]SharedArchiveFile\f[R] becomes a product flag by default.
5212 Specifying \f[CB]+UnlockDiagnosticVMOptions\f[R] for
5213 \f[CB]SharedArchiveFile\f[R] is no longer needed in any configuration.
5214 .PP
5215 Class Data Sharing (CDS)/AppCDS does not support archiving array classes
5216 in a class list.
5217 When an array in the class list is encountered, CDS dump time gives the
5218 explicit error message:
5219 .RS
5220 .PP
5221 \f[CB]Preload\ Warning:\ Cannot\ find\f[R] \f[I]array_name\f[R]
5222 .RE
5223 .PP
5224 Although an array in the class list is not allowed, some array classes
5225 can still be created at CDS/AppCDS dump time.
5226 Those arrays are created during the execution of the Java code used by
5227 the Java class loaders (\f[CB]PlatformClassLoader\f[R] and the system
5228 class loader) to load classes at dump time.
5229 The created arrays are archived with the rest of the loaded classes.
5230 .SS Extending Class Data Sharing to Support the Module Path
5231 .PP
5232 In JDK 11, Class Data Sharing (CDS) has been improved to support
5233 archiving classes from the module path.
5234 .IP \[bu] 2
5235 To create a CDS archive using the \f[CB]\-\-module\-path\f[R] VM option,
5236 use the following command line syntax:
5237 .RS 2
5238 .RS
5239 .PP
5240 \f[CB]java\ \-Xshare:dump\ \-XX:SharedClassListFile=\f[R]\f[I]class_list_file\f[R]
5241 \f[CB]\-XX:SharedArchiveFile=\f[R]\f[I]shared_archive_file\f[R]
5242 \f[CB]\-\-module\-path=\f[R]\f[I]path_to_modular_jar\f[R] \f[CB]\-m\f[R]
5243 \f[I]module_name\f[R]
5244 .RE
5245 .RE
5246 .IP \[bu] 2
5247 To run with a CDS archive using the \f[CB]\-\-module\-path\f[R] VM option,
5248 use the following the command line syntax:
5249 .RS 2
5250 .RS
5251 .PP
5252 \f[CB]java\ \-XX:SharedArchiveFile=\f[R]\f[I]shared_archive_file\f[R]
5253 \f[CB]\-\-module\-path=\f[R]\f[I]path_to_modular_jar\f[R] \f[CB]\-m\f[R]
5254 \f[I]module_name\f[R]
5255 .RE
5256 .RE
5257 .PP
5258 The following table describes how the VM options related to module paths
5259 can be used along with the \f[CB]\-Xshare\f[R] option.
5260 .PP
5261 .TS
5262 tab(@);
5263 l l l.
5264 T{
5265 Option
5266 T}@T{
5267 \-Xshare:dump
5268 T}@T{
5269 \-Xshare:{on,auto}
5270 T}
5271 _
5272 T{
5273 \f[CB]\-\-module\-path\f[R][1] \f[I]mp\f[R]
5274 T}@T{
5275 Allowed
5276 T}@T{
5277 Allowed[2]
5278 T}
5279 T{
5280 \f[CB]\-\-module\f[R]
5281 T}@T{
5282 Allowed
5283 T}@T{
5284 Allowed
5285 T}
5286 T{
5287 \f[CB]\-\-add\-module\f[R]
5288 T}@T{
5289 Allowed
5290 T}@T{
5291 Allowed
5292 T}
5293 T{
5294 \f[CB]\-\-upgrade\-module\-path\f[R][3]
5295 T}@T{
5296 Disallowed (exits if specified)
5297 T}@T{
5298 Allowed (disables CDS)
5299 T}
5300 T{
5301 \f[CB]\-\-patch\-module\f[R][4]
5302 T}@T{
5303 Disallowed (exits if specified)
5304 T}@T{
5305 Allowed (disables CDS)
5306 T}
5307 T{
5308 \f[CB]\-\-limit\-modules\f[R][5]
5309 T}@T{
5310 Disallowed (exits if specified)
5311 T}@T{
5312 Allowed (disables CDS)
5313 T}
5314 .TE
5315 .PP
5316 [1] Although there are two ways of specifying a module in a
5317 \f[CB]\-\-module\-path\f[R], that is, modular JAR or exploded module, only
5318 modular JARs are supported.
5319 .PP
5320 [2] Different \f[I]mp\f[R] can be specified during dump time versus run
5321 time.
5322 If an archived class K was loaded from \f[CB]mp1.jar\f[R] at dump time,
5323 but changes in \f[I]mp\f[R] cause it to be available from a different
5324 \f[CB]mp2.jar\f[R] at run time, then the archived version of K will be
5325 disregarded at run time; K will be loaded dynamically.
5326 .PP
5327 [3] Currently, only two system modules are upgradeable
5328 (\f[CB]java.compiler\f[R] and \f[CB]jdk.internal.vm.compiler\f[R]).
5329 However, these modules are seldom upgraded in production software.
5330 .PP
5331 [4] As documented in JEP 261, using \f[CB]\-\-patch\-module\f[R] is
5332 strongly discouraged for production use.
5333 .PP
5334 [5] \f[CB]\-\-limit\-modules\f[R] is intended for testing purposes.
5335 It is seldom used in production software.
5336 .PP
5337 If \f[CB]\-\-upgrade\-module\-path\f[R], \f[CB]\-\-patch\-module\f[R], or
5338 \f[CB]\-\-limit\-modules\f[R] is specified at dump time, an error will be
5339 printed and the JVM will exit.
5340 For example, if the \f[CB]\-\-limit\-modules\f[R] option is specified at
5341 dump time, the user will see the following error:
5342 .IP
5343 .nf
5344 \f[CB]
5345 Error\ occurred\ during\ initialization\ of\ VM
5346 Cannot\ use\ the\ following\ option\ when\ dumping\ the\ shared\ archive:\ \-\-limit\-modules
5347 \f[R]
5348 .fi
5349 .PP
5350 If \f[CB]\-\-upgrade\-module\-path\f[R], \f[CB]\-\-patch\-module\f[R], or
5351 \f[CB]\-\-limit\-modules\f[R] is specified at run time, a warning message
5352 will be printed indicating that CDS is disabled.
5353 For example, if the \f[CB]\-\-limit\-modules\f[R] options is specified at
5354 run time, the user will see the following warning:
5355 .IP
5356 .nf
5357 \f[CB]
5358 Java\ HotSpot(TM)\ 64\-Bit\ Server\ VM\ warning:\ CDS\ is\ disabled\ when\ the\ \-\-limit\-modules\ option\ is\ specified.
5359 \f[R]
5360 .fi
5361 .PP
5362 Several other noteworthy things include:
5363 .IP \[bu] 2
5364 Any valid combinations of \f[CB]\-cp\f[R] and \f[CB]\-\-module\-path\f[R]
5365 are supported.
5366 .IP \[bu] 2
5367 A non\-empty directory in the module path causes a fatal error.
5368 The user will see the following error messages:
5369 .RS 2
5370 .IP
5371 .nf
5372 \f[CB]
5373 Error:\ non\-empty\ directory\ <directory>\ Hint:\ enable\ \-Xlog:class+path=info\ to\ diagnose\ the\ failure\ Error\ occurred\ during\ initialization\ of\ VM\ Cannot\ have\ non\-empty\ directory\ in\ paths
5374 \f[R]
5375 .fi
5376 .RE
5377 .IP \[bu] 2
5378 Unlike the class path, there\[aq]s no restriction that the module path
5379 at dump time must be equal to or be a prefix of the module path at run
5380 time.
5381 .IP \[bu] 2
5382 The archive is invalidated if an existing JAR in the module path is
5383 updated after archive generation.
5384 .IP \[bu] 2
5385 Removing a JAR from the module path does not invalidate the shared
5386 archive.
5387 Archived classes from the removed JAR are not used at runtime.
5388 .SS Dynamic CDS archive
5389 .PP
5390 Dynamic CDS archive extends AppCDS to allow archiving of classes when a
5391 Java application exits.
5392 It improves the usability of AppCDS by eliminating the trial run step
5393 for creating a class list for each application.
5394 The archived classes include all loaded application classes and library
5395 classes that are not present in the default CDS archive which is
5396 included in the JDK.
5397 .PP
5398 A base archive is required when creating a dynamic archive.
5399 If the base archive is not specified, the default CDS archive is used as
5400 the base archive.
5401 .PP
5402 To create a dynamic CDS archive with the default CDS archive as the base
5403 archive, just add the
5404 \f[CB]\-XX:ArchiveClassesAtExit=<dynamic\ archive>\f[R] option to the
5405 command line for running the Java application.
5406 .PP
5407 If the default CDS archive does not exist, the VM will exit with the
5408 following error:
5409 .IP
5410 .nf
5411 \f[CB]
5412 ArchiveClassesAtExit\ not\ supported\ when\ base\ CDS\ archive\ is\ not\ loaded
5413 \f[R]
5414 .fi
5415 .PP
5416 To run the Java application using a dynamic CDS archive, just add the
5417 \f[CB]\-XX:SharedArchiveFile=<dynamic\ archive>\f[R] option to the command
5418 line for running the Java application.
5419 .PP
5420 The base archive is not required to be specified in the command line.
5421 The base archive information, including its name and full path, will be
5422 retrieved from the dynamic archive header.
5423 Note that the user could also use the \f[CB]\-XX:SharedArchiveFile\f[R]
5424 option for specifying a regular AppCDS archive.
5425 Therefore, the specified archive in the \f[CB]\-XX:SharedArchiveFile\f[R]
5426 option could be either a regular or dynamic archive.
5427 During VM start up the specified archive header will be read.
5428 If \f[CB]\-XX:SharedArchiveFile\f[R] refers to a regular archive, then the
5429 behavior will be unchanged.
5430 If \f[CB]\-XX:SharedArchiveFile\f[R] refers to a dynamic archive, the VM
5431 will retrieve the base archive location from the dynamic archive.
5432 If the dynamic archive was created with the default CDS archive, then
5433 the current default CDS archive will be used, and will be found relative
5434 to the current run time environment.
5435 .PP
5436 Please refer to \f[B]JDK\-8221706\f[R]
5437 [https://bugs.openjdk.java.net/browse/JDK\-8221706] for details on error
5438 checking during dynamic CDS archive dump time and run time.
5439 .SS Creating a Shared Archive File and Using It to Run an Application
5440 .SS AppCDS archive
5441 .PP
5442 The following steps create a shared archive file that contains all the
5443 classes used by the \f[CB]test.Hello\f[R] application.
5444 The last step runs the application with the shared archive file.
5445 .IP "1." 3
5446 Create a list of all classes used by the \f[CB]test.Hello\f[R]
5447 application.
5448 The following command creates a file named \f[CB]hello.classlist\f[R] that
5449 contains a list of all classes used by this application:
5450 .RS 4
5451 .RS
5452 .PP
5453 \f[CB]java\ \-Xshare:off\ \-XX:DumpLoadedClassList=hello.classlist\ \-cp\ hello.jar\ test.Hello\f[R]
5454 .RE
5455 .PP
5456 Note that the classpath specified by the \f[CB]\-cp\f[R] parameter must
5457 contain only JAR files.
5458 .RE
5459 .IP "2." 3
5460 Create a shared archive, named \f[CB]hello.jsa\f[R], that contains all the
5461 classes in \f[CB]hello.classlist\f[R]:
5462 .RS 4
5463 .RS
5464 .PP
5465 \f[CB]java\ \-Xshare:dump\ \-XX:SharedArchiveFile=hello.jsa\ \-XX:SharedClassListFile=hello.classlist\ \-cp\ hello.jar\f[R]
5466 .RE
5467 .PP
5468 Note that the classpath used at archive creation time must be the same
5469 as (or a prefix of) the classpath used at run time.
5470 .RE
5471 .IP "3." 3
5472 Run the application \f[CB]test.Hello\f[R] with the shared archive
5473 \f[CB]hello.jsa\f[R]:
5474 .RS 4
5475 .RS
5476 .PP
5477 \f[CB]java\ \-XX:SharedArchiveFile=hello.jsa\ \-cp\ hello.jar\ test.Hello\f[R]
5478 .RE
5479 .RE
5480 .IP "4." 3
5481 \f[B]Optional\f[R] Verify that the \f[CB]test.Hello\f[R] application is
5482 using the class contained in the \f[CB]hello.jsa\f[R] shared archive:
5483 .RS 4
5484 .RS
5485 .PP
5486 \f[CB]java\ \-XX:SharedArchiveFile=hello.jsa\ \-cp\ hello.jar\ \-verbose:class\ test.Hello\f[R]
5487 .RE
5488 .PP
5489 The output of this command should contain the following text:
5490 .IP
5491 .nf
5492 \f[CB]
5493 Loaded\ test.Hello\ from\ shared\ objects\ file\ by\ sun/misc/Launcher$AppClassLoader
5494 \f[R]
5495 .fi
5496 .RE
5497 .SS Dynamic CDS archive
5498 .PP
5499 The following steps create a dynamic CDS archive file that contains the
5500 classes used by the \f[CB]test.Hello\f[R] application and are not included
5501 in the default CDS archive.
5502 The second step runs the application with the dynamic CDS archive.
5503 .IP "1." 3
5504 Create a dynamic CDS archive, named \f[CB]hello.jsa\f[R], that contains
5505 all the classes in \f[CB]hello.jar\f[R] loaded by the application
5506 \f[CB]test.Hello\f[R]:
5507 .RS 4
5508 .RS
5509 .PP
5510 \f[CB]java\ \-XX:ArchiveClassesAtExit=hello.jsa\ \-cp\ hello.jar\ Hello\f[R]
5511 .RE
5512 .PP
5513 Note that the classpath used at archive creation time must be the same
5514 as (or a prefix of) the classpath used at run time.
5515 .RE
5516 .IP "2." 3
5517 Run the application \f[CB]test.Hello\f[R] with the shared archive
5518 \f[CB]hello.jsa\f[R]:
5519 .RS 4
5520 .RS
5521 .PP
5522 \f[CB]java\ \-XX:SharedArchiveFile=hello.jsa\ \-cp\ hello.jar\ test.Hello\f[R]
5523 .RE
5524 .RE
5525 .IP "3." 3
5526 \f[B]Optional\f[R] Repeat step 4 of the previous section to verify that
5527 the \f[CB]test.Hello\f[R] application is using the class contained in the
5528 \f[CB]hello.jsa\f[R] shared archive.
5529 .PP
5530 To automate the above steps 1 and 2, one can write a script such as the
5531 following:
5532 .IP
5533 .nf
5534 \f[CB]
5535 \ \ \ \ ARCHIVE=hello.jsa
5536 \ \ \ \ if\ test\ \-f\ $ARCHIVE;\ then
5537 \ \ \ \ \ \ \ \ FLAG="\-XX:SharedArchiveFile=$ARCHIVE"
5538 \ \ \ \ else
5539 \ \ \ \ \ \ \ \ FLAG="\-XX:ArchiveClassesAtExit=$ARCHIVE"
5540 \ \ \ \ fi
5541 \ \ \ \ $JAVA_HOME/bin/java\ \-cp\ hello.jar\ $FLAG\ test.Hello
5542 \f[R]
5543 .fi
5544 .PP
5545 Like an AppCDS archive, the archive needs to be re\-generated if the
5546 Java version has changed.
5547 The above script could be adjusted to account for the Java version as
5548 follows:
5549 .IP
5550 .nf
5551 \f[CB]
5552 \ \ \ \ ARCHIVE=hello.jsa
5553 \ \ \ \ VERSION=foo.version
5554 \ \ \ \ if\ test\ \-f\ $ARCHIVE\ \-a\ \-f\ $VERSION\ &&\ cmp\ \-s\ $VERSION\ $JAVA_HOME/release;\ then
5555 \ \ \ \ \ \ \ \ FLAG="\-XX:SharedArchiveFile=$ARCHIVE"
5556 \ \ \ \ else
5557 \ \ \ \ \ \ \ \ FLAG="\-XX:ArchiveClassesAtExit=$ARCHIVE"
5558 \ \ \ \ \ \ \ \ cp\ \-f\ $JAVA_HOME/release\ $VERSION
5559 \ \ \ \ fi
5560 \ \ \ \ $JAVA_HOME/bin/java\ \-cp\ hello.jar\ $FLAG\ test.Hello
5561 \f[R]
5562 .fi
5563 .PP
5564 Currently, we don\[aq]t support concurrent dumping operations to the
5565 same CDS archive.
5566 Care should be taken to avoid multiple writers to the same CDS archive.
5567 .PP
5568 The user could also create a dynamic CDS archive with a specific base
5569 archive, e.g.
5570 named as \f[CB]base.jsa\f[R] as follows:
5571 .RS
5572 .PP
5573 \f[CB]java\ \-XX:SharedArchiveFile=base.jsa\ \-XX:ArchiveClassesAtExit=hello.jsa\ \-cp\ hello.jar\ Hello\f[R]
5574 .RE
5575 .PP
5576 To run the application using the dynamic CDS archive \f[CB]hello.jsa\f[R]
5577 and a specific base CDS archive \f[CB]base.jsa\f[R]:
5578 .RS
5579 .PP
5580 \f[CB]java\ \-XX:SharedArchiveFile=base.jsa:hello.jsa\ \-cp\ hello.jar\ Hello\f[R]
5581 .RE
5582 .PP
5583 Note that on Windows, the above path delimiter \f[CB]:\f[R] should be
5584 replaced with \f[CB];\f[R].
5585 .PP
5586 The above command for specifying a base archive is useful if the base
5587 archive used for creating the dynamic archive has been moved.
5588 Normally, just specifying the dynamic archive should be sufficient since
5589 the base archive info can be retrieved from the dynamic archive header.
5590 .SS Sharing a Shared Archive Across Multiple Application Processes
5591 .PP
5592 You can share the same archive file across multiple applications
5593 processes.
5594 This reduces memory usage because the archive is memory\-mapped into the
5595 address space of the processes.
5596 The operating system automatically shares the read\-only pages across
5597 these processes.
5598 .PP
5599 The following steps demonstrate how to create a common archive that can
5600 be shared by different applications.
5601 Classes from \f[CB]common.jar\f[R], \f[CB]hello.jar\f[R] and \f[CB]hi.jar\f[R]
5602 are archived in the \f[CB]common.jsa\f[R] because they are all in the
5603 classpath during the archiving step (step 3).
5604 .PP
5605 To include classes from \f[CB]hello.jar\f[R] and \f[CB]hi.jar\f[R], the
5606 \f[CB]\&.jar\f[R] files must be added to the classpath specified by the
5607 \f[CB]\-cp\f[R] parameter.
5608 .IP "1." 3
5609 Create a list of all classes used by the \f[CB]Hello\f[R] application and
5610 another list for the \f[CB]Hi\f[R] application:
5611 .RS 4
5612 .RS
5613 .PP
5614 \f[CB]java\ \-XX:DumpLoadedClassList=hello.classlist\ \-cp\ common.jar:hello.jar\ Hello\f[R]
5615 .RE
5616 .RS
5617 .PP
5618 \f[CB]java\ \-XX:DumpLoadedClassList=hi.classlist\ \-cp\ common.jar:hi.jar\ Hi\f[R]
5619 .RE
5620 .RE
5621 .IP "2." 3
5622 Create a single list of classes used by all the applications that will
5623 share the shared archive file.
5624 .RS 4
5625 .PP
5626 \f[B]Oracle Solaris, Linux, and macOS\f[R] The following commands combine
5627 the files \f[CB]hello.classlist\f[R] and \f[CB]hi.classlist\f[R] into one
5628 file, \f[CB]common.classlist\f[R]:
5629 .RS
5630 .PP
5631 \f[CB]cat\ hello.classlist\ hi.classlist\ >\ common.classlist\f[R]
5632 .RE
5633 .PP
5634 \f[B]Windows\f[R] The following commands combine the files
5635 \f[CB]hello.classlist\f[R] and \f[CB]hi.classlist\f[R] into one file,
5636 \f[CB]common.classlist\f[R]:
5637 .RS
5638 .PP
5639 \f[CB]type\ hello.classlist\ hi.classlist\ >\ common.classlist\f[R]
5640 .RE
5641 .RE
5642 .IP "3." 3
5643 Create a shared archive named \f[CB]common.jsa\f[R] that contains all the
5644 classes in \f[CB]common.classlist\f[R]:
5645 .RS 4
5646 .RS
5647 .PP
5648 \f[CB]java\ \-Xshare:dump\ \-XX:SharedArchiveFile=common.jsa\ \-XX:SharedClassListFile=common.classlist\ \-cp\ common.jar:hello.jar:hi.jar\f[R]
5649 .RE
5650 .PP
5651 The classpath parameter used is the common class path prefix shared by
5652 the \f[CB]Hello\f[R] and \f[CB]Hi\f[R] applications.
5653 .RE
5654 .IP "4." 3
5655 Run the \f[CB]Hello\f[R] and \f[CB]Hi\f[R] applications with the same shared
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]
5724 .fi
5725 .PP
5726 In the configuration file example, the \f[CB]\@SECTION:\ Symbol\f[R] entry
5727 uses the following format:
5728 .RS
5729 .PP
5730 \f[I]length\f[R] \f[I]refcount\f[R]\f[CB]:\f[R] \f[I]symbol\f[R]
5731 .RE
5732 .PP
5733 The \f[I]refcount\f[R] for a shared symbol is always \f[CB]\-1\f[R].
5734 .PP
5735 \f[CB]\@SECTION\f[R] specifies the type of the section that follows it.
5736 All data within the section must be the same type that\[aq]s specified
5737 by \f[CB]\@SECTION\f[R].
5738 Different types of data can\[aq]t be mixed.
5739 Multiple separated data sections for the same type specified by
5740 different \f[CB]\@SECTION\f[R] are allowed within one
5741 \f[CB]shared_config_file\f[R] .
5742 .SH PERFORMANCE TUNING EXAMPLES
5743 .PP
5744 You can use the Java advanced runtime options to optimize the
5745 performance of your applications.
5746 .SS Tuning for Higher Throughput
5747 .PP
5748 Use the following commands and advanced options to achieve higher
5749 throughput performance for your application:
5750 .RS
5751 .PP
5752 \f[CB]java\ \-server\ \-XX:+UseParallelGC\ \-XX:+UseLargePages\ \-Xmn10g\ \ \-Xms26g\ \-Xmx26g\f[R]
5753 .RE
5754 .SS Tuning for Lower Response Time
5755 .PP
5756 Use the following commands and advanced options to achieve lower
5757 response times for your application:
5758 .RS
5759 .PP
5760 \f[CB]java\ \-XX:+UseG1GC\ \-XX:MaxGCPauseMillis=100\f[R]
5761 .RE
5762 .SS Keeping the Java Heap Small and Reducing the Dynamic Footprint of
5763 Embedded Applications
5764 .PP
5765 Use the following advanced runtime options to keep the Java heap small
5766 and reduce the dynamic footprint of embedded applications:
5767 .RS
5768 .PP
5769 \f[CB]\-XX:MaxHeapFreeRatio=10\ \-XX:MinHeapFreeRatio=5\f[R]
5770 .RE
5771 .RS
5772 .PP
5773 \f[B]Note:\f[R] The defaults for these two options are 70% and 40%
5774 respectively.
5775 Because performance sacrifices can occur when using these small
5776 settings, you should optimize for a small footprint by reducing these
5777 settings as much as possible without introducing unacceptable
5778 performance degradation.
5779 .RE
5780 .SH EXIT STATUS
5781 .PP
5782 The following exit values are typically returned by the launcher when
5783 the launcher is called with the wrong arguments, serious errors, or
5784 exceptions thrown by the JVM.
5785 However, a Java application may choose to return any value by using the
5786 API call \f[CB]System.exit(exitValue)\f[R].
5787 The values are:
5788 .IP \[bu] 2
5789 \f[CB]0\f[R]: Successful completion
5790 .IP \[bu] 2
5791 \f[CB]>0\f[R]: An error occurred