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" "2019" "JDK 13" "JDK Commands"
  26 .hy
  27 .SH NAME
  28 .PP
  29 java \- launch a Java application
  30 .SH SYNOPSIS
  31 .PP
  32 To launch a class file:
  33 .PP
  34 \f[CB]java\f[R] [\f[I]options\f[R]] \f[I]mainclass\f[R] [\f[I]args\f[R] ...]
  35 .PP
  36 To launch the main class in a JAR file:
  37 .PP
  38 \f[CB]java\f[R] [\f[I]options\f[R]] \f[CB]\-jar\f[R] \f[I]jarfile\f[R]
  39 [\f[I]args\f[R] ...]
  40 .PP
  41 To launch the main class in a module:
  42 .PP
  43 \f[CB]java\f[R] [\f[I]options\f[R]] \f[CB]\-m\f[R]
  44 \f[I]module\f[R][\f[CB]/\f[R]\f[I]mainclass\f[R]] [\f[I]args\f[R] ...]
  45 .PP
  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 Runtime Environment (JRE), 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], and
 185 \f[CB]13\f[R].
 186 .RE
 187 .PP
 188 If the file does not have the \f[CB]\&.java\f[R] extension, the
 189 \f[CB]\-\-source\f[R] option must be used to tell the \f[CB]java\f[R]
 190 command to use the source\-file mode.
 191 The \f[CB]\-\-source\f[R] option is used for cases when the source file is
 192 a "script" to be executed and the name of the source file does not
 193 follow the normal naming conventions for Java source files.
 194 .PP
 195 In source\-file mode, the effect is as though the source file is
 196 compiled into memory, and the first class found in the source file is
 197 executed.
 198 Any arguments placed after the name of the source file in the original
 199 command line are passed to the compiled class when it is executed.
 200 .PP
 201 For example, if a file were named \f[CB]HelloWorld.java\f[R] and contained
 202 a class named \f[CB]hello.World\f[R], then the source\-file mode command
 203 to launch the class would be:
 204 .RS
 205 .PP
 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]\\[*packagename*\\]...|\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]\\[*packagename*\\]...|\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 .RS
 663 .RE
 664 .TP
 665 .B \f[CB]\-\-show\-version\f[R]
 666 Prints the product version to the output stream and continues.
 667 .RS
 668 .RE
 669 .TP
 670 .B \f[CB]\-showversion\f[R]
 671 Prints the product version to the error stream and continues.
 672 .RS
 673 .RE
 674 .TP
 675 .B \f[CB]\-\-show\-module\-resolution\f[R]
 676 Shows module resolution output during startup.
 677 .RS
 678 .RE
 679 .TP
 680 .B \f[CB]\-splash:\f[R]\f[I]imagepath\f[R]
 681 Shows the splash screen with the image specified by \f[I]imagepath\f[R].
 682 HiDPI scaled images are automatically supported and used if available.
 683 The unscaled image file name, such as \f[CB]image.ext\f[R], should always
 684 be passed as the argument to the \f[CB]\-splash\f[R] option.
 685 The most appropriate scaled image provided is picked up automatically.
 686 .RS
 687 .PP
 688 For example, to show the \f[CB]splash.gif\f[R] file from the
 689 \f[CB]images\f[R] directory when starting your application, use the
 690 following option:
 691 .RS
 692 .PP
 693 \f[CB]\-splash:images/splash.gif\f[R]
 694 .RE
 695 .PP
 696 See the SplashScreen API documentation for more information.
 697 .RE
 698 .TP
 699 .B \f[CB]\-verbose:class\f[R]
 700 Displays information about each loaded class.
 701 .RS
 702 .RE
 703 .TP
 704 .B \f[CB]\-verbose:gc\f[R]
 705 Displays information about each garbage collection (GC) event.
 706 .RS
 707 .RE
 708 .TP
 709 .B \f[CB]\-verbose:jni\f[R]
 710 Displays information about the use of native methods and other Java
 711 Native Interface (JNI) activity.
 712 .RS
 713 .RE
 714 .TP
 715 .B \f[CB]\-verbose:module\f[R]
 716 Displays information about the modules in use.
 717 .RS
 718 .RE
 719 .TP
 720 .B \f[CB]\-\-version\f[R]
 721 Prints product version to the error stream and exits.
 722 .RS
 723 .RE
 724 .TP
 725 .B \f[CB]\-version\f[R]
 726 Prints product version to the output stream and exits.
 727 .RS
 728 .RE
 729 .TP
 730 .B \f[CB]\-X\f[R]
 731 Prints the help on extra options to the error stream.
 732 .RS
 733 .RE
 734 .TP
 735 .B \f[CB]\-\-help\-extra\f[R]
 736 Prints the help on extra options to the output stream.
 737 .RS
 738 .RE
 739 .TP
 740 .B \f[CB]\@\f[R]\f[I]argfile\f[R]
 741 Specifies one or more argument files prefixed by \f[CB]\@\f[R] used by the
 742 \f[CB]java\f[R] command.
 743 It isn\[aq]t uncommon for the \f[CB]java\f[R] command line to be very long
 744 because of the \f[CB]\&.jar\f[R] files needed in the classpath.
 745 The \f[CB]\@\f[R]\f[I]argfile\f[R] option overcomes command\-line length
 746 limitations by enabling the launcher to expand the contents of argument
 747 files after shell expansion, but before argument processing.
 748 Contents in the argument files are expanded because otherwise, they
 749 would be specified on the command line until the
 750 \f[CB]\-Xdisable\-\@files\f[R] option was encountered.
 751 .RS
 752 .PP
 753 The argument files can also contain the main class name and all options.
 754 If an argument file contains all of the options required by the
 755 \f[CB]java\f[R] command, then the command line could simply be:
 756 .RS
 757 .PP
 758 \f[CB]java\ \@\f[R]\f[I]argfile\f[R]
 759 .RE
 760 .PP
 761 See \f[B]java Command\-Line Argument Files\f[R] for a description and
 762 examples of using \f[CB]\@\f[R]\-argfiles.
 763 .RE
 764 .SH EXTRA OPTIONS FOR JAVA
 765 .PP
 766 The following \f[CB]java\f[R] options are general purpose options that are
 767 specific to the Java HotSpot Virtual Machine.
 768 .TP
 769 .B \f[CB]\-Xbatch\f[R]
 770 Disables background compilation.
 771 By default, the JVM compiles the method as a background task, running
 772 the method in interpreter mode until the background compilation is
 773 finished.
 774 The \f[CB]\-Xbatch\f[R] flag disables background compilation so that
 775 compilation of all methods proceeds as a foreground task until
 776 completed.
 777 This option is equivalent to \f[CB]\-XX:\-BackgroundCompilation\f[R].
 778 .RS
 779 .RE
 780 .TP
 781 .B \f[CB]\-Xbootclasspath/a:\f[R]\f[I]directories\f[R]|\f[I]zip\f[R]|\f[I]JAR\-files\f[R]
 782 Specifies a list of directories, JAR files, and ZIP archives to append
 783 to the end of the default bootstrap class path.
 784 .RS
 785 .PP
 786 \f[B]Oracle Solaris, Linux, and macOS:\f[R] Colons (\f[CB]:\f[R]) separate
 787 entities in this list.
 788 .PP
 789 \f[B]Windows:\f[R] Semicolons (\f[CB];\f[R]) separate entities in this
 790 list.
 791 .RE
 792 .TP
 793 .B \f[CB]\-Xcheck:jni\f[R]
 794 Performs additional checks for Java Native Interface (JNI) functions.
 795 Specifically, it validates the parameters passed to the JNI function and
 796 the runtime environment data before processing the JNI request.
 797 It also checks for pending exceptions between JNI calls.
 798 Any invalid data encountered indicates a problem in the native code, and
 799 the JVM terminates with an irrecoverable error in such cases.
 800 Expect a performance degradation when this option is used.
 801 .RS
 802 .RE
 803 .TP
 804 .B \f[CB]\-Xcomp\f[R]
 805 Forces compilation of methods on first invocation.
 806 By default, the Client VM (\f[CB]\-client\f[R]) performs 1,000 interpreted
 807 method invocations and the Server VM (\f[CB]\-server\f[R]) performs 10,000
 808 interpreted method invocations to gather information for efficient
 809 compilation.
 810 Specifying the \f[CB]\-Xcomp\f[R] option disables interpreted method
 811 invocations to increase compilation performance at the expense of
 812 efficiency.
 813 You can also change the number of interpreted method invocations before
 814 compilation using the \f[CB]\-XX:CompileThreshold\f[R] option.
 815 .RS
 816 .RE
 817 .TP
 818 .B \f[CB]\-Xdebug\f[R]
 819 Does nothing.
 820 Provided for backward compatibility.
 821 .RS
 822 .RE
 823 .TP
 824 .B \f[CB]\-Xdiag\f[R]
 825 Shows additional diagnostic messages.
 826 .RS
 827 .RE
 828 .TP
 829 .B \f[CB]\-Xint\f[R]
 830 Runs the application in interpreted\-only mode.
 831 Compilation to native code is disabled, and all bytecode is executed by
 832 the interpreter.
 833 The performance benefits offered by the just\-in\-time (JIT) compiler
 834 aren\[aq]t present in this mode.
 835 .RS
 836 .RE
 837 .TP
 838 .B \f[CB]\-Xinternalversion\f[R]
 839 Displays more detailed JVM version information than the
 840 \f[CB]\-version\f[R] option, and then exits.
 841 .RS
 842 .RE
 843 .TP
 844 .B \f[CB]\-Xlog:\f[R]\f[I]option\f[R]
 845 Configure or enable logging with the Java Virtual Machine (JVM) unified
 846 logging framework.
 847 See \f[B]Enable Logging with the JVM Unified Logging Framework\f[R].
 848 .RS
 849 .RE
 850 .TP
 851 .B \f[CB]\-Xmixed\f[R]
 852 Executes all bytecode by the interpreter except for hot methods, which
 853 are compiled to native code.
 854 .RS
 855 .RE
 856 .TP
 857 .B \f[CB]\-Xmn\f[R] \f[I]size\f[R]
 858 Sets the initial and maximum size (in bytes) of the heap for the young
 859 generation (nursery).
 860 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
 861 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
 862 \f[CB]G\f[R] to indicate gigabytes.
 863 The young generation region of the heap is used for new objects.
 864 GC is performed in this region more often than in other regions.
 865 If the size for the young generation is too small, then a lot of minor
 866 garbage collections are performed.
 867 If the size is too large, then only full garbage collections are
 868 performed, which can take a long time to complete.
 869 It is recommended that you keep the size for the young generation
 870 greater than 25% and less than 50% of the overall heap size.
 871 The following examples show how to set the initial and maximum size of
 872 young generation to 256 MB using various units:
 873 .RS
 874 .IP
 875 .nf
 876 \f[CB]
 877 \-Xmn256m
 878 \-Xmn262144k
 879 \-Xmn268435456
 880 \f[R]
 881 .fi
 882 .PP
 883 Instead of the \f[CB]\-Xmn\f[R] option to set both the initial and maximum
 884 size of the heap for the young generation, you can use
 885 \f[CB]\-XX:NewSize\f[R] to set the initial size and
 886 \f[CB]\-XX:MaxNewSize\f[R] to set the maximum size.
 887 .RE
 888 .TP
 889 .B \f[CB]\-Xms\f[R] \f[I]size\f[R]
 890 Sets the initial size (in bytes) of the heap.
 891 This value must be a multiple of 1024 and greater than 1 MB.
 892 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
 893 \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]
 894 to indicate gigabytes.
 895 The following examples show how to set the size of allocated memory to 6
 896 MB using various units:
 897 .RS
 898 .IP
 899 .nf
 900 \f[CB]
 901 \-Xms6291456
 902 \-Xms6144k
 903 \-Xms6m
 904 \f[R]
 905 .fi
 906 .PP
 907 If you don\[aq]t set this option, then the initial size is set as the
 908 sum of the sizes allocated for the old generation and the young
 909 generation.
 910 The initial size of the heap for the young generation can be set using
 911 the \f[CB]\-Xmn\f[R] option or the \f[CB]\-XX:NewSize\f[R] option.
 912 .RE
 913 .TP
 914 .B \f[CB]\-Xmx\f[R] \f[I]size\f[R]
 915 Specifies the maximum size (in bytes) of the memory allocation pool in
 916 bytes.
 917 This value must be a multiple of 1024 and greater than 2 MB.
 918 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
 919 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
 920 \f[CB]G\f[R] to indicate gigabytes.
 921 The default value is chosen at runtime based on system configuration.
 922 For server deployments, \f[CB]\-Xms\f[R] and \f[CB]\-Xmx\f[R] are often set
 923 to the same value.
 924 The following examples show how to set the maximum allowed size of
 925 allocated memory to 80 MB using various units:
 926 .RS
 927 .IP
 928 .nf
 929 \f[CB]
 930 \-Xmx83886080
 931 \-Xmx81920k
 932 \-Xmx80m
 933 \f[R]
 934 .fi
 935 .PP
 936 The \f[CB]\-Xmx\f[R] option is equivalent to \f[CB]\-XX:MaxHeapSize\f[R].
 937 .RE
 938 .TP
 939 .B \f[CB]\-Xnoclassgc\f[R]
 940 Disables garbage collection (GC) of classes.
 941 This can save some GC time, which shortens interruptions during the
 942 application run.
 943 When you specify \f[CB]\-Xnoclassgc\f[R] at startup, the class objects in
 944 the application are left untouched during GC and are always be
 945 considered live.
 946 This can result in more memory being permanently occupied which, if not
 947 used carefully, throws an out\-of\-memory exception.
 948 .RS
 949 .RE
 950 .TP
 951 .B \f[CB]\-Xrs\f[R]
 952 Reduces the use of operating system signals by the JVM.
 953 Shutdown hooks enable the orderly shutdown of a Java application by
 954 running user cleanup code (such as closing database connections) at
 955 shutdown, even if the JVM terminates abruptly.
 956 .RS
 957 .IP \[bu] 2
 958 \f[B]Oracle Solaris, Linux, and macOS:\f[R]
 959 .RS 2
 960 .IP \[bu] 2
 961 The JVM catches signals to implement shutdown hooks for unexpected
 962 termination.
 963 The JVM uses \f[CB]SIGHUP\f[R], \f[CB]SIGINT\f[R], and \f[CB]SIGTERM\f[R] to
 964 initiate the running of shutdown hooks.
 965 .IP \[bu] 2
 966 Applications embedding the JVM frequently need to trap signals such as
 967 \f[CB]SIGINT\f[R] or \f[CB]SIGTERM\f[R], which can lead to interference with
 968 the JVM signal handlers.
 969 The \f[CB]\-Xrs\f[R] option is available to address this issue.
 970 When \f[CB]\-Xrs\f[R] is used, the signal masks for \f[CB]SIGINT\f[R],
 971 \f[CB]SIGTERM\f[R], \f[CB]SIGHUP\f[R], and \f[CB]SIGQUIT\f[R] aren\[aq]t
 972 changed by the JVM, and signal handlers for these signals aren\[aq]t
 973 installed.
 974 .RE
 975 .IP \[bu] 2
 976 \f[B]Windows:\f[R]
 977 .RS 2
 978 .IP \[bu] 2
 979 The JVM watches for console control events to implement shutdown hooks
 980 for unexpected termination.
 981 Specifically, the JVM registers a console control handler that begins
 982 shutdown\-hook processing and returns \f[CB]TRUE\f[R] for
 983 \f[CB]CTRL_C_EVENT\f[R], \f[CB]CTRL_CLOSE_EVENT\f[R],
 984 \f[CB]CTRL_LOGOFF_EVENT\f[R], and \f[CB]CTRL_SHUTDOWN_EVENT\f[R].
 985 .IP \[bu] 2
 986 The JVM uses a similar mechanism to implement the feature of dumping
 987 thread stacks for debugging purposes.
 988 The JVM uses \f[CB]CTRL_BREAK_EVENT\f[R] to perform thread dumps.
 989 .IP \[bu] 2
 990 If the JVM is run as a service (for example, as a servlet engine for a
 991 web server), then it can receive \f[CB]CTRL_LOGOFF_EVENT\f[R] but
 992 shouldn\[aq]t initiate shutdown because the operating system doesn\[aq]t
 993 actually terminate the process.
 994 To avoid possible interference such as this, the \f[CB]\-Xrs\f[R] option
 995 can be used.
 996 When the \f[CB]\-Xrs\f[R] option is used, the JVM doesn\[aq]t install a
 997 console control handler, implying that it doesn\[aq]t watch for or
 998 process \f[CB]CTRL_C_EVENT\f[R], \f[CB]CTRL_CLOSE_EVENT\f[R],
 999 \f[CB]CTRL_LOGOFF_EVENT\f[R], or \f[CB]CTRL_SHUTDOWN_EVENT\f[R].
1000 .RE
1001 .PP
1002 There are two consequences of specifying \f[CB]\-Xrs\f[R]:
1003 .IP \[bu] 2
1004 \f[B]Oracle Solaris, Linux, and macOS:\f[R] \f[CB]SIGQUIT\f[R] thread dumps
1005 aren\[aq]t available.
1006 .IP \[bu] 2
1007 \f[B]Windows:\f[R] Ctrl + Break thread dumps aren\[aq]t available.
1008 .PP
1009 User code is responsible for causing shutdown hooks to run, for example,
1010 by calling the \f[CB]System.exit()\f[R] when the JVM is to be terminated.
1011 .RE
1012 .TP
1013 .B \f[CB]\-Xshare:\f[R]\f[I]mode\f[R]
1014 Sets the class data sharing (CDS) mode.
1015 .RS
1016 .PP
1017 Possible \f[I]mode\f[R] arguments for this option include the following:
1018 .TP
1019 .B \f[CB]auto\f[R]
1020 Use shared class data if possible (default).
1021 .RS
1022 .RE
1023 .TP
1024 .B \f[CB]on\f[R]
1025 Require using shared class data, otherwise fail.
1026 .RS
1027 .RE
1028 .RS
1029 .PP
1030 \f[B]Note:\f[R] The \f[CB]\-Xshare:on\f[R] option is used for testing
1031 purposes only and may cause intermittent failures due to the use of
1032 address space layout randomization by the operation system.
1033 This option should not be used in production environments.
1034 .RE
1035 .TP
1036 .B \f[CB]off\f[R]
1037 Do not attempt to use shared class data.
1038 .RS
1039 .RE
1040 .RE
1041 .TP
1042 .B \f[CB]\-XshowSettings\f[R]
1043 Shows all settings and then continues.
1044 .RS
1045 .RE
1046 .TP
1047 .B \f[CB]\-XshowSettings:\f[R]\f[I]category\f[R]
1048 Shows settings and continues.
1049 Possible \f[I]category\f[R] arguments for this option include the
1050 following:
1051 .RS
1052 .TP
1053 .B \f[CB]all\f[R]
1054 Shows all categories of settings.
1055 This is the default value.
1056 .RS
1057 .RE
1058 .TP
1059 .B \f[CB]locale\f[R]
1060 Shows settings related to locale.
1061 .RS
1062 .RE
1063 .TP
1064 .B \f[CB]properties\f[R]
1065 Shows settings related to system properties.
1066 .RS
1067 .RE
1068 .TP
1069 .B \f[CB]vm\f[R]
1070 Shows the settings of the JVM.
1071 .RS
1072 .RE
1073 .TP
1074 .B \f[CB]system\f[R]
1075 \f[B]Linux:\f[R] Shows host system or container configuration and
1076 continues.
1077 .RS
1078 .RE
1079 .RE
1080 .TP
1081 .B \f[CB]\-Xss\f[R] \f[I]size\f[R]
1082 Sets the thread stack size (in bytes).
1083 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate KB, \f[CB]m\f[R] or
1084 \f[CB]M\f[R] to indicate MB, or \f[CB]g\f[R] or \f[CB]G\f[R] to indicate GB.
1085 The default value depends on the platform:
1086 .RS
1087 .IP \[bu] 2
1088 Linux/x64 (64\-bit): 1024 KB
1089 .IP \[bu] 2
1090 macOS (64\-bit): 1024 KB
1091 .IP \[bu] 2
1092 Oracle Solaris (64\-bit): 1024 KB
1093 .IP \[bu] 2
1094 Windows: The default value depends on virtual memory
1095 .PP
1096 The following examples set the thread stack size to 1024 KB in different
1097 units:
1098 .IP
1099 .nf
1100 \f[CB]
1101 \-Xss1m
1102 \-Xss1024k
1103 \-Xss1048576
1104 \f[R]
1105 .fi
1106 .PP
1107 This option is similar to \f[CB]\-XX:ThreadStackSize\f[R].
1108 .RE
1109 .TP
1110 .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])*
1111 Updates \f[I]module\f[R] to read the \f[I]target\-module\f[R], regardless
1112 of the module declaration.
1113 \f[I]target\-module\f[R] can be all unnamed to read all unnamed modules.
1114 .RS
1115 .RE
1116 .TP
1117 .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])*
1118 Updates \f[I]module\f[R] to export \f[I]package\f[R] to
1119 \f[I]target\-module\f[R], regardless of module declaration.
1120 The \f[I]target\-module\f[R] can be all unnamed to export to all unnamed
1121 modules.
1122 .RS
1123 .RE
1124 .TP
1125 .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])*
1126 Updates \f[I]module\f[R] to open \f[I]package\f[R] to
1127 \f[I]target\-module\f[R], regardless of module declaration.
1128 .RS
1129 .RE
1130 .TP
1131 .B \f[CB]\-\-illegal\-access=\f[R]\f[I]parameter\f[R]
1132 When present at run time, \f[CB]\-\-illegal\-access=\f[R] takes a keyword
1133 \f[I]parameter\f[R] to specify a mode of operation:
1134 .RS
1135 .RS
1136 .PP
1137 \f[B]Note:\f[R] This option will be removed in a future release.
1138 .RE
1139 .IP \[bu] 2
1140 \f[CB]permit\f[R]: This mode opens each package in each module in the
1141 run\-time image to code in all unnamed modules ( such as code on the
1142 class path), if that package existed in JDK 8.
1143 This enables both static access, (for example, by compiled bytecode, and
1144 deep reflective access) through the platform\[aq]s various reflection
1145 APIs.
1146 The first reflective\-access operation to any such package causes a
1147 warning to be issued.
1148 However, no warnings are issued after the first occurrence.
1149 This single warning describes how to enable further warnings.
1150 This mode is the default for the current JDK but will change in a future
1151 release.
1152 .IP \[bu] 2
1153 \f[CB]warn\f[R]: This mode is identical to \f[CB]permit\f[R] except that a
1154 warning message is issued for each illegal reflective\-access operation.
1155 .IP \[bu] 2
1156 \f[CB]debug\f[R]: This mode is identical to \f[CB]warn\f[R] except that both
1157 a warning message and a stack trace are issued for each illegal
1158 reflective\-access operation.
1159 .IP \[bu] 2
1160 \f[CB]deny\f[R]: This mode disables all illegal\-access operations except
1161 for those enabled by other command\-line options, such as
1162 \f[CB]\-\-add\-opens\f[R].
1163 This mode will become the default in a future release.
1164 .PP
1165 The default mode, \f[CB]\-\-illegal\-access=permit\f[R], is intended to
1166 make you aware of code on the class path that reflectively accesses any
1167 JDK\-internal APIs at least once.
1168 To learn about all such accesses, you can use the \f[CB]warn\f[R] or the
1169 \f[CB]debug\f[R] modes.
1170 For each library or framework on the class path that requires illegal
1171 access, you have two options:
1172 .IP \[bu] 2
1173 If the component\[aq]s maintainers have already released a fixed version
1174 that no longer uses JDK\-internal APIs then you can consider upgrading
1175 to that version.
1176 .IP \[bu] 2
1177 If the component still needs to be fixed, then you can contact its
1178 maintainers and ask them to replace their use of JDK\-internal APIs with
1179 the proper exported APIs.
1180 .PP
1181 If you must continue to use a component that requires illegal access,
1182 then you can eliminate the warning messages by using one or more
1183 \f[CB]\-\-add\-opens\f[R] options to open only those internal packages to
1184 which access is required.
1185 .PP
1186 To verify that your application is ready for a future version of the
1187 JDK, run it with \f[CB]\-\-illegal\-access=deny\f[R] along with any
1188 necessary \f[CB]\-\-add\-opens\f[R] options.
1189 Any remaining illegal\-access errors will most likely be due to static
1190 references from compiled code to JDK\-internal APIs.
1191 You can identify those by running the \f[B]jdeps\f[R] tool with the
1192 \f[CB]\-\-jdk\-internals\f[R] option.
1193 For performance reasons, the current JDK does not issue warnings for
1194 illegal static\-access operations.
1195 .RE
1196 .TP
1197 .B \f[CB]\-\-limit\-modules\f[R] \f[I]module\f[R][\f[CB],\f[R]\f[I]module\f[R]...]
1198 Specifies the limit of the universe of observable modules.
1199 .RS
1200 .RE
1201 .TP
1202 .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])*
1203 Overrides or augments a module with classes and resources in JAR files
1204 or directories.
1205 .RS
1206 .RE
1207 .TP
1208 .B \f[CB]\-\-disable\-\@files\f[R]
1209 Can be used anywhere on the command line, including in an argument file,
1210 to prevent further \f[CB]\@\f[R]\f[I]filename\f[R] expansion.
1211 This option stops expanding \f[CB]\@\f[R]\-argfiles after the option.
1212 .RS
1213 .RE
1214 .TP
1215 .B \f[CB]\-\-source\f[R] \f[I]version\f[R]
1216 Sets the version of the source in source\-file mode.
1217 .RS
1218 .RE
1219 .SH EXTRA OPTIONS FOR MACOS
1220 .PP
1221 The following extra options are macOS specific.
1222 .TP
1223 .B \f[CB]\-XstartOnFirstThread\f[R]
1224 Runs the \f[CB]main()\f[R] method on the first (AppKit) thread.
1225 .RS
1226 .RE
1227 .TP
1228 .B \f[CB]\-Xdock:name=\f[R]\f[I]application_name\f[R]
1229 Overrides the default application name displayed in dock.
1230 .RS
1231 .RE
1232 .TP
1233 .B \f[CB]\-Xdock:icon=\f[R]\f[I]path_to_icon_file\f[R]
1234 Overrides the default icon displayed in dock.
1235 .RS
1236 .RE
1237 .SH ADVANCED OPTIONS FOR JAVA
1238 .PP
1239 These \f[CB]java\f[R] options can be used to enable other advanced
1240 options.
1241 .TP
1242 .B \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R]
1243 Unlocks the options intended for diagnosing the JVM.
1244 By default, this option is disabled and diagnostic options aren\[aq]t
1245 available.
1246 .RS
1247 .PP
1248 Command line options that are enabled with the use of this option are
1249 not supported.
1250 If you encounter issues while using any of these options, it is very
1251 likely that you will be required to reproduce the problem without using
1252 any of these unsupported options before Oracle Support can assist with
1253 an investigation.
1254 It is also possible that any of these options may be removed or their
1255 behavior changed without any warning.
1256 .RE
1257 .TP
1258 .B \f[CB]\-XX:+UnlockExperimentalVMOptions\f[R]
1259 Unlocks the options that provide experimental features in the JVM.
1260 By default, this option is disabled and experimental features aren\[aq]t
1261 available.
1262 .RS
1263 .RE
1264 .SH ADVANCED RUNTIME OPTIONS FOR JAVA
1265 .PP
1266 These \f[CB]java\f[R] options control the runtime behavior of the Java
1267 HotSpot VM.
1268 .TP
1269 .B \f[CB]\-XX:ActiveProcessorCount=\f[R]\f[I]x\f[R]
1270 Overrides the number of CPUs that the VM will use to calculate the size
1271 of thread pools it will use for various operations such as Garbage
1272 Collection and ForkJoinPool.
1273 .RS
1274 .PP
1275 The VM normally determines the number of available processors from the
1276 operating system.
1277 This flag can be useful for partitioning CPU resources when running
1278 multiple Java processes in docker containers.
1279 This flag is honored even if \f[CB]UseContainerSupport\f[R] is not
1280 enabled.
1281 See \f[CB]\-XX:\-UseContainerSupport\f[R] for a description of enabling
1282 and disabling container support.
1283 .RE
1284 .TP
1285 .B \f[CB]\-XX:AllocateHeapAt=\f[R]\f[I]path\f[R]
1286 Takes a path to the file system and uses memory mapping to allocate the
1287 object heap on the memory device.
1288 Using this option enables the HotSpot VM to allocate the Java object
1289 heap on an alternative memory device, such as an NV\-DIMM, specified by
1290 the user.
1291 .RS
1292 .PP
1293 Alternative memory devices that have the same semantics as DRAM,
1294 including the semantics of atomic operations, can be used instead of
1295 DRAM for the object heap without changing the existing application code.
1296 All other memory structures (such as the code heap, metaspace, and
1297 thread stacks) continue to reside in DRAM.
1298 .PP
1299 Some operating systems expose non\-DRAM memory through the file system.
1300 Memory\-mapped files in these file systems bypass the page cache and
1301 provide a direct mapping of virtual memory to the physical memory on the
1302 device.
1303 The existing heap related flags (such as \f[CB]\-Xmx\f[R] and
1304 \f[CB]\-Xms\f[R]) and garbage\-collection related flags continue to work
1305 as before.
1306 .RE
1307 .TP
1308 .B \f[CB]\-XX:\-CompactStrings\f[R]
1309 Disables the Compact Strings feature.
1310 By default, this option is enabled.
1311 When this option is enabled, Java Strings containing only single\-byte
1312 characters are internally represented and stored as
1313 single\-byte\-per\-character Strings using ISO\-8859\-1 / Latin\-1
1314 encoding.
1315 This reduces, by 50%, the amount of space required for Strings
1316 containing only single\-byte characters.
1317 For Java Strings containing at least one multibyte character: these are
1318 represented and stored as 2 bytes per character using UTF\-16 encoding.
1319 Disabling the Compact Strings feature forces the use of UTF\-16 encoding
1320 as the internal representation for all Java Strings.
1321 .RS
1322 .PP
1323 Cases where it may be beneficial to disable Compact Strings include the
1324 following:
1325 .IP \[bu] 2
1326 When it\[aq]s known that an application overwhelmingly will be
1327 allocating multibyte character Strings
1328 .IP \[bu] 2
1329 In the unexpected event where a performance regression is observed in
1330 migrating from Java SE 8 to Java SE 9 and an analysis shows that Compact
1331 Strings introduces the regression
1332 .PP
1333 In both of these scenarios, disabling Compact Strings makes sense.
1334 .RE
1335 .TP
1336 .B \f[CB]\-XX:ErrorFile=\f[R]\f[I]filename\f[R]
1337 Specifies the path and file name to which error data is written when an
1338 irrecoverable error occurs.
1339 By default, this file is created in the current working directory and
1340 named \f[CB]hs_err_pid\f[R]\f[I]pid\f[R]\f[CB]\&.log\f[R] where \f[I]pid\f[R]
1341 is the identifier of the process that encountered the error.
1342 .RS
1343 .PP
1344 The following example shows how to set the default log file (note that
1345 the identifier of the process is specified as \f[CB]%p\f[R]):
1346 .RS
1347 .PP
1348 \f[CB]\-XX:ErrorFile=./hs_err_pid%p.log\f[R]
1349 .RE
1350 .IP \[bu] 2
1351 \f[B]Oracle Solaris, Linux, and macOS:\f[R] The following example shows
1352 how to set the error log to \f[CB]/var/log/java/java_error.log\f[R]:
1353 .RS 2
1354 .RS
1355 .PP
1356 \f[CB]\-XX:ErrorFile=/var/log/java/java_error.log\f[R]
1357 .RE
1358 .RE
1359 .IP \[bu] 2
1360 \f[B]Windows:\f[R] The following example shows how to set the error log
1361 file to \f[CB]C:/log/java/java_error.log\f[R]:
1362 .RS 2
1363 .RS
1364 .PP
1365 \f[CB]\-XX:ErrorFile=C:/log/java/java_error.log\f[R]
1366 .RE
1367 .RE
1368 .PP
1369 If the file exists, and is writeable, then it will be overwritten.
1370 Otherwise, if the file can\[aq]t be created in the specified directory
1371 (due to insufficient space, permission problem, or another issue), then
1372 the file is created in the temporary directory for the operating system:
1373 .IP \[bu] 2
1374 \f[B]Oracle Solaris, Linux, and macOS:\f[R] The temporary directory is
1375 \f[CB]/tmp\f[R].
1376 .IP \[bu] 2
1377 \f[B]Windows:\f[R] The temporary directory is specified by the value of
1378 the \f[CB]TMP\f[R] environment variable; if that environment variable
1379 isn\[aq]t defined, then the value of the \f[CB]TEMP\f[R] environment
1380 variable is used.
1381 .RE
1382 .TP
1383 .B \f[CB]\-XX:+ExtensiveErrorReports\f[R]
1384 Enables the reporting of more extensive error information in the
1385 \f[CB]ErrorFile\f[R].
1386 This option can be turned on in environments where maximal information
1387 is desired \- even if the resulting logs may be quite large and/or
1388 contain information that might be considered sensitive.
1389 The information can vary from release to release, and across different
1390 platforms.
1391 By default this option is disabled.
1392 .RS
1393 .RE
1394 .TP
1395 .B \f[CB]\-XX:+FlightRecorder\f[R]
1396 Enables the use of Java Flight Recorder (JFR) during the runtime of the
1397 application.
1398 .RS
1399 .RS
1400 .PP
1401 \f[B]Note:\f[R] The \f[CB]\-XX:+FlightRecorder\f[R] option is no longer
1402 required to use JFR.
1403 This was a change made in JDK 8u40.
1404 .RE
1405 .RE
1406 .TP
1407 .B \f[CB]\-XX:FlightRecorderOptions=\f[R]\f[I]parameter\f[R]\f[CB]=\f[R]\f[I]value\f[R]
1408 Sets the parameters that control the behavior of JFR.
1409 .RS
1410 .PP
1411 The following list contains the available JFR
1412 \f[I]parameter\f[R]\f[CB]=\f[R]\f[I]value\f[R] entries:
1413 .TP
1414 .B \f[CB]allow_threadbuffers_to_disk=\f[R]{\f[CB]true\f[R]|\f[CB]false\f[R]}
1415 Specifies whether thread buffers are written directly to disk if the
1416 buffer thread is blocked.
1417 By default, this parameter is disabled.
1418 .RS
1419 .RE
1420 .TP
1421 .B \f[CB]globalbuffersize=\f[R]\f[I]size\f[R]
1422 Specifies the total amount of primary memory used for data retention.
1423 The default value is based on the value specified for
1424 \f[CB]memorysize\f[R].
1425 Change the \f[CB]memorysize\f[R] parameter to alter the size of global
1426 buffers.
1427 .RS
1428 .RE
1429 .TP
1430 .B \f[CB]maxchunksize=\f[R]\f[I]size\f[R]
1431 Specifies the maximum size (in bytes) of the data chunks in a recording.
1432 Append \f[CB]m\f[R] or \f[CB]M\f[R] to specify the size in megabytes (MB),
1433 or \f[CB]g\f[R] or \f[CB]G\f[R] to specify the size in gigabytes (GB).
1434 By default, the maximum size of data chunks is set to 12 MB.
1435 The minimum allowed is 1 MB.
1436 .RS
1437 .RE
1438 .TP
1439 .B \f[CB]memorysize=\f[R]\f[I]size\f[R]
1440 Determines how much buffer memory should be used, and sets the
1441 \f[CB]globalbuffersize\f[R] and \f[CB]numglobalbuffers\f[R] parameters based
1442 on the size specified.
1443 Append \f[CB]m\f[R] or \f[CB]M\f[R] to specify the size in megabytes (MB),
1444 or \f[CB]g\f[R] or \f[CB]G\f[R] to specify the size in gigabytes (GB).
1445 By default, the memory size is set to 10 MB.
1446 .RS
1447 .RE
1448 .TP
1449 .B \f[CB]numglobalbuffers\f[R]
1450 Specifies the number of global buffers used.
1451 The default value is based on the memory size specified.
1452 Change the \f[CB]memorysize\f[R] parameter to alter the number of global
1453 buffers.
1454 .RS
1455 .RE
1456 .TP
1457 .B \f[CB]old\-object\-queue\-size=number\-of\-objects\f[R]
1458 Maximum number of old objects to track.
1459 By default, the number of objects is set to 256.
1460 .RS
1461 .RE
1462 .TP
1463 .B \f[CB]repository=\f[R]\f[I]path\f[R]
1464 Specifies the repository (a directory) for temporary disk storage.
1465 By default, the system\[aq]s temporary directory is used.
1466 .RS
1467 .RE
1468 .TP
1469 .B \f[CB]retransform=\f[R]{\f[CB]true\f[R]|\f[CB]false\f[R]}
1470 Specifies whether event classes should be retransformed using JVMTI.
1471 If false, instrumentation is added when event classes are loaded.
1472 By default, this parameter is enabled.
1473 .RS
1474 .RE
1475 .TP
1476 .B \f[CB]samplethreads=\f[R]{\f[CB]true\f[R]|\f[CB]false\f[R]}
1477 Specifies whether thread sampling is enabled.
1478 Thread sampling occurs only if the sampling event is enabled along with
1479 this parameter.
1480 By default, this parameter is enabled.
1481 .RS
1482 .RE
1483 .TP
1484 .B \f[CB]stackdepth=\f[R]\f[I]depth\f[R]
1485 Stack depth for stack traces.
1486 By default, the depth is set to 64 method calls.
1487 The maximum is 2048.
1488 Values greater than 64 could create significant overhead and reduce
1489 performance.
1490 .RS
1491 .RE
1492 .TP
1493 .B \f[CB]threadbuffersize=\f[R]\f[I]size\f[R]
1494 Specifies the per\-thread local buffer size (in bytes).
1495 By default, the local buffer size is set to 8 kilobytes.
1496 Overriding this parameter could reduce performance and is not
1497 recommended.
1498 .RS
1499 .RE
1500 .PP
1501 You can specify values for multiple parameters by separating them with a
1502 comma.
1503 .RE
1504 .TP
1505 .B \f[CB]\-XX:LargePageSizeInBytes=\f[R]\f[I]size\f[R]
1506 Sets the maximum size (in bytes) for large pages used for the Java heap.
1507 The \f[I]size\f[R] argument must be a power of 2 (2, 4, 8, 16, and so
1508 on).
1509 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
1510 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
1511 \f[CB]G\f[R] to indicate gigabytes.
1512 By default, the size is set to 0, meaning that the JVM chooses the size
1513 for large pages automatically.
1514 See \f[B]Large Pages\f[R].
1515 .RS
1516 .PP
1517 The following example describes how to set the large page size to 4
1518 megabytes (MB):
1519 .RS
1520 .PP
1521 \f[CB]\-XX:LargePageSizeInBytes=4m\f[R]
1522 .RE
1523 .RE
1524 .TP
1525 .B \f[CB]\-XX:MaxDirectMemorySize=\f[R]\f[I]size\f[R]
1526 Sets the maximum total size (in bytes) of the \f[CB]java.nio\f[R] package,
1527 direct\-buffer allocations.
1528 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
1529 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
1530 \f[CB]G\f[R] to indicate gigabytes.
1531 By default, the size is set to 0, meaning that the JVM chooses the size
1532 for NIO direct\-buffer allocations automatically.
1533 .RS
1534 .PP
1535 The following examples illustrate how to set the NIO size to 1024 KB in
1536 different units:
1537 .IP
1538 .nf
1539 \f[CB]
1540 \-XX:MaxDirectMemorySize=1m
1541 \-XX:MaxDirectMemorySize=1024k
1542 \-XX:MaxDirectMemorySize=1048576
1543 \f[R]
1544 .fi
1545 .RE
1546 .TP
1547 .B \f[CB]\-XX:\-MaxFDLimit\f[R]
1548 Disables the attempt to set the soft limit for the number of open file
1549 descriptors to the hard limit.
1550 By default, this option is enabled on all platforms, but is ignored on
1551 Windows.
1552 The only time that you may need to disable this is on Mac OS, where its
1553 use imposes a maximum of 10240, which is lower than the actual system
1554 maximum.
1555 .RS
1556 .RE
1557 .TP
1558 .B \f[CB]\-XX:NativeMemoryTracking=\f[R]\f[I]mode\f[R]
1559 Specifies the mode for tracking JVM native memory usage.
1560 Possible \f[I]mode\f[R] arguments for this option include the following:
1561 .RS
1562 .TP
1563 .B \f[CB]off\f[R]
1564 Instructs not to track JVM native memory usage.
1565 This is the default behavior if you don\[aq]t specify the
1566 \f[CB]\-XX:NativeMemoryTracking\f[R] option.
1567 .RS
1568 .RE
1569 .TP
1570 .B \f[CB]summary\f[R]
1571 Tracks memory usage only by JVM subsystems, such as Java heap, class,
1572 code, and thread.
1573 .RS
1574 .RE
1575 .TP
1576 .B \f[CB]detail\f[R]
1577 In addition to tracking memory usage by JVM subsystems, track memory
1578 usage by individual \f[CB]CallSite\f[R], individual virtual memory region
1579 and its committed regions.
1580 .RS
1581 .RE
1582 .RE
1583 .TP
1584 .B \f[CB]\-XX:ObjectAlignmentInBytes=\f[R]\f[I]alignment\f[R]
1585 Sets the memory alignment of Java objects (in bytes).
1586 By default, the value is set to 8 bytes.
1587 The specified value should be a power of 2, and must be within the range
1588 of 8 and 256 (inclusive).
1589 This option makes it possible to use compressed pointers with large Java
1590 heap sizes.
1591 .RS
1592 .PP
1593 The heap size limit in bytes is calculated as:
1594 .RS
1595 .PP
1596 \f[CB]4GB\ *\ ObjectAlignmentInBytes\f[R]
1597 .RE
1598 .RS
1599 .PP
1600 \f[B]Note:\f[R] As the alignment value increases, the unused space
1601 between objects also increases.
1602 As a result, you may not realize any benefits from using compressed
1603 pointers with large Java heap sizes.
1604 .RE
1605 .RE
1606 .TP
1607 .B \f[CB]\-XX:OnError=\f[R]\f[I]string\f[R]
1608 Sets a custom command or a series of semicolon\-separated commands to
1609 run when an irrecoverable error occurs.
1610 If the string contains spaces, then it must be enclosed in quotation
1611 marks.
1612 .RS
1613 .IP \[bu] 2
1614 \f[B]Oracle Solaris, Linux, and macOS:\f[R] The following example shows
1615 how the \f[CB]\-XX:OnError\f[R] option can be used to run the
1616 \f[CB]gcore\f[R] command to create a core image, and start the
1617 \f[CB]gdb\f[R] debugger to attach to the process in case of an
1618 irrecoverable error (the \f[CB]%p\f[R] designates the current process
1619 identifier):
1620 .RS 2
1621 .RS
1622 .PP
1623 \f[CB]\-XX:OnError="gcore\ %p;gdb\ \-p\ %p"\f[R]
1624 .RE
1625 .RE
1626 .IP \[bu] 2
1627 \f[B]Windows:\f[R] The following example shows how the
1628 \f[CB]\-XX:OnError\f[R] option can be used to run the
1629 \f[CB]userdump.exe\f[R] utility to obtain a crash dump in case of an
1630 irrecoverable error (the \f[CB]%p\f[R] designates the current process
1631 identifier).
1632 This example assumes that the path to the \f[CB]userdump.exe\f[R] utility
1633 is specified in the \f[CB]PATH\f[R] environment variable:
1634 .RS 2
1635 .RS
1636 .PP
1637 \f[CB]\-XX:OnError="userdump.exe\ %p"\f[R]
1638 .RE
1639 .RE
1640 .RE
1641 .TP
1642 .B \f[CB]\-XX:OnOutOfMemoryError=\f[R]\f[I]string\f[R]
1643 Sets a custom command or a series of semicolon\-separated commands to
1644 run when an \f[CB]OutOfMemoryError\f[R] exception is first thrown.
1645 If the string contains spaces, then it must be enclosed in quotation
1646 marks.
1647 For an example of a command string, see the description of the
1648 \f[CB]\-XX:OnError\f[R] option.
1649 .RS
1650 .RE
1651 .TP
1652 .B \f[CB]\-XX:+PrintCommandLineFlags\f[R]
1653 Enables printing of ergonomically selected JVM flags that appeared on
1654 the command line.
1655 It can be useful to know the ergonomic values set by the JVM, such as
1656 the heap space size and the selected garbage collector.
1657 By default, this option is disabled and flags aren\[aq]t printed.
1658 .RS
1659 .RE
1660 .TP
1661 .B \f[CB]\-XX:+PreserveFramePointer\f[R]
1662 Selects between using the RBP register as a general purpose register
1663 (\f[CB]\-XX:\-PreserveFramePointer\f[R]) and using the RBP register to
1664 hold the frame pointer of the currently executing method
1665 (\f[CB]\-XX:+PreserveFramePointer\f[R] .
1666 If the frame pointer is available, then external profiling tools\ (for
1667 example, Linux perf) can construct more accurate stack traces.
1668 .RS
1669 .RE
1670 .TP
1671 .B \f[CB]\-XX:+PrintNMTStatistics\f[R]
1672 Enables printing of collected native memory tracking data at JVM exit
1673 when native memory tracking is enabled (see
1674 \f[CB]\-XX:NativeMemoryTracking\f[R]).
1675 By default, this option is disabled and native memory tracking data
1676 isn\[aq]t printed.
1677 .RS
1678 .RE
1679 .TP
1680 .B \f[CB]\-XX:SharedArchiveFile=\f[R]\f[I]path\f[R]
1681 Specifies the path and name of the class data sharing (CDS) archive file
1682 .RS
1683 .PP
1684 See \f[B]Application Class Data Sharing\f[R].
1685 .RE
1686 .TP
1687 .B \f[CB]\-XX:SharedArchiveConfigFile\f[R]=\f[I]shared_config_file\f[R]
1688 Specifies additional shared data added to the archive file.
1689 .RS
1690 .RE
1691 .TP
1692 .B \f[CB]\-XX:SharedClassListFile=\f[R]\f[I]file_name\f[R]
1693 Specifies the text file that contains the names of the classes to store
1694 in the class data sharing (CDS) archive.
1695 This file contains the full name of one class per line, except slashes
1696 (\f[CB]/\f[R]) replace dots (\f[CB]\&.\f[R]).
1697 For example, to specify the classes \f[CB]java.lang.Object\f[R] and
1698 \f[CB]hello.Main\f[R], create a text file that contains the following two
1699 lines:
1700 .RS
1701 .IP
1702 .nf
1703 \f[CB]
1704 java/lang/Object
1705 hello/Main
1706 \f[R]
1707 .fi
1708 .PP
1709 The classes that you specify in this text file should include the
1710 classes that are commonly used by the application.
1711 They may include any classes from the application, extension, or
1712 bootstrap class paths.
1713 .PP
1714 See \f[B]Application Class Data Sharing\f[R].
1715 .RE
1716 .TP
1717 .B \f[CB]\-XX:+ShowMessageBoxOnError\f[R]
1718 Enables the display of a dialog box when the JVM experiences an
1719 irrecoverable error.
1720 This prevents the JVM from exiting and keeps the process active so that
1721 you can attach a debugger to it to investigate the cause of the error.
1722 By default, this option is disabled.
1723 .RS
1724 .RE
1725 .TP
1726 .B \f[CB]\-XX:StartFlightRecording=\f[R]\f[I]parameter\f[R]\f[CB]=\f[R]\f[I]value\f[R]
1727 Starts a JFR recording for the Java application.
1728 This option is equivalent to the \f[CB]JFR.start\f[R] diagnostic command
1729 that starts a recording during runtime.
1730 You can set the following \f[I]parameter\f[R]\f[CB]=\f[R]\f[I]value\f[R]
1731 entries when starting a JFR recording:
1732 .RS
1733 .TP
1734 .B \f[CB]delay=\f[R]\f[I]time\f[R]
1735 Specifies the delay between the Java application launch time and the
1736 start of the recording.
1737 Append \f[CB]s\f[R] to specify the time in seconds, \f[CB]m\f[R] for
1738 minutes, \f[CB]h\f[R] for hours, or \f[CB]d\f[R] for days (for example,
1739 specifying \f[CB]10m\f[R] means 10 minutes).
1740 By default, there\[aq]s no delay, and this parameter is set to 0.
1741 .RS
1742 .RE
1743 .TP
1744 .B \f[CB]disk=\f[R]{\f[CB]true\f[R]|\f[CB]false\f[R]}
1745 Specifies whether to write data to disk while recording.
1746 By default, this parameter is enabled.
1747 .RS
1748 .RE
1749 .TP
1750 .B \f[CB]dumponexit=\f[R]{\f[CB]true\f[R]|\f[CB]false\f[R]}
1751 Specifies if the running recording is dumped when the JVM shuts down.
1752 If enabled and a \f[CB]filename\f[R] is not entered, the recording is
1753 written to a file in the directory where the process was started.
1754 The file name is a system\-generated name that contains the process ID,
1755 recording ID, and current timestamp, similar to
1756 \f[CB]hotspot\-pid\-47496\-id\-1\-2018_01_25_19_10_41.jfr\f[R].
1757 By default, this parameter is disabled.
1758 .RS
1759 .RE
1760 .TP
1761 .B \f[CB]duration=\f[R]\f[I]time\f[R]
1762 Specifies the duration of the recording.
1763 Append \f[CB]s\f[R] to specify the time in seconds, \f[CB]m\f[R] for
1764 minutes, \f[CB]h\f[R] for hours, or \f[CB]d\f[R] for days (for example,
1765 specifying \f[CB]5h\f[R] means 5 hours).
1766 By default, the duration isn\[aq]t limited, and this parameter is set to
1767 0.
1768 .RS
1769 .RE
1770 .TP
1771 .B \f[CB]filename=\f[R]\f[I]path\f[R]
1772 Specifies the path and name of the file to which the recording is
1773 written when the recording is stopped, for example:
1774 .RS
1775 .IP \[bu] 2
1776 \f[CB]recording.jfr\f[R]
1777 .IP \[bu] 2
1778 \f[CB]/home/user/recordings/recording.jfr\f[R]
1779 .IP \[bu] 2
1780 \f[CB]c:\\recordings\\recording.jfr\f[R]
1781 .RE
1782 .TP
1783 .B \f[CB]name=\f[R]\f[I]identifier\f[R]
1784 Takes both the name and the identifier of a recording.
1785 .RS
1786 .RE
1787 .TP
1788 .B \f[CB]maxage=\f[R]\f[I]time\f[R]
1789 Specifies the maximum age of disk data to keep for the recording.
1790 This parameter is valid only when the \f[CB]disk\f[R] parameter is set to
1791 \f[CB]true\f[R].
1792 Append \f[CB]s\f[R] to specify the time in seconds, \f[CB]m\f[R] for
1793 minutes, \f[CB]h\f[R] for hours, or \f[CB]d\f[R] for days (for example,
1794 specifying \f[CB]30s\f[R] means 30 seconds).
1795 By default, the maximum age isn\[aq]t limited, and this parameter is set
1796 to \f[CB]0s\f[R].
1797 .RS
1798 .RE
1799 .TP
1800 .B \f[CB]maxsize=\f[R]\f[I]size\f[R]
1801 Specifies the maximum size (in bytes) of disk data to keep for the
1802 recording.
1803 This parameter is valid only when the \f[CB]disk\f[R] parameter is set to
1804 \f[CB]true\f[R].
1805 The value must not be less than the value for the \f[CB]maxchunksize\f[R]
1806 parameter set with \f[CB]\-XX:FlightRecorderOptions\f[R].
1807 Append \f[CB]m\f[R] or \f[CB]M\f[R] to specify the size in megabytes, or
1808 \f[CB]g\f[R] or \f[CB]G\f[R] to specify the size in gigabytes.
1809 By default, the maximum size of disk data isn\[aq]t limited, and this
1810 parameter is set to \f[CB]0\f[R].
1811 .RS
1812 .RE
1813 .TP
1814 .B \f[CB]path\-to\-gc\-roots=\f[R]{\f[CB]true\f[R]|\f[CB]false\f[R]}
1815 Specifies whether to collect the path to garbage collection (GC) roots
1816 at the end of a recording.
1817 By default, this parameter is disabled.
1818 .RS
1819 .PP
1820 The path to GC roots is useful for finding memory leaks, but collecting
1821 it is time\-consuming.
1822 Enable this option only when you start a recording for an application
1823 that you suspect has a memory leak.
1824 If the \f[CB]settings\f[R] parameter is set to \f[CB]profile\f[R], the stack
1825 trace from where the potential leaking object was allocated is included
1826 in the information collected.
1827 .RE
1828 .TP
1829 .B \f[CB]settings=\f[R]\f[I]path\f[R]
1830 Specifies the path and name of the event settings file (of type JFC).
1831 By default, the \f[CB]default.jfc\f[R] file is used, which is located in
1832 \f[CB]JRE_HOME/lib/jfr\f[R].
1833 This default settings file collects a predefined set of information with
1834 low overhead, so it has minimal impact on performance and can be used
1835 with recordings that run continuously.
1836 .RS
1837 .PP
1838 A second settings file is also provided, profile.jfc, which provides
1839 more data than the default configuration, but can have more overhead and
1840 impact performance.
1841 Use this configuration for short periods of time when more information
1842 is needed.
1843 .RE
1844 .PP
1845 You can specify values for multiple parameters by separating them with a
1846 comma.
1847 .RE
1848 .TP
1849 .B \f[CB]\-XX:ThreadStackSize=\f[R]\f[I]size\f[R]
1850 Sets the Java thread stack size (in kilobytes).
1851 Use of a scaling suffix, such as \f[CB]k\f[R], results in the scaling of
1852 the kilobytes value so that \f[CB]\-XX:ThreadStackSize=1k\f[R] sets the
1853 Java thread stack size\ to 1024*1024 bytes or 1 megabyte.
1854 The default value depends on the platform:
1855 .RS
1856 .IP \[bu] 2
1857 Linux/x64 (64\-bit): 1024 KB
1858 .IP \[bu] 2
1859 macOS (64\-bit): 1024 KB
1860 .IP \[bu] 2
1861 Oracle Solaris (64\-bit): 1024 KB
1862 .IP \[bu] 2
1863 Windows: The default value depends on virtual memory
1864 .PP
1865 The following examples show how to set the thread stack size to 1
1866 megabyte in different units:
1867 .IP
1868 .nf
1869 \f[CB]
1870 \-XX:ThreadStackSize=1k
1871 \-XX:ThreadStackSize=1024
1872 \f[R]
1873 .fi
1874 .PP
1875 This option is similar to \f[CB]\-Xss\f[R].
1876 .RE
1877 .TP
1878 .B \f[CB]\-XX:\-UseBiasedLocking\f[R]
1879 Disables the use of biased locking.
1880 Some applications with significant amounts of uncontended
1881 synchronization may attain significant speedups with this flag enabled,
1882 but applications with certain patterns of locking may see slowdowns.
1883 \&.
1884 .RS
1885 .PP
1886 By default, this option is enabled.
1887 .RE
1888 .TP
1889 .B \f[CB]\-XX:\-UseCompressedOops\f[R]
1890 Disables the use of compressed pointers.
1891 By default, this option is enabled, and compressed pointers are used
1892 when Java heap sizes are less than 32 GB.
1893 When this option is enabled, object references are represented as
1894 32\-bit offsets instead of 64\-bit pointers, which typically increases
1895 performance when running the application with Java heap sizes of less
1896 than 32 GB.
1897 This option works only for 64\-bit JVMs.
1898 .RS
1899 .PP
1900 It\[aq]s also possible to use compressed pointers when Java heap sizes
1901 are greater than 32 GB.
1902 See the \f[CB]\-XX:ObjectAlignmentInBytes\f[R] option.
1903 .RE
1904 .TP
1905 .B \f[CB]\-XX:\-UseContainerSupport\f[R]
1906 The VM now provides automatic container detection support, which allows
1907 the VM to determine the amount of memory and number of processors that
1908 are available to a Java process running in docker containers.
1909 It uses this information to allocate system resources.
1910 This support is only available on Linux x64 platforms.
1911 \ If supported, the default for this flag is\ \f[CB]true\f[R], and
1912 container support is enabled by default.
1913 \ It\ can be disabled with\ \f[CB]\-XX:\-UseContainerSupport\f[R].
1914 .RS
1915 .PP
1916 Unified Logging is available to help to diagnose issues related to this
1917 support.
1918 .PP
1919 Use \f[CB]\-Xlog:os+container=trace\f[R] for maximum logging of container
1920 information.
1921 See \f[B]Enable Logging with the JVM Unified Logging Framework\f[R] for a
1922 description of using Unified Logging.
1923 .RE
1924 .TP
1925 .B \f[CB]\-XX:+UseHugeTLBFS\f[R]
1926 \f[B]Linux only:\f[R] This option is the equivalent of specifying
1927 \f[CB]\-XX:+UseLargePages\f[R].
1928 This option is disabled by default.
1929 This option pre\-allocates all large pages up\-front, when memory is
1930 reserved; consequently the JVM can\[aq]t dynamically grow or shrink
1931 large pages memory areas; see \f[CB]\-XX:UseTransparentHugePages\f[R] if
1932 you want this behavior.
1933 .RS
1934 .PP
1935 See \f[B]Large Pages\f[R].
1936 .RE
1937 .TP
1938 .B \f[CB]\-XX:+UseLargePages\f[R]
1939 Enables the use of large page memory.
1940 By default, this option is disabled and large page memory isn\[aq]t
1941 used.
1942 .RS
1943 .PP
1944 See \f[B]Large Pages\f[R].
1945 .RE
1946 .TP
1947 .B \f[CB]\-XX:+UseTransparentHugePages\f[R]
1948 \f[B]Linux only:\f[R] Enables the use of large pages that can dynamically
1949 grow or shrink.
1950 This option is disabled by default.
1951 You may encounter performance problems with transparent huge pages as
1952 the OS moves other pages around to create huge pages; this option is
1953 made available for experimentation.
1954 .RS
1955 .RE
1956 .TP
1957 .B \f[CB]\-XX:+AllowUserSignalHandlers\f[R]
1958 Enables installation of signal handlers by the application.
1959 By default, this option is disabled and the application isn\[aq]t
1960 allowed to install signal handlers.
1961 .RS
1962 .RE
1963 .TP
1964 .B \f[CB]\-XX:VMOptionsFile=\f[R]\f[I]filename\f[R]
1965 Allows user to specify VM options in a file, for example,
1966 \f[CB]java\ \-XX:VMOptionsFile=/var/my_vm_options\ HelloWorld\f[R].
1967 .RS
1968 .RE
1969 .SH ADVANCED JIT COMPILER OPTIONS FOR JAVA
1970 .PP
1971 These \f[CB]java\f[R] options control the dynamic just\-in\-time (JIT)
1972 compilation performed by the Java HotSpot VM.
1973 .TP
1974 .B \f[CB]\-XX:AllocateInstancePrefetchLines=\f[R]\f[I]lines\f[R]
1975 Sets the number of lines to prefetch ahead of the instance allocation
1976 pointer.
1977 By default, the number of lines to prefetch is set to 1:
1978 .RS
1979 .RS
1980 .PP
1981 \f[CB]\-XX:AllocateInstancePrefetchLines=1\f[R]
1982 .RE
1983 .PP
1984 Only the Java HotSpot Server VM supports this option.
1985 .RE
1986 .TP
1987 .B \f[CB]\-XX:AllocatePrefetchDistance=\f[R]\f[I]size\f[R]
1988 Sets the size (in bytes) of the prefetch distance for object allocation.
1989 Memory about to be written with the value of new objects is prefetched
1990 up to this distance starting from the address of the last allocated
1991 object.
1992 Each Java thread has its own allocation point.
1993 .RS
1994 .PP
1995 Negative values denote that prefetch distance is chosen based on the
1996 platform.
1997 Positive values are bytes to prefetch.
1998 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
1999 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
2000 \f[CB]G\f[R] to indicate gigabytes.
2001 The default value is set to \-1.
2002 .PP
2003 The following example shows how to set the prefetch distance to 1024
2004 bytes:
2005 .RS
2006 .PP
2007 \f[CB]\-XX:AllocatePrefetchDistance=1024\f[R]
2008 .RE
2009 .PP
2010 Only the Java HotSpot Server VM supports this option.
2011 .RE
2012 .TP
2013 .B \f[CB]\-XX:AllocatePrefetchInstr=\f[R]\f[I]instruction\f[R]
2014 Sets the prefetch instruction to prefetch ahead of the allocation
2015 pointer.
2016 Only the Java HotSpot Server VM supports this option.
2017 Possible values are from 0 to 3.
2018 The actual instructions behind the values depend on the platform.
2019 By default, the prefetch instruction is set to 0:
2020 .RS
2021 .RS
2022 .PP
2023 \f[CB]\-XX:AllocatePrefetchInstr=0\f[R]
2024 .RE
2025 .PP
2026 Only the Java HotSpot Server VM supports this option.
2027 .RE
2028 .TP
2029 .B \f[CB]\-XX:AllocatePrefetchLines=\f[R]\f[I]lines\f[R]
2030 Sets the number of cache lines to load after the last object allocation
2031 by using the prefetch instructions generated in compiled code.
2032 The default value is 1 if the last allocated object was an instance, and
2033 3 if it was an array.
2034 .RS
2035 .PP
2036 The following example shows how to set the number of loaded cache lines
2037 to 5:
2038 .RS
2039 .PP
2040 \f[CB]\-XX:AllocatePrefetchLines=5\f[R]
2041 .RE
2042 .PP
2043 Only the Java HotSpot Server VM supports this option.
2044 .RE
2045 .TP
2046 .B \f[CB]\-XX:AllocatePrefetchStepSize=\f[R]\f[I]size\f[R]
2047 Sets the step size (in bytes) for sequential prefetch instructions.
2048 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
2049 \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]
2050 to indicate gigabytes.
2051 By default, the step size is set to 16 bytes:
2052 .RS
2053 .RS
2054 .PP
2055 \f[CB]\-XX:AllocatePrefetchStepSize=16\f[R]
2056 .RE
2057 .PP
2058 Only the Java HotSpot Server VM supports this option.
2059 .RE
2060 .TP
2061 .B \f[CB]\-XX:AllocatePrefetchStyle=\f[R]\f[I]style\f[R]
2062 Sets the generated code style for prefetch instructions.
2063 The \f[I]style\f[R] argument is an integer from 0 to 3:
2064 .RS
2065 .TP
2066 .B \f[CB]0\f[R]
2067 Don\[aq]t generate prefetch instructions.
2068 .RS
2069 .RE
2070 .TP
2071 .B \f[CB]1\f[R]
2072 Execute prefetch instructions after each allocation.
2073 This is the default parameter.
2074 .RS
2075 .RE
2076 .TP
2077 .B \f[CB]2\f[R]
2078 Use the thread\-local allocation block (TLAB) watermark pointer to
2079 determine when prefetch instructions are executed.
2080 .RS
2081 .RE
2082 .TP
2083 .B \f[CB]3\f[R]
2084 Use BIS instruction on SPARC for allocation prefetch.
2085 .RS
2086 .RE
2087 .PP
2088 Only the Java HotSpot Server VM supports this option.
2089 .RE
2090 .TP
2091 .B \f[CB]\-XX:+BackgroundCompilation\f[R]
2092 Enables background compilation.
2093 This option is enabled by default.
2094 To disable background compilation, specify
2095 \f[CB]\-XX:\-BackgroundCompilation\f[R] (this is equivalent to specifying
2096 \f[CB]\-Xbatch\f[R]).
2097 .RS
2098 .RE
2099 .TP
2100 .B \f[CB]\-XX:CICompilerCount=\f[R]\f[I]threads\f[R]
2101 Sets the number of compiler threads to use for compilation.
2102 By default, the number of threads is set to 2 for the server JVM, to 1
2103 for the client JVM, and it scales to the number of cores if tiered
2104 compilation is used.
2105 The following example shows how to set the number of threads to 2:
2106 .RS
2107 .RS
2108 .PP
2109 \f[CB]\-XX:CICompilerCount=2\f[R]
2110 .RE
2111 .RE
2112 .TP
2113 .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]]
2114 Specifies a \f[I]command\f[R] to perform on a \f[I]method\f[R].
2115 For example, to exclude the \f[CB]indexOf()\f[R] method of the
2116 \f[CB]String\f[R] class from being compiled, use the following:
2117 .RS
2118 .RS
2119 .PP
2120 \f[CB]\-XX:CompileCommand=exclude,java/lang/String.indexOf\f[R]
2121 .RE
2122 .PP
2123 Note that the full class name is specified, including all packages and
2124 subpackages separated by a slash (\f[CB]/\f[R]).
2125 For easier cut\-and\-paste operations, it\[aq]s also possible to use the
2126 method name format produced by the \f[CB]\-XX:+PrintCompilation\f[R] and
2127 \f[CB]\-XX:+LogCompilation\f[R] options:
2128 .RS
2129 .PP
2130 \f[CB]\-XX:CompileCommand=exclude,java.lang.String::indexOf\f[R]
2131 .RE
2132 .PP
2133 If the method is specified without the signature, then the command is
2134 applied to all methods with the specified name.
2135 However, you can also specify the signature of the method in the class
2136 file format.
2137 In this case, you should enclose the arguments in quotation marks,
2138 because otherwise the shell treats the semicolon as a command end.
2139 For example, if you want to exclude only the \f[CB]indexOf(String)\f[R]
2140 method of the \f[CB]String\f[R] class from being compiled, use the
2141 following:
2142 .RS
2143 .PP
2144 \f[CB]\-XX:CompileCommand="exclude,java/lang/String.indexOf,(Ljava/lang/String;)I"\f[R]
2145 .RE
2146 .PP
2147 You can also use the asterisk (*) as a wildcard for class and method
2148 names.
2149 For example, to exclude all \f[CB]indexOf()\f[R] methods in all classes
2150 from being compiled, use the following:
2151 .RS
2152 .PP
2153 \f[CB]\-XX:CompileCommand=exclude,*.indexOf\f[R]
2154 .RE
2155 .PP
2156 The commas and periods are aliases for spaces, making it easier to pass
2157 compiler commands through a shell.
2158 You can pass arguments to \f[CB]\-XX:CompileCommand\f[R] using spaces as
2159 separators by enclosing the argument in quotation marks:
2160 .RS
2161 .PP
2162 \f[CB]\-XX:CompileCommand="exclude\ java/lang/String\ indexOf"\f[R]
2163 .RE
2164 .PP
2165 Note that after parsing the commands passed on the command line using
2166 the \f[CB]\-XX:CompileCommand\f[R] options, the JIT compiler then reads
2167 commands from the \f[CB]\&.hotspot_compiler\f[R] file.
2168 You can add commands to this file or specify a different file using the
2169 \f[CB]\-XX:CompileCommandFile\f[R] option.
2170 .PP
2171 To add several commands, either specify the \f[CB]\-XX:CompileCommand\f[R]
2172 option multiple times, or separate each argument with the new line
2173 separator (\f[CB]\\n\f[R]).
2174 The following commands are available:
2175 .TP
2176 .B \f[CB]break\f[R]
2177 Sets a breakpoint when debugging the JVM to stop at the beginning of
2178 compilation of the specified method.
2179 .RS
2180 .RE
2181 .TP
2182 .B \f[CB]compileonly\f[R]
2183 Excludes all methods from compilation except for the specified method.
2184 As an alternative, you can use the \f[CB]\-XX:CompileOnly\f[R] option,
2185 which lets you specify several methods.
2186 .RS
2187 .RE
2188 .TP
2189 .B \f[CB]dontinline\f[R]
2190 Prevents inlining of the specified method.
2191 .RS
2192 .RE
2193 .TP
2194 .B \f[CB]exclude\f[R]
2195 Excludes the specified method from compilation.
2196 .RS
2197 .RE
2198 .TP
2199 .B \f[CB]help\f[R]
2200 Prints a help message for the \f[CB]\-XX:CompileCommand\f[R] option.
2201 .RS
2202 .RE
2203 .TP
2204 .B \f[CB]inline\f[R]
2205 Attempts to inline the specified method.
2206 .RS
2207 .RE
2208 .TP
2209 .B \f[CB]log\f[R]
2210 Excludes compilation logging (with the \f[CB]\-XX:+LogCompilation\f[R]
2211 option) for all methods except for the specified method.
2212 By default, logging is performed for all compiled methods.
2213 .RS
2214 .RE
2215 .TP
2216 .B \f[CB]option\f[R]
2217 Passes a JIT compilation option to the specified method in place of the
2218 last argument (\f[CB]option\f[R]).
2219 The compilation option is set at the end, after the method name.
2220 For example, to enable the \f[CB]BlockLayoutByFrequency\f[R] option for
2221 the \f[CB]append()\f[R] method of the \f[CB]StringBuffer\f[R] class, use the
2222 following:
2223 .RS
2224 .RS
2225 .PP
2226 \f[CB]\-XX:CompileCommand=option,java/lang/StringBuffer.append,BlockLayoutByFrequency\f[R]
2227 .RE
2228 .PP
2229 You can specify multiple compilation options, separated by commas or
2230 spaces.
2231 .RE
2232 .TP
2233 .B \f[CB]print\f[R]
2234 Prints generated assembler code after compilation of the specified
2235 method.
2236 .RS
2237 .RE
2238 .TP
2239 .B \f[CB]quiet\f[R]
2240 Instructs not to print the compile commands.
2241 By default, the commands that you specify with the
2242 \f[CB]\-XX:CompileCommand\f[R] option are printed; for example, if you
2243 exclude from compilation the \f[CB]indexOf()\f[R] method of the
2244 \f[CB]String\f[R] class, then the following is printed to standard output:
2245 .RS
2246 .RS
2247 .PP
2248 \f[CB]CompilerOracle:\ exclude\ java/lang/String.indexOf\f[R]
2249 .RE
2250 .PP
2251 You can suppress this by specifying the
2252 \f[CB]\-XX:CompileCommand=quiet\f[R] option before other
2253 \f[CB]\-XX:CompileCommand\f[R] options.
2254 .RE
2255 .RE
2256 .TP
2257 .B \f[CB]\-XX:CompileCommandFile=\f[R]\f[I]filename\f[R]
2258 Sets the file from which JIT compiler commands are read.
2259 By default, the \f[CB]\&.hotspot_compiler\f[R] file is used to store
2260 commands performed by the JIT compiler.
2261 .RS
2262 .PP
2263 Each line in the command file represents a command, a class name, and a
2264 method name for which the command is used.
2265 For example, this line prints assembly code for the \f[CB]toString()\f[R]
2266 method of the \f[CB]String\f[R] class:
2267 .RS
2268 .PP
2269 \f[CB]print\ java/lang/String\ toString\f[R]
2270 .RE
2271 .PP
2272 If you\[aq]re using commands for the JIT compiler to perform on methods,
2273 then see the \f[CB]\-XX:CompileCommand\f[R] option.
2274 .RE
2275 .TP
2276 .B \f[CB]\-XX:CompilerDirectivesFile=\f[R]\f[I]file\f[R]
2277 Adds directives from a file to the directives stack when a program
2278 starts.
2279 See \f[B]Compiler Control\f[R]
2280 [https://docs.oracle.com/en/java/javase/12/vm/compiler\-control1.html#GUID\-94AD8194\-786A\-4F19\-BFFF\-278F8E237F3A].
2281 .RS
2282 .PP
2283 The \f[CB]\-XX:CompilerDirectivesFile\f[R] option has to be used together
2284 with the \f[CB]\-XX:UnlockDiagnosticVMOptions\f[R] option that unlocks
2285 diagnostic JVM options.
2286 .RE
2287 .TP
2288 .B \f[CB]\-XX:+CompilerDirectivesPrint\f[R]
2289 Prints the directives stack when the program starts or when a new
2290 directive is added.
2291 .RS
2292 .PP
2293 The \f[CB]\-XX:+CompilerDirectivesPrint\f[R] option has to be used
2294 together with the \f[CB]\-XX:UnlockDiagnosticVMOptions\f[R] option that
2295 unlocks diagnostic JVM options.
2296 .RE
2297 .TP
2298 .B \f[CB]\-XX:CompileOnly=\f[R]\f[I]methods\f[R]
2299 Sets the list of methods (separated by commas) to which compilation
2300 should be restricted.
2301 Only the specified methods are compiled.
2302 Specify each method with the full class name (including the packages and
2303 subpackages).
2304 For example, to compile only the \f[CB]length()\f[R] method of the
2305 \f[CB]String\f[R] class and the \f[CB]size()\f[R] method of the
2306 \f[CB]List\f[R] class, use the following:
2307 .RS
2308 .RS
2309 .PP
2310 \f[CB]\-XX:CompileOnly=java/lang/String.length,java/util/List.size\f[R]
2311 .RE
2312 .PP
2313 Note that the full class name is specified, including all packages and
2314 subpackages separated by a slash (\f[CB]/\f[R]).
2315 For easier cut and paste operations, it\[aq]s also possible to use the
2316 method name format produced by the \f[CB]\-XX:+PrintCompilation\f[R] and
2317 \f[CB]\-XX:+LogCompilation\f[R] options:
2318 .RS
2319 .PP
2320 \f[CB]\-XX:CompileOnly=java.lang.String::length,java.util.List::size\f[R]
2321 .RE
2322 .PP
2323 Although wildcards aren\[aq]t supported, you can specify only the class
2324 or package name to compile all methods in that class or package, as well
2325 as specify just the method to compile methods with this name in any
2326 class:
2327 .IP
2328 .nf
2329 \f[CB]
2330 \-XX:CompileOnly=java/lang/String
2331 \-XX:CompileOnly=java/lang
2332 \-XX:CompileOnly=.length
2333 \f[R]
2334 .fi
2335 .RE
2336 .TP
2337 .B \f[CB]\-XX:CompileThreshold=\f[R]\f[I]invocations\f[R]
2338 Sets the number of interpreted method invocations before compilation.
2339 By default, in the server JVM, the JIT compiler performs 10,000
2340 interpreted method invocations to gather information for efficient
2341 compilation.
2342 For the client JVM, the default setting is 1,500 invocations.
2343 This option is ignored when tiered compilation is enabled; see the
2344 option \f[CB]\-XX:\-TieredCompilation\f[R].
2345 The following example shows how to set the number of interpreted method
2346 invocations to 5,000:
2347 .RS
2348 .RS
2349 .PP
2350 \f[CB]\-XX:CompileThreshold=5000\f[R]
2351 .RE
2352 .PP
2353 You can completely disable interpretation of Java methods before
2354 compilation by specifying the \f[CB]\-Xcomp\f[R] option.
2355 .RE
2356 .TP
2357 .B \f[CB]\-XX:CompileThresholdScaling=\f[R]\f[I]scale\f[R]
2358 Provides unified control of first compilation.
2359 This option controls when methods are first compiled for both the tiered
2360 and the nontiered modes of operation.
2361 The \f[CB]CompileThresholdScaling\f[R] option has an integer value between
2362 0 and +Inf and scales the thresholds corresponding to the current mode
2363 of operation (both tiered and nontiered).
2364 Setting \f[CB]CompileThresholdScaling\f[R] to a value less than 1.0
2365 results in earlier compilation while values greater than 1.0 delay
2366 compilation.
2367 Setting \f[CB]CompileThresholdScaling\f[R] to 0 is equivalent to disabling
2368 compilation.
2369 .RS
2370 .RE
2371 .TP
2372 .B \f[CB]\-XX:+DoEscapeAnalysis\f[R]
2373 Enables the use of escape analysis.
2374 This option is enabled by default.
2375 To disable the use of escape analysis, specify
2376 \f[CB]\-XX:\-DoEscapeAnalysis\f[R].
2377 Only the Java HotSpot Server VM supports this option.
2378 .RS
2379 .RE
2380 .TP
2381 .B \f[CB]\-XX:InitialCodeCacheSize=\f[R]\f[I]size\f[R]
2382 Sets the initial code cache size (in bytes).
2383 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
2384 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
2385 \f[CB]G\f[R] to indicate gigabytes.
2386 The default value is set to 500 KB.
2387 The initial code cache size shouldn\[aq]t be less than the system\[aq]s
2388 minimal memory page size.
2389 The following example shows how to set the initial code cache size to 32
2390 KB:
2391 .RS
2392 .RS
2393 .PP
2394 \f[CB]\-XX:InitialCodeCacheSize=32k\f[R]
2395 .RE
2396 .RE
2397 .TP
2398 .B \f[CB]\-XX:+Inline\f[R]
2399 Enables method inlining.
2400 This option is enabled by default to increase performance.
2401 To disable method inlining, specify \f[CB]\-XX:\-Inline\f[R].
2402 .RS
2403 .RE
2404 .TP
2405 .B \f[CB]\-XX:InlineSmallCode=\f[R]\f[I]size\f[R]
2406 Sets the maximum code size (in bytes) for compiled methods that should
2407 be inlined.
2408 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
2409 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
2410 \f[CB]G\f[R] to indicate gigabytes.
2411 Only compiled methods with the size smaller than the specified size is
2412 inlined.
2413 By default, the maximum code size is set to 1000 bytes:
2414 .RS
2415 .RS
2416 .PP
2417 \f[CB]\-XX:InlineSmallCode=1000\f[R]
2418 .RE
2419 .RE
2420 .TP
2421 .B \f[CB]\-XX:+LogCompilation\f[R]
2422 Enables logging of compilation activity to a file named
2423 \f[CB]hotspot.log\f[R] in the current working directory.
2424 You can specify a different log file path and name using the
2425 \f[CB]\-XX:LogFile\f[R] option.
2426 .RS
2427 .PP
2428 By default, this option is disabled and compilation activity isn\[aq]t
2429 logged.
2430 The \f[CB]\-XX:+LogCompilation\f[R] option has to be used together with
2431 the \f[CB]\-XX:UnlockDiagnosticVMOptions\f[R] option that unlocks
2432 diagnostic JVM options.
2433 .PP
2434 You can enable verbose diagnostic output with a message printed to the
2435 console every time a method is compiled by using the
2436 \f[CB]\-XX:+PrintCompilation\f[R] option.
2437 .RE
2438 .TP
2439 .B \f[CB]\-XX:MaxInlineSize=\f[R]\f[I]size\f[R]
2440 Sets the maximum bytecode size (in bytes) of a method to be inlined.
2441 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
2442 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
2443 \f[CB]G\f[R] to indicate gigabytes.
2444 By default, the maximum bytecode size is set to 35 bytes:
2445 .RS
2446 .RS
2447 .PP
2448 \f[CB]\-XX:MaxInlineSize=35\f[R]
2449 .RE
2450 .RE
2451 .TP
2452 .B \f[CB]\-XX:MaxNodeLimit=\f[R]\f[I]nodes\f[R]
2453 Sets the maximum number of nodes to be used during single method
2454 compilation.
2455 By default, the maximum number of nodes is set to 65,000:
2456 .RS
2457 .RS
2458 .PP
2459 \f[CB]\-XX:MaxNodeLimit=65000\f[R]
2460 .RE
2461 .RE
2462 .TP
2463 .B \f[CB]\-XX:NonNMethodCodeHeapSize=\f[R]\f[I]size\f[R]
2464 Sets the size in bytes of the code segment containing nonmethod code.
2465 .RS
2466 .PP
2467 A nonmethod code segment containing nonmethod code, such as compiler
2468 buffers and the bytecode interpreter.
2469 This code type stays in the code cache forever.
2470 This flag is used only if \f[CB]\-XX:SegmentedCodeCache\f[R] is enabled.
2471 .RE
2472 .TP
2473 .B \f[CB]\-XX:NonProfiledCodeHeapSize=\f[R]\f[I]size\f[R]
2474 Sets the size in bytes of the code segment containing nonprofiled
2475 methods.
2476 This flag is used only if \f[CB]\-XX:SegmentedCodeCache\f[R] is enabled.
2477 .RS
2478 .RE
2479 .TP
2480 .B \f[CB]\-XX:MaxTrivialSize=\f[R]\f[I]size\f[R]
2481 Sets the maximum bytecode size (in bytes) of a trivial method to be
2482 inlined.
2483 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
2484 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
2485 \f[CB]G\f[R] to indicate gigabytes.
2486 By default, the maximum bytecode size of a trivial method is set to 6
2487 bytes:
2488 .RS
2489 .RS
2490 .PP
2491 \f[CB]\-XX:MaxTrivialSize=6\f[R]
2492 .RE
2493 .RE
2494 .TP
2495 .B \f[CB]\-XX:+OptimizeStringConcat\f[R]
2496 Enables the optimization of \f[CB]String\f[R] concatenation operations.
2497 This option is enabled by default.
2498 To disable the optimization of \f[CB]String\f[R] concatenation operations,
2499 specify \f[CB]\-XX:\-OptimizeStringConcat\f[R].
2500 Only the Java HotSpot Server VM supports this option.
2501 .RS
2502 .RE
2503 .TP
2504 .B \f[CB]\-XX:+PrintAssembly\f[R]
2505 Enables printing of assembly code for bytecoded and native methods by
2506 using the external \f[CB]hsdis\-<arch>.so\f[R] or \f[CB]\&.dll\f[R] library.
2507 For 64\-bit VM on Windows, it\[aq]s \f[CB]hsdis\-amd64.dll\f[R].
2508 This lets you to see the generated code, which may help you to diagnose
2509 performance issues.
2510 .RS
2511 .PP
2512 By default, this option is disabled and assembly code isn\[aq]t printed.
2513 The \f[CB]\-XX:+PrintAssembly\f[R] option has to be used together with the
2514 \f[CB]\-XX:UnlockDiagnosticVMOptions\f[R] option that unlocks diagnostic
2515 JVM options.
2516 .RE
2517 .TP
2518 .B \f[CB]\-XX:ProfiledCodeHeapSize=\f[R]\f[I]size\f[R]
2519 Sets the size in bytes of the code segment containing profiled methods.
2520 This flag is used only if \f[CB]\-XX:SegmentedCodeCache\f[R] is enabled.
2521 .RS
2522 .RE
2523 .TP
2524 .B \f[CB]\-XX:+PrintCompilation\f[R]
2525 Enables verbose diagnostic output from the JVM by printing a message to
2526 the console every time a method is compiled.
2527 This lets you to see which methods actually get compiled.
2528 By default, this option is disabled and diagnostic output isn\[aq]t
2529 printed.
2530 .RS
2531 .PP
2532 You can also log compilation activity to a file by using the
2533 \f[CB]\-XX:+LogCompilation\f[R] option.
2534 .RE
2535 .TP
2536 .B \f[CB]\-XX:+PrintInlining\f[R]
2537 Enables printing of inlining decisions.
2538 This let\[aq]s you see which methods are getting inlined.
2539 .RS
2540 .PP
2541 By default, this option is disabled and inlining information isn\[aq]t
2542 printed.
2543 The \f[CB]\-XX:+PrintInlining\f[R] option has to be used together with the
2544 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R] option that unlocks diagnostic
2545 JVM options.
2546 .RE
2547 .TP
2548 .B \f[CB]\-XX:ReservedCodeCacheSize=\f[R]\f[I]size\f[R]
2549 Sets the maximum code cache size (in bytes) for JIT\-compiled code.
2550 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
2551 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
2552 \f[CB]G\f[R] to indicate gigabytes.
2553 The default maximum code cache size is 240 MB; if you disable tiered
2554 compilation with the option \f[CB]\-XX:\-TieredCompilation\f[R], then the
2555 default size is 48 MB.
2556 This option has a limit of 2 GB; otherwise, an error is generated.
2557 The maximum code cache size shouldn\[aq]t be less than the initial code
2558 cache size; see the option \f[CB]\-XX:InitialCodeCacheSize\f[R].
2559 .RS
2560 .RE
2561 .TP
2562 .B \f[CB]\-XX:RTMAbortRatio=\f[R]\f[I]abort_ratio\f[R]
2563 Specifies the RTM abort ratio is specified as a percentage (%) of all
2564 executed RTM transactions.
2565 If a number of aborted transactions becomes greater than this ratio,
2566 then the compiled code is deoptimized.
2567 This ratio is used when the \f[CB]\-XX:+UseRTMDeopt\f[R] option is
2568 enabled.
2569 The default value of this option is 50.
2570 This means that the compiled code is deoptimized if 50% of all
2571 transactions are aborted.
2572 .RS
2573 .RE
2574 .TP
2575 .B \f[CB]\-XX:RTMRetryCount=\f[R]\f[I]number_of_retries\f[R]
2576 Specifies the number of times that the RTM locking code is retried, when
2577 it is aborted or busy, before falling back to the normal locking
2578 mechanism.
2579 The default value for this option is 5.
2580 The \f[CB]\-XX:UseRTMLocking\f[R] option must be enabled.
2581 .RS
2582 .RE
2583 .TP
2584 .B \f[CB]\-XX:+SegmentedCodeCache\f[R]
2585 Enables segmentation of the code cache.
2586 Without the \f[CB]\-XX:+SegmentedCodeCache\f[R], the code cache consists
2587 of one large segment.
2588 With \f[CB]\-XX:+SegmentedCodeCache\f[R], we have separate segments for
2589 nonmethod, profiled method, and nonprofiled method code.
2590 These segments aren\[aq]t resized at runtime.
2591 The feature is enabled by default if tiered compilation is enabled
2592 (\f[CB]\-XX:+TieredCompilation\f[R] ) and
2593 \f[CB]\-XX:ReservedCodeCacheSize\f[R] >= 240 MB.
2594 The advantages are better control of the memory footprint, reduced code
2595 fragmentation, and better iTLB/iCache behavior due to improved locality.
2596 iTLB/iCache is a CPU\-specific term meaning Instruction Translation
2597 Lookaside Buffer (ITLB).
2598 ICache is an instruction cache in theCPU.
2599 The implementation of the code cache can be found in the file:
2600 \f[CB]/share/vm/code/codeCache.cpp\f[R].
2601 .RS
2602 .RE
2603 .TP
2604 .B \f[CB]\-XX:StartAggressiveSweepingAt=\f[R]\f[I]percent\f[R]
2605 Forces stack scanning of active methods to aggressively remove unused
2606 code when only the given percentage of the code cache is free.
2607 The default value is 10%.
2608 .RS
2609 .RE
2610 .TP
2611 .B \f[CB]\-XX:\-TieredCompilation\f[R]
2612 Disables the use of tiered compilation.
2613 By default, this option is enabled.
2614 Only the Java HotSpot Server VM supports this option.
2615 .RS
2616 .RE
2617 .TP
2618 .B \f[CB]\-XX:+UseAES\f[R]
2619 Enables hardware\-based AES intrinsics for Intel, AMD, and SPARC
2620 hardware.
2621 Intel Westmere (2010 and newer), AMD Bulldozer (2011 and newer), and
2622 SPARC (T4 and newer) are the supported hardware.
2623 The \f[CB]\-XX:+UseAES\f[R] is used in conjunction with UseAESIntrinsics.
2624 Flags that control intrinsics now require the option
2625 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2626 .RS
2627 .RE
2628 .TP
2629 .B \f[CB]\-XX:+UseAESIntrinsics\f[R]
2630 Enables \f[CB]\-XX:+UseAES\f[R] and \f[CB]\-XX:+UseAESIntrinsics\f[R] flags
2631 by default and are supported only for the Java HotSpot Server VM.
2632 To disable hardware\-based AES intrinsics, specify
2633 \f[CB]\-XX:\-UseAES\ \-XX:\-UseAESIntrinsics\f[R].
2634 For example, to enable hardware AES, use the following flags:
2635 .RS
2636 .RS
2637 .PP
2638 \f[CB]\-XX:+UseAES\ \-XX:+UseAESIntrinsics\f[R]
2639 .RE
2640 .PP
2641 Flags that control intrinsics now require the option
2642 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2643 To support UseAES and UseAESIntrinsics flags, use the \f[CB]\-server\f[R]
2644 option to select the Java HotSpot Server VM.
2645 These flags aren\[aq]t supported on Client VM.
2646 .RE
2647 .TP
2648 .B \f[CB]\-XX:+UseCMoveUnconditionally\f[R]
2649 Generates CMove (scalar and vector) instructions regardless of
2650 profitability analysis.
2651 .RS
2652 .RE
2653 .TP
2654 .B \f[CB]\-XX:+UseCodeCacheFlushing\f[R]
2655 Enables flushing of the code cache before shutting down the compiler.
2656 This option is enabled by default.
2657 To disable flushing of the code cache before shutting down the compiler,
2658 specify \f[CB]\-XX:\-UseCodeCacheFlushing\f[R].
2659 .RS
2660 .RE
2661 .TP
2662 .B \f[CB]\-XX:+UseCondCardMark\f[R]
2663 Enables checking if the card is already marked before updating the card
2664 table.
2665 This option is disabled by default.
2666 It should be used only on machines with multiple sockets, where it
2667 increases the performance of Java applications that rely on concurrent
2668 operations.
2669 Only the Java HotSpot Server VM supports this option.
2670 .RS
2671 .RE
2672 .TP
2673 .B \f[CB]\-XX:+UseCountedLoopSafepoints\f[R]
2674 Keeps safepoints in counted loops.
2675 Its default value is false.\ 
2676 .RS
2677 .RE
2678 .TP
2679 .B \f[CB]\-XX:+UseFMA\f[R]
2680 Enables hardware\-based FMA intrinsics for hardware where FMA
2681 instructions are available (such as, Intel, SPARC, and ARM64).
2682 FMA intrinsics are generated for the
2683 \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]
2684 \f[I]c\f[R]\f[CB])\f[R] methods that calculate the value of \f[CB](\f[R]
2685 \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]
2686 expressions.
2687 .RS
2688 .RE
2689 .TP
2690 .B \f[CB]\-XX:+UseRTMDeopt\f[R]
2691 Autotunes RTM locking depending on the abort ratio.
2692 This ratio is specified by the \f[CB]\-XX:RTMAbortRatio\f[R] option.
2693 If the number of aborted transactions exceeds the abort ratio, then the
2694 method containing the lock is deoptimized and recompiled with all locks
2695 as normal locks.
2696 This option is disabled by default.
2697 The \f[CB]\-XX:+UseRTMLocking\f[R] option must be enabled.
2698 .RS
2699 .RE
2700 .TP
2701 .B \f[CB]\-XX:+UseRTMLocking\f[R]
2702 Generates Restricted Transactional Memory (RTM) locking code for all
2703 inflated locks, with the normal locking mechanism as the fallback
2704 handler.
2705 This option is disabled by default.
2706 Options related to RTM are available only for the Java HotSpot Server VM
2707 on x86 CPUs that support Transactional Synchronization Extensions (TSX).
2708 .RS
2709 .PP
2710 RTM is part of Intel\[aq]s TSX, which is an x86 instruction set
2711 extension and facilitates the creation of multithreaded applications.
2712 RTM introduces the new instructions \f[CB]XBEGIN\f[R], \f[CB]XABORT\f[R],
2713 \f[CB]XEND\f[R], and \f[CB]XTEST\f[R].
2714 The \f[CB]XBEGIN\f[R] and \f[CB]XEND\f[R] instructions enclose a set of
2715 instructions to run as a transaction.
2716 If no conflict is found when running the transaction, then the memory
2717 and register modifications are committed together at the \f[CB]XEND\f[R]
2718 instruction.
2719 The \f[CB]XABORT\f[R] instruction can be used to explicitly abort a
2720 transaction and the \f[CB]XEND\f[R] instruction checks if a set of
2721 instructions is being run in a transaction.
2722 .PP
2723 A lock on a transaction is inflated when another thread tries to access
2724 the same transaction, thereby blocking the thread that didn\[aq]t
2725 originally request access to the transaction.
2726 RTM requires that a fallback set of operations be specified in case a
2727 transaction aborts or fails.
2728 An RTM lock is a lock that has been delegated to the TSX\[aq]s system.
2729 .PP
2730 RTM improves performance for highly contended locks with low conflict in
2731 a critical region (which is code that must not be accessed by more than
2732 one thread concurrently).
2733 RTM also improves the performance of coarse\-grain locking, which
2734 typically doesn\[aq]t perform well in multithreaded applications.
2735 (Coarse\-grain locking is the strategy of holding locks for long periods
2736 to minimize the overhead of taking and releasing locks, while
2737 fine\-grained locking is the strategy of trying to achieve maximum
2738 parallelism by locking only when necessary and unlocking as soon as
2739 possible.) Also, for lightly contended locks that are used by different
2740 threads, RTM can reduce false cache line sharing, also known as cache
2741 line ping\-pong.
2742 This occurs when multiple threads from different processors are
2743 accessing different resources, but the resources share the same cache
2744 line.
2745 As a result, the processors repeatedly invalidate the cache lines of
2746 other processors, which forces them to read from main memory instead of
2747 their cache.
2748 .RE
2749 .TP
2750 .B \f[CB]\-XX:+UseSHA\f[R]
2751 Enables hardware\-based intrinsics for SHA crypto hash functions for
2752 SPARC hardware.
2753 The \f[CB]UseSHA\f[R] option is used in conjunction with the
2754 \f[CB]UseSHA1Intrinsics\f[R], \f[CB]UseSHA256Intrinsics\f[R], and
2755 \f[CB]UseSHA512Intrinsics\f[R] options.
2756 .RS
2757 .PP
2758 The \f[CB]UseSHA\f[R] and \f[CB]UseSHA*Intrinsics\f[R] flags are enabled by
2759 default, and are supported only for Java HotSpot Server VM 64\-bit on
2760 SPARC T4 and newer.
2761 .PP
2762 This feature is applicable only when using the
2763 \f[CB]sun.security.provider.Sun\f[R] provider for SHA operations.
2764 Flags that control intrinsics now require the option
2765 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2766 .PP
2767 To disable all hardware\-based SHA intrinsics, specify the
2768 \f[CB]\-XX:\-UseSHA\f[R].
2769 To disable only a particular SHA intrinsic, use the appropriate
2770 corresponding option.
2771 For example: \f[CB]\-XX:\-UseSHA256Intrinsics\f[R].
2772 .RE
2773 .TP
2774 .B \f[CB]\-XX:+UseSHA1Intrinsics\f[R]
2775 Enables intrinsics for SHA\-1 crypto hash function.
2776 Flags that control intrinsics now require the option
2777 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2778 .RS
2779 .RE
2780 .TP
2781 .B \f[CB]\-XX:+UseSHA256Intrinsics\f[R]
2782 Enables intrinsics for SHA\-224 and SHA\-256 crypto hash functions.
2783 Flags that control intrinsics now require the option
2784 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2785 .RS
2786 .RE
2787 .TP
2788 .B \f[CB]\-XX:+UseSHA512Intrinsics\f[R]
2789 Enables intrinsics for SHA\-384 and SHA\-512 crypto hash functions.
2790 Flags that control intrinsics now require the option
2791 \f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
2792 .RS
2793 .RE
2794 .TP
2795 .B \f[CB]\-XX:+UseSuperWord\f[R]
2796 Enables the transformation of scalar operations into superword
2797 operations.
2798 Superword is a vectorization optimization.
2799 This option is enabled by default.
2800 To disable the transformation of scalar operations into superword
2801 operations, specify \f[CB]\-XX:\-UseSuperWord\f[R].
2802 Only the Java HotSpot Server VM supports this option.
2803 .RS
2804 .RE
2805 .SH ADVANCED SERVICEABILITY OPTIONS FOR JAVA
2806 .PP
2807 These \f[CB]java\f[R] options provide the ability to gather system
2808 information and perform extensive debugging.
2809 .TP
2810 .B \f[CB]\-XX:+DisableAttachMechanism\f[R]
2811 Disables the mechanism that lets tools attach to the JVM.
2812 By default, this option is disabled, meaning that the attach mechanism
2813 is enabled and you can use diagnostics and troubleshooting tools such as
2814 \f[CB]jcmd\f[R], \f[CB]jstack\f[R], \f[CB]jmap\f[R], and \f[CB]jinfo\f[R].
2815 .RS
2816 .RS
2817 .PP
2818 \f[B]Note:\f[R] The tools such as \f[B]jcmd\f[R], \f[B]jinfo\f[R],
2819 \f[B]jmap\f[R], and \f[B]jstack\f[R] shipped with the JDK aren\[aq]t
2820 supported when using the tools from one JDK version to troubleshoot a
2821 different JDK version.
2822 .RE
2823 .RE
2824 .TP
2825 .B \f[CB]\-XX:+ExtendedDTraceProbes\f[R]
2826 \f[B]Oracle Solaris, Linux, and macOS:\f[R] Enables additional
2827 \f[CB]dtrace\f[R] tool probes that affect the performance.
2828 By default, this option is disabled and \f[CB]dtrace\f[R] performs only
2829 standard probes.
2830 .RS
2831 .RE
2832 .TP
2833 .B \f[CB]\-XX:+HeapDumpOnOutOfMemoryError\f[R]
2834 Enables the dumping of the Java heap to a file in the current directory
2835 by using the heap profiler (HPROF) when a
2836 \f[CB]java.lang.OutOfMemoryError\f[R] exception is thrown.
2837 You can explicitly set the heap dump file path and name using the
2838 \f[CB]\-XX:HeapDumpPath\f[R] option.
2839 By default, this option is disabled and the heap isn\[aq]t dumped when
2840 an \f[CB]OutOfMemoryError\f[R] exception is thrown.
2841 .RS
2842 .RE
2843 .TP
2844 .B \f[CB]\-XX:HeapDumpPath=path\f[R]
2845 Sets the path and file name for writing the heap dump provided by the
2846 heap profiler (HPROF) when the \f[CB]\-XX:+HeapDumpOnOutOfMemoryError\f[R]
2847 option is set.
2848 By default, the file is created in the current working directory, and
2849 it\[aq]s named \f[CB]java_pid<pid>.hprof\f[R] where \f[CB]<pid>\f[R] is the
2850 identifier of the process that caused the error.
2851 The following example shows how to set the default file explicitly
2852 (\f[CB]%p\f[R] represents the current process identifier):
2853 .RS
2854 .RS
2855 .PP
2856 \f[CB]\-XX:HeapDumpPath=./java_pid%p.hprof\f[R]
2857 .RE
2858 .IP \[bu] 2
2859 \f[B]Oracle Solaris, Linux, and macOS:\f[R] The following example shows
2860 how to set the heap dump file to
2861 \f[CB]/var/log/java/java_heapdump.hprof\f[R]:
2862 .RS 2
2863 .RS
2864 .PP
2865 \f[CB]\-XX:HeapDumpPath=/var/log/java/java_heapdump.hprof\f[R]
2866 .RE
2867 .RE
2868 .IP \[bu] 2
2869 \f[B]Windows:\f[R] The following example shows how to set the heap dump
2870 file to \f[CB]C:/log/java/java_heapdump.log\f[R]:
2871 .RS 2
2872 .RS
2873 .PP
2874 \f[CB]\-XX:HeapDumpPath=C:/log/java/java_heapdump.log\f[R]
2875 .RE
2876 .RE
2877 .RE
2878 .TP
2879 .B \f[CB]\-XX:LogFile=\f[R]\f[I]path\f[R]
2880 Sets the path and file name to where log data is written.
2881 By default, the file is created in the current working directory, and
2882 it\[aq]s named \f[CB]hotspot.log\f[R].
2883 .RS
2884 .IP \[bu] 2
2885 \f[B]Oracle Solaris, Linux, and macOS:\f[R] The following example shows
2886 how to set the log file to \f[CB]/var/log/java/hotspot.log\f[R]:
2887 .RS 2
2888 .RS
2889 .PP
2890 \f[CB]\-XX:LogFile=/var/log/java/hotspot.log\f[R]
2891 .RE
2892 .RE
2893 .IP \[bu] 2
2894 \f[B]Windows:\f[R] The following example shows how to set the log file to
2895 \f[CB]C:/log/java/hotspot.log\f[R]:
2896 .RS 2
2897 .RS
2898 .PP
2899 \f[CB]\-XX:LogFile=C:/log/java/hotspot.log\f[R]
2900 .RE
2901 .RE
2902 .RE
2903 .TP
2904 .B \f[CB]\-XX:+PrintClassHistogram\f[R]
2905 Enables printing of a class instance histogram after one of the
2906 following events:
2907 .RS
2908 .IP \[bu] 2
2909 \f[B]Oracle Solaris, Linux, and macOS:\f[R] \f[CB]Control+Break\f[R]
2910 .IP \[bu] 2
2911 \f[B]Windows:\f[R] \f[CB]Control+C\f[R] (\f[CB]SIGTERM\f[R])
2912 .PP
2913 By default, this option is disabled.
2914 .PP
2915 Setting this option is equivalent to running the \f[CB]jmap\ \-histo\f[R]
2916 command, or the \f[CB]jcmd\f[R] \f[I]pid\f[R] \f[CB]GC.class_histogram\f[R]
2917 command, where \f[I]pid\f[R] is the current Java process identifier.
2918 .RE
2919 .TP
2920 .B \f[CB]\-XX:+PrintConcurrentLocks\f[R]
2921 Enables printing of \f[CB]java.util.concurrent\f[R] locks after one of the
2922 following events:
2923 .RS
2924 .IP \[bu] 2
2925 \f[B]Oracle Solaris, Linux, and macOS:\f[R] \f[CB]Control+Break\f[R]
2926 .IP \[bu] 2
2927 \f[B]Windows:\f[R] \f[CB]Control+C\f[R] (\f[CB]SIGTERM\f[R])
2928 .PP
2929 By default, this option is disabled.
2930 .PP
2931 Setting this option is equivalent to running the \f[CB]jstack\ \-l\f[R]
2932 command or the \f[CB]jcmd\f[R] \f[I]pid\f[R] \f[CB]Thread.print\ \-l\f[R]
2933 command, where \f[I]pid\f[R] is the current Java process identifier.
2934 .RE
2935 .TP
2936 .B \f[CB]\-XX:+PrintFlagsRanges\f[R]
2937 Prints the range specified and allows automatic testing of the values.
2938 See \f[B]Validate Java Virtual Machine Flag Arguments\f[R].
2939 .RS
2940 .RE
2941 .TP
2942 .B \f[CB]\-XX:+PerfDataSaveToFile\f[R]
2943 If enabled, saves \f[B]jstat\f[R] binary data when the Java application
2944 exits.
2945 This binary data is saved in a file named
2946 \f[CB]hsperfdata_\f[R]\f[I]pid\f[R], where \f[I]pid\f[R] is the process
2947 identifier of the Java application that you ran.
2948 Use the \f[CB]jstat\f[R] command to display the performance data contained
2949 in this file as follows:
2950 .RS
2951 .RS
2952 .PP
2953 \f[CB]jstat\ \-class\ file:///\f[R]\f[I]path\f[R]\f[CB]/hsperfdata_\f[R]\f[I]pid\f[R]
2954 .RE
2955 .RS
2956 .PP
2957 \f[CB]jstat\ \-gc\ file:///\f[R]\f[I]path\f[R]\f[CB]/hsperfdata_\f[R]\f[I]pid\f[R]
2958 .RE
2959 .RE
2960 .TP
2961 .B \f[CB]\-XX:+UsePerfData\f[R]
2962 Enables the \f[CB]perfdata\f[R] feature.
2963 This option is enabled by default to allow JVM monitoring and
2964 performance testing.
2965 Disabling it suppresses the creation of the \f[CB]hsperfdata_userid\f[R]
2966 directories.
2967 To disable the \f[CB]perfdata\f[R] feature, specify
2968 \f[CB]\-XX:\-UsePerfData\f[R].
2969 .RS
2970 .RE
2971 .SH ADVANCED GARBAGE COLLECTION OPTIONS FOR JAVA
2972 .PP
2973 These \f[CB]java\f[R] options control how garbage collection (GC) is
2974 performed by the Java HotSpot VM.
2975 .TP
2976 .B \f[CB]\-XX:+AggressiveHeap\f[R]
2977 Enables Java heap optimization.
2978 This sets various parameters to be optimal for long\-running jobs with
2979 intensive memory allocation, based on the configuration of the computer
2980 (RAM and CPU).
2981 By default, the option is disabled and the heap isn't optimized.
2982 .RS
2983 .RE
2984 .TP
2985 .B \f[CB]\-XX:+AlwaysPreTouch\f[R]
2986 Enables touching of every page on the Java heap during JVM
2987 initialization.
2988 This gets all pages into memory before entering the \f[CB]main()\f[R]
2989 method.
2990 The option can be used in testing to simulate a long\-running system
2991 with all virtual memory mapped to physical memory.
2992 By default, this option is disabled and all pages are committed as JVM
2993 heap space fills.
2994 .RS
2995 .RE
2996 .TP
2997 .B \f[CB]\-XX:+CMSClassUnloadingEnabled\f[R]
2998 Enables class unloading when using the concurrent mark\-sweep (CMS)
2999 garbage collector.
3000 This option is enabled by default.
3001 To disable class unloading for the CMS garbage collector, specify
3002 \f[CB]\-XX:\-CMSClassUnloadingEnabled\f[R].
3003 .RS
3004 .RE
3005 .TP
3006 .B \f[CB]\-XX:CMSExpAvgFactor=\f[R]\f[I]percent\f[R]
3007 Sets the percentage of time (0 to 100) used to weight the current sample
3008 when computing exponential averages for the concurrent collection
3009 statistics.
3010 By default, the exponential averages factor is set to 25%.
3011 The following example shows how to set the factor to 15%:
3012 .RS
3013 .RS
3014 .PP
3015 \f[CB]\-XX:CMSExpAvgFactor=15\f[R]
3016 .RE
3017 .RE
3018 .TP
3019 .B \f[CB]\-XX:CMSInitiatingOccupancyFraction=\f[R]\f[I]percent\f[R]
3020 Sets the percentage of the old generation occupancy (0 to 100) at which
3021 to start a CMS collection cycle.
3022 The default value is set to \-1.
3023 Any negative value (including the default) implies that the option
3024 \f[CB]\-XX:CMSTriggerRatio\f[R] is used to define the value of the
3025 initiating occupancy fraction.
3026 .RS
3027 .PP
3028 The following example shows how to set the factor to 20%:
3029 .IP
3030 .nf
3031 \f[CB]
3032 >\ \ \ `\-XX:CMSInitiatingOccupancyFraction=20`
3033 \f[R]
3034 .fi
3035 .RE
3036 .TP
3037 .B \f[CB]\-XX:CMSIncrementalDutySafetyFactor=\f[R]\f[I]percent\f[R]
3038 Sets the percentage (0 to 100) used to add conservatism when computing
3039 the duty cycle.
3040 The default value is 10.
3041 .RS
3042 .RE
3043 .TP
3044 .B \f[CB]\-XX:+CMSScavengeBeforeRemark\f[R]
3045 Enables scavenging attempts before the CMS remark step.
3046 By default, this option is disabled.
3047 .RS
3048 .RE
3049 .TP
3050 .B \f[CB]\-XX:CMSTriggerRatio=percent\f[R]
3051 Sets the percentage (0 to 100) of the value specified by the option
3052 \f[CB]\-XX:MinHeapFreeRatio\f[R] that\[aq]s allocated before a CMS
3053 collection cycle commences.
3054 The default value is set to 80%.
3055 .RS
3056 .PP
3057 The following example shows how to set the occupancy fraction to 75%:
3058 .RS
3059 .PP
3060 \f[CB]\-XX:CMSTriggerRatio=75\f[R]
3061 .RE
3062 .RE
3063 .TP
3064 .B \f[CB]\-XX:ConcGCThreads=\f[R]\f[I]threads\f[R]
3065 Sets the number of threads used for concurrent GC.
3066 Sets \f[I]\f[CI]threads\f[I]\f[R] to approximately 1/4 of the number of
3067 parallel garbage collection threads.
3068 The default value depends on the number of CPUs available to the JVM.
3069 .RS
3070 .PP
3071 For example, to set the number of threads for concurrent GC to 2,
3072 specify the following option:
3073 .RS
3074 .PP
3075 \f[CB]\-XX:ConcGCThreads=2\f[R]
3076 .RE
3077 .RE
3078 .TP
3079 .B \f[CB]\-XX:+DisableExplicitGC\f[R]
3080 Enables the option that disables processing of calls to the
3081 \f[CB]System.gc()\f[R] method.
3082 This option is disabled by default, meaning that calls to
3083 \f[CB]System.gc()\f[R] are processed.
3084 If processing of calls to \f[CB]System.gc()\f[R] is disabled, then the JVM
3085 still performs GC when necessary.
3086 .RS
3087 .RE
3088 .TP
3089 .B \f[CB]\-XX:+ExplicitGCInvokesConcurrent\f[R]
3090 Enables invoking of concurrent GC by using the \f[CB]System.gc()\f[R]
3091 request.
3092 This option is disabled by default and can be enabled only with the
3093 deprecated \f[CB]\-XX:+UseConcMarkSweepGC\f[R] option and the
3094 \f[CB]\-XX:+UseG1GC\f[R] option.
3095 .RS
3096 .RE
3097 .TP
3098 .B \f[CB]\-XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses\f[R]
3099 Enables invoking of concurrent GC by using the \f[CB]System.gc()\f[R]
3100 request and unloading of classes during the concurrent GC cycle.
3101 This option is disabled by default and can be enabled only with the
3102 deprecated \f[CB]\-XX:+UseConcMarkSweepGC\f[R] option.
3103 .RS
3104 .RE
3105 .TP
3106 .B \f[CB]\-XX:G1HeapRegionSize=size\f[R]
3107 Sets the size of the regions into which the Java heap is subdivided when
3108 using the garbage\-first (G1) collector.
3109 The value is a power of 2 and can range from 1 MB to 32 MB.
3110 The goal is to have around 2048 regions based on the minimum Java heap
3111 size.
3112 The default region size is determined ergonomically based on the heap
3113 size.
3114 .RS
3115 .PP
3116 The following example sets the size of the subdivisions to 16 MB:
3117 .RS
3118 .PP
3119 \f[CB]\-XX:G1HeapRegionSize=16m\f[R]
3120 .RE
3121 .RE
3122 .TP
3123 .B \f[CB]\-XX:G1HeapWastePercent=\f[R]\f[I]percent\f[R]
3124 Sets the percentage of heap that you\[aq]re willing to waste.
3125 The Java HotSpot VM doesn\[aq]t initiate the mixed garbage collection
3126 cycle when the reclaimable percentage is less than the heap waste
3127 percentage.
3128 The default is 5 percent.
3129 .RS
3130 .RE
3131 .TP
3132 .B \f[CB]\-XX:G1MaxNewSizePercent=\f[R]\f[I]percent\f[R]
3133 Sets the percentage of the heap size to use as the maximum for the young
3134 generation size.
3135 The default value is 60 percent of your Java heap.
3136 .RS
3137 .PP
3138 This is an experimental flag.
3139 This setting replaces the \f[CB]\-XX:DefaultMaxNewGenPercent\f[R] setting.
3140 .PP
3141 This setting isn\[aq]t available in Java HotSpot VM build 23 or earlier.
3142 .RE
3143 .TP
3144 .B \f[CB]\-XX:G1MixedGCCountTarget=\f[R]\f[I]number\f[R]
3145 Sets the target number of mixed garbage collections after a marking
3146 cycle to collect old regions with at most
3147 \f[CB]G1MixedGCLIveThresholdPercent\f[R] live data.
3148 The default is 8 mixed garbage collections.
3149 The goal for mixed collections is to be within this target number.
3150 .RS
3151 .PP
3152 This setting isn\[aq]t available in Java HotSpot VM build 23 or earlier.
3153 .RE
3154 .TP
3155 .B \f[CB]\-XX:G1MixedGCLiveThresholdPercent=\f[R]\f[I]percent\f[R]
3156 Sets the occupancy threshold for an old region to be included in a mixed
3157 garbage collection cycle.
3158 The default occupancy is 85 percent.
3159 .RS
3160 .PP
3161 This is an experimental flag.
3162 This setting replaces the
3163 \f[CB]\-XX:G1OldCSetRegionLiveThresholdPercent\f[R] setting.
3164 .PP
3165 This setting isn\[aq]t available in Java HotSpot VM build 23 or earlier.
3166 .RE
3167 .TP
3168 .B \f[CB]\-XX:G1NewSizePercent=\f[R]\f[I]percent\f[R]
3169 Sets the percentage of the heap to use as the minimum for the young
3170 generation size.
3171 The default value is 5 percent of your Java heap.
3172 .RS
3173 .PP
3174 This is an experimental flag.
3175 This setting replaces the \f[CB]\-XX:DefaultMinNewGenPercent\f[R] setting.
3176 .PP
3177 This setting isn\[aq]t available in Java HotSpot VM build 23 or earlier.
3178 .RE
3179 .TP
3180 .B \f[CB]\-XX:G1OldCSetRegionThresholdPercent=\f[R]\f[I]percent\f[R]
3181 Sets an upper limit on the number of old regions to be collected during
3182 a mixed garbage collection cycle.
3183 The default is 10 percent of the Java heap.
3184 .RS
3185 .PP
3186 This setting isn\[aq]t available in Java HotSpot VM build 23 or earlier.
3187 .RE
3188 .TP
3189 .B \f[CB]\-XX:G1ReservePercent=\f[R]\f[I]percent\f[R]
3190 Sets the percentage of the heap (0 to 50) that\[aq]s reserved as a false
3191 ceiling to reduce the possibility of promotion failure for the G1
3192 collector.
3193 When you increase or decrease the percentage, ensure that you adjust the
3194 total Java heap by the same amount.
3195 By default, this option is set to 10%.
3196 .RS
3197 .PP
3198 The following example sets the reserved heap to 20%:
3199 .RS
3200 .PP
3201 \f[CB]\-XX:G1ReservePercent=20\f[R]
3202 .RE
3203 .RE
3204 .TP
3205 .B \f[CB]\-XX:InitialHeapOccupancyPercent=\f[R]\f[I]percent\f[R]
3206 Sets the Java heap occupancy threshold that triggers a marking cycle.
3207 The default occupancy is 45 percent of the entire Java heap.
3208 .RS
3209 .RE
3210 .TP
3211 .B \f[CB]\-XX:InitialHeapSize=\f[R]\f[I]size\f[R]
3212 Sets the initial size (in bytes) of the memory allocation pool.
3213 This value must be either 0, or a multiple of 1024 and greater than 1
3214 MB.
3215 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
3216 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
3217 \f[CB]G\f[R] to indicate gigabytes.
3218 The default value is selected at run time based on the system
3219 configuration.
3220 .RS
3221 .PP
3222 The following examples show how to set the size of allocated memory to 6
3223 MB using various units:
3224 .IP
3225 .nf
3226 \f[CB]
3227 \-XX:InitialHeapSize=6291456
3228 \-XX:InitialHeapSize=6144k
3229 \-XX:InitialHeapSize=6m
3230 \f[R]
3231 .fi
3232 .PP
3233 If you set this option to 0, then the initial size is set as the sum of
3234 the sizes allocated for the old generation and the young generation.
3235 The size of the heap for the young generation can be set using the
3236 \f[CB]\-XX:NewSize\f[R] option.
3237 .RE
3238 .TP
3239 .B \f[CB]\-XX:InitialSurvivorRatio=\f[R]\f[I]ratio\f[R]
3240 Sets the initial survivor space ratio used by the throughput garbage
3241 collector (which is enabled by the \f[CB]\-XX:+UseParallelGC\f[R] and/or
3242 \f[CB]\-XX:+UseParallelOldGC\f[R] options).
3243 Adaptive sizing is enabled by default with the throughput garbage
3244 collector by using the \f[CB]\-XX:+UseParallelGC\f[R] and
3245 \f[CB]\-XX:+UseParallelOldGC\f[R] options, and the survivor space is
3246 resized according to the application behavior, starting with the initial
3247 value.
3248 If adaptive sizing is disabled (using the
3249 \f[CB]\-XX:\-UseAdaptiveSizePolicy\f[R] option), then the
3250 \f[CB]\-XX:SurvivorRatio\f[R] option should be used to set the size of the
3251 survivor space for the entire execution of the application.
3252 .RS
3253 .PP
3254 The following formula can be used to calculate the initial size of
3255 survivor space (S) based on the size of the young generation (Y), and
3256 the initial survivor space ratio (R):
3257 .RS
3258 .PP
3259 \f[CB]S=Y/(R+2)\f[R]
3260 .RE
3261 .PP
3262 The 2 in the equation denotes two survivor spaces.
3263 The larger the value specified as the initial survivor space ratio, the
3264 smaller the initial survivor space size.
3265 .PP
3266 By default, the initial survivor space ratio is set to 8.
3267 If the default value for the young generation space size is used (2 MB),
3268 then the initial size of the survivor space is 0.2 MB.
3269 .PP
3270 The following example shows how to set the initial survivor space ratio
3271 to 4:
3272 .RS
3273 .PP
3274 \f[CB]\-XX:InitialSurvivorRatio=4\f[R]
3275 .RE
3276 .RE
3277 .TP
3278 .B \f[CB]\-XX:InitiatingHeapOccupancyPercent=\f[R]\f[I]percent\f[R]
3279 Sets the percentage of the heap occupancy (0 to 100) at which to start a
3280 concurrent GC cycle.
3281 It\[aq]s used by garbage collectors that trigger a concurrent GC cycle
3282 based on the occupancy of the entire heap, not just one of the
3283 generations (for example, the G1 garbage collector).
3284 .RS
3285 .PP
3286 By default, the initiating value is set to 45%.
3287 A value of 0 implies nonstop GC cycles.
3288 The following example shows how to set the initiating heap occupancy to
3289 75%:
3290 .RS
3291 .PP
3292 \f[CB]\-XX:InitiatingHeapOccupancyPercent=75\f[R]
3293 .RE
3294 .RE
3295 .TP
3296 .B \f[CB]\-XX:MaxGCPauseMillis=\f[R]\f[I]time\f[R]
3297 Sets a target for the maximum GC pause time (in milliseconds).
3298 This is a soft goal, and the JVM will make its best effort to achieve
3299 it.
3300 The specified value doesn\[aq]t adapt to your heap size.
3301 By default, there\[aq]s no maximum pause time value.
3302 .RS
3303 .PP
3304 The following example shows how to set the maximum target pause time to
3305 500 ms:
3306 .RS
3307 .PP
3308 \f[CB]\-XX:MaxGCPauseMillis=500\f[R]
3309 .RE
3310 .RE
3311 .TP
3312 .B \f[CB]\-XX:MaxHeapSize=\f[R]\f[I]size\f[R]
3313 Sets the maximum size (in byes) of the memory allocation pool.
3314 This value must be a multiple of 1024 and greater than 2 MB.
3315 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
3316 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
3317 \f[CB]G\f[R] to indicate gigabytes.
3318 The default value is selected at run time based on the system
3319 configuration.
3320 For server deployments, the options \f[CB]\-XX:InitialHeapSize\f[R] and
3321 \f[CB]\-XX:MaxHeapSize\f[R] are often set to the same value.
3322 .RS
3323 .PP
3324 The following examples show how to set the maximum allowed size of
3325 allocated memory to 80 MB using various units:
3326 .IP
3327 .nf
3328 \f[CB]
3329 \-XX:MaxHeapSize=83886080
3330 \-XX:MaxHeapSize=81920k
3331 \-XX:MaxHeapSize=80m
3332 \f[R]
3333 .fi
3334 .PP
3335 On Oracle Solaris 7 and Oracle Solaris 8 SPARC platforms, the upper
3336 limit for this value is approximately 4,000 MB minus overhead amounts.
3337 On Oracle Solaris 2.6 and x86 platforms, the upper limit is
3338 approximately 2,000 MB minus overhead amounts.
3339 On Linux platforms, the upper limit is approximately 2,000 MB minus
3340 overhead amounts.
3341 .PP
3342 The \f[CB]\-XX:MaxHeapSize\f[R] option is equivalent to \f[CB]\-Xmx\f[R].
3343 .RE
3344 .TP
3345 .B \f[CB]\-XX:MaxHeapFreeRatio=\f[R]\f[I]percent\f[R]
3346 Sets the maximum allowed percentage of free heap space (0 to 100) after
3347 a GC event.
3348 If free heap space expands above this value, then the heap is shrunk.
3349 By default, this value is set to 70%.
3350 .RS
3351 .PP
3352 Minimize the Java heap size by lowering the values of the parameters
3353 \f[CB]MaxHeapFreeRatio\f[R] (default value is 70%) and
3354 \f[CB]MinHeapFreeRatio\f[R] (default value is 40%) with the command\-line
3355 options \f[CB]\-XX:MaxHeapFreeRatio\f[R] and
3356 \f[CB]\-XX:MinHeapFreeRatio\f[R].
3357 Lowering \f[CB]MaxHeapFreeRatio\f[R] to as low as 10% and
3358 \f[CB]MinHeapFreeRatio\f[R] to 5% has successfully reduced the heap size
3359 without too much performance regression; however, results may vary
3360 greatly depending on your application.
3361 Try different values for these parameters until they\[aq]re as low as
3362 possible yet still retain acceptable performance.
3363 .RS
3364 .PP
3365 \f[CB]\-XX:MaxHeapFreeRatio=10\ \-XX:MinHeapFreeRatio=5\f[R]
3366 .RE
3367 .PP
3368 Customers trying to keep the heap small should also add the option
3369 \f[CB]\-XX:\-ShrinkHeapInSteps\f[R].
3370 See \f[B]Performance Tuning Examples\f[R] for a description of using this
3371 option to keep the Java heap small by reducing the dynamic footprint for
3372 embedded applications.
3373 .RE
3374 .TP
3375 .B \f[CB]\-XX:MaxMetaspaceSize=\f[R]\f[I]size\f[R]
3376 Sets the maximum amount of native memory that can be allocated for class
3377 metadata.
3378 By default, the size isn\[aq]t limited.
3379 The amount of metadata for an application depends on the application
3380 itself, other running applications, and the amount of memory available
3381 on the system.
3382 .RS
3383 .PP
3384 The following example shows how to set the maximum class metadata size
3385 to 256 MB:
3386 .RS
3387 .PP
3388 \f[CB]\-XX:MaxMetaspaceSize=256m\f[R]
3389 .RE
3390 .RE
3391 .TP
3392 .B \f[CB]\-XX:MaxNewSize=\f[R]\f[I]size\f[R]
3393 Sets the maximum size (in bytes) of the heap for the young generation
3394 (nursery).
3395 The default value is set ergonomically.
3396 .RS
3397 .RE
3398 .TP
3399 .B \f[CB]\-XX:MaxTenuringThreshold=\f[R]\f[I]threshold\f[R]
3400 Sets the maximum tenuring threshold for use in adaptive GC sizing.
3401 The largest value is 15.
3402 The default value is 15 for the parallel (throughput) collector, and 6
3403 for the CMS collector.
3404 .RS
3405 .PP
3406 The following example shows how to set the maximum tenuring threshold to
3407 10:
3408 .RS
3409 .PP
3410 \f[CB]\-XX:MaxTenuringThreshold=10\f[R]
3411 .RE
3412 .RE
3413 .TP
3414 .B \f[CB]\-XX:MetaspaceSize=\f[R]\f[I]size\f[R]
3415 Sets the size of the allocated class metadata space that triggers a
3416 garbage collection the first time it\[aq]s exceeded.
3417 This threshold for a garbage collection is increased or decreased
3418 depending on the amount of metadata used.
3419 The default size depends on the platform.
3420 .RS
3421 .RE
3422 .TP
3423 .B \f[CB]\-XX:MinHeapFreeRatio=\f[R]\f[I]percent\f[R]
3424 Sets the minimum allowed percentage of free heap space (0 to 100) after
3425 a GC event.
3426 If free heap space falls below this value, then the heap is expanded.
3427 By default, this value is set to 40%.
3428 .RS
3429 .PP
3430 Minimize Java heap size by lowering the values of the parameters
3431 \f[CB]MaxHeapFreeRatio\f[R] (default value is 70%) and
3432 \f[CB]MinHeapFreeRatio\f[R] (default value is 40%) with the command\-line
3433 options \f[CB]\-XX:MaxHeapFreeRatio\f[R] and
3434 \f[CB]\-XX:MinHeapFreeRatio\f[R].
3435 Lowering \f[CB]MaxHeapFreeRatio\f[R] to as low as 10% and
3436 \f[CB]MinHeapFreeRatio\f[R] to 5% has successfully reduced the heap size
3437 without too much performance regression; however, results may vary
3438 greatly depending on your application.
3439 Try different values for these parameters until they\[aq]re as low as
3440 possible, yet still retain acceptable performance.
3441 .RS
3442 .PP
3443 \f[CB]\-XX:MaxHeapFreeRatio=10\ \-XX:MinHeapFreeRatio=5\f[R]
3444 .RE
3445 .PP
3446 Customers trying to keep the heap small should also add the option
3447 \f[CB]\-XX:\-ShrinkHeapInSteps\f[R].
3448 See \f[B]Performance Tuning Examples\f[R] for a description of using this
3449 option to keep the Java heap small by reducing the dynamic footprint for
3450 embedded applications.
3451 .RE
3452 .TP
3453 .B \f[CB]\-XX:NewRatio=\f[R]\f[I]ratio\f[R]
3454 Sets the ratio between young and old generation sizes.
3455 By default, this option is set to 2.
3456 The following example shows how to set the young\-to\-old ratio to 1:
3457 .RS
3458 .RS
3459 .PP
3460 \f[CB]\-XX:NewRatio=1\f[R]
3461 .RE
3462 .RE
3463 .TP
3464 .B \f[CB]\-XX:NewSize=\f[R]\f[I]size\f[R]
3465 Sets the initial size (in bytes) of the heap for the young generation
3466 (nursery).
3467 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
3468 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
3469 \f[CB]G\f[R] to indicate gigabytes.
3470 .RS
3471 .PP
3472 The young generation region of the heap is used for new objects.
3473 GC is performed in this region more often than in other regions.
3474 If the size for the young generation is too low, then a large number of
3475 minor GCs are performed.
3476 If the size is too high, then only full GCs are performed, which can
3477 take a long time to complete.
3478 It is recommended that you keep the size for the young generation
3479 greater than 25% and less than 50% of the overall heap size.
3480 .PP
3481 The following examples show how to set the initial size of the young
3482 generation to 256 MB using various units:
3483 .IP
3484 .nf
3485 \f[CB]
3486 \-XX:NewSize=256m
3487 \-XX:NewSize=262144k
3488 \-XX:NewSize=268435456
3489 \f[R]
3490 .fi
3491 .PP
3492 The \f[CB]\-XX:NewSize\f[R] option is equivalent to \f[CB]\-Xmn\f[R].
3493 .RE
3494 .TP
3495 .B \f[CB]\-XX:ParallelGCThreads=\f[R]\f[I]threads\f[R]
3496 Sets the value of the stop\-the\-world (STW) worker threads.
3497 This option sets the value of \f[I]threads\f[R] to the number of logical
3498 processors.
3499 The value of \f[I]threads\f[R] is the same as the number of logical
3500 processors up to a value of 8.
3501 .RS
3502 .PP
3503 If there are more than 8 logical processors, then this option sets the
3504 value of \f[I]threads\f[R] to approximately 5/8 of the logical
3505 processors.
3506 This works in most cases except for larger SPARC systems where the value
3507 of \f[I]threads\f[R] can be approximately 5/16 of the logical processors.
3508 .PP
3509 The default value depends on the number of CPUs available to the JVM.
3510 .PP
3511 For example, to set the number of threads for parallel GC to 2, specify
3512 the following option:
3513 .RS
3514 .PP
3515 \f[CB]\-XX:ParallelGCThreads=2\f[R]
3516 .RE
3517 .RE
3518 .TP
3519 .B \f[CB]\-XX:+ParallelRefProcEnabled\f[R]
3520 Enables parallel reference processing.
3521 By default, this option is disabled.
3522 .RS
3523 .RE
3524 .TP
3525 .B \f[CB]\-XX:+PrintAdaptiveSizePolicy\f[R]
3526 Enables printing of information about adaptive\-generation sizing.
3527 By default, this option is disabled.
3528 .RS
3529 .RE
3530 .TP
3531 .B \f[CB]\-XX:+ScavengeBeforeFullGC\f[R]
3532 Enables GC of the young generation before each full GC.
3533 This option is enabled by default.
3534 It is recommended that you \f[I]don\[aq]t\f[R] disable it, because
3535 scavenging the young generation before a full GC can reduce the number
3536 of objects reachable from the old generation space into the young
3537 generation space.
3538 To disable GC of the young generation before each full GC, specify the
3539 option \f[CB]\-XX:\-ScavengeBeforeFullGC\f[R].
3540 .RS
3541 .RE
3542 .TP
3543 .B \f[CB]\-XX:SoftRefLRUPolicyMSPerMB=\f[R]\f[I]time\f[R]
3544 Sets the amount of time (in milliseconds) a softly reachable object is
3545 kept active on the heap after the last time it was referenced.
3546 The default value is one second of lifetime per free megabyte in the
3547 heap.
3548 The \f[CB]\-XX:SoftRefLRUPolicyMSPerMB\f[R] option accepts integer values
3549 representing milliseconds per one megabyte of the current heap size (for
3550 Java HotSpot Client VM) or the maximum possible heap size (for Java
3551 HotSpot Server VM).
3552 This difference means that the Client VM tends to flush soft references
3553 rather than grow the heap, whereas the Server VM tends to grow the heap
3554 rather than flush soft references.
3555 In the latter case, the value of the \f[CB]\-Xmx\f[R] option has a
3556 significant effect on how quickly soft references are garbage collected.
3557 .RS
3558 .PP
3559 The following example shows how to set the value to 2.5 seconds:
3560 .PP
3561 \f[CB]\-XX:SoftRefLRUPolicyMSPerMB=2500\f[R]
3562 .RE
3563 .TP
3564 .B \f[CB]\-XX:\-ShrinkHeapInSteps\f[R]
3565 Incrementally reduces the Java heap to the target size, specified by the
3566 option \f[CB]\-XX:MaxHeapFreeRatio\f[R].
3567 This option is enabled by default.
3568 If disabled, then it immediately reduces the Java heap to the target
3569 size instead of requiring multiple garbage collection cycles.
3570 Disable this option if you want to minimize the Java heap size.
3571 You will likely encounter performance degradation when this option is
3572 disabled.
3573 .RS
3574 .PP
3575 See \f[B]Performance Tuning Examples\f[R] for a description of using the
3576 \f[CB]MaxHeapFreeRatio\f[R] option to keep the Java heap small by reducing
3577 the dynamic footprint for embedded applications.
3578 .RE
3579 .TP
3580 .B \f[CB]\-XX:StringDeduplicationAgeThreshold=\f[R]\f[I]threshold\f[R]
3581 Identifies \f[CB]String\f[R] objects reaching the specified age that are
3582 considered candidates for deduplication.
3583 An object\[aq]s age is a measure of how many times it has survived
3584 garbage collection.
3585 This is sometimes referred to as tenuring.
3586 .RS
3587 .RS
3588 .PP
3589 \f[B]Note:\f[R] \f[CB]String\f[R] objects that are promoted to an old heap
3590 region before this age has been reached are always considered candidates
3591 for deduplication.
3592 The default value for this option is \f[CB]3\f[R].
3593 See the \f[CB]\-XX:+UseStringDeduplication\f[R] option.
3594 .RE
3595 .RE
3596 .TP
3597 .B \f[CB]\-XX:SurvivorRatio=\f[R]\f[I]ratio\f[R]
3598 Sets the ratio between eden space size and survivor space size.
3599 By default, this option is set to 8.
3600 The following example shows how to set the eden/survivor space ratio to
3601 4:
3602 .RS
3603 .RS
3604 .PP
3605 \f[CB]\-XX:SurvivorRatio=4\f[R]
3606 .RE
3607 .RE
3608 .TP
3609 .B \f[CB]\-XX:TargetSurvivorRatio=\f[R]\f[I]percent\f[R]
3610 Sets the desired percentage of survivor space (0 to 100) used after
3611 young garbage collection.
3612 By default, this option is set to 50%.
3613 .RS
3614 .PP
3615 The following example shows how to set the target survivor space ratio
3616 to 30%:
3617 .RS
3618 .PP
3619 \f[CB]\-XX:TargetSurvivorRatio=30\f[R]
3620 .RE
3621 .RE
3622 .TP
3623 .B \f[CB]\-XX:TLABSize=\f[R]\f[I]size\f[R]
3624 Sets the initial size (in bytes) of a thread\-local allocation buffer
3625 (TLAB).
3626 Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
3627 \f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
3628 \f[CB]G\f[R] to indicate gigabytes.
3629 If this option is set to 0, then the JVM selects the initial size
3630 automatically.
3631 .RS
3632 .PP
3633 The following example shows how to set the initial TLAB size to 512 KB:
3634 .RS
3635 .PP
3636 \f[CB]\-XX:TLABSize=512k\f[R]
3637 .RE
3638 .RE
3639 .TP
3640 .B \f[CB]\-XX:+UseAdaptiveSizePolicy\f[R]
3641 Enables the use of adaptive generation sizing.
3642 This option is enabled by default.
3643 To disable adaptive generation sizing, specify
3644 \f[CB]\-XX:\-UseAdaptiveSizePolicy\f[R] and set the size of the memory
3645 allocation pool explicitly.
3646 See the \f[CB]\-XX:SurvivorRatio\f[R] option.
3647 .RS
3648 .RE
3649 .TP
3650 .B \f[CB]\-XX:+UseCMSInitiatingOccupancyOnly\f[R]
3651 Enables the use of the occupancy value as the only criterion for
3652 initiating the CMS collector.
3653 By default, this option is disabled and other criteria may be used.
3654 .RS
3655 .RE
3656 .TP
3657 .B \f[CB]\-XX:+UseG1GC\f[R]
3658 Enables the use of the garbage\-first (G1) garbage collector.
3659 It\[aq]s a server\-style garbage collector, targeted for multiprocessor
3660 machines with a large amount of RAM.
3661 This option meets GC pause time goals with high probability, while
3662 maintaining good throughput.
3663 The G1 collector is recommended for applications requiring large heaps
3664 (sizes of around 6 GB or larger) with limited GC latency requirements (a
3665 stable and predictable pause time below 0.5 seconds).
3666 By default, this option is enabled and G1 is used as the default garbage
3667 collector.
3668 .RS
3669 .RE
3670 .TP
3671 .B \f[CB]\-XX:+UseGCOverheadLimit\f[R]
3672 Enables the use of a policy that limits the proportion of time spent by
3673 the JVM on GC before an \f[CB]OutOfMemoryError\f[R] exception is thrown.
3674 This option is enabled, by default, and the parallel GC will throw an
3675 \f[CB]OutOfMemoryError\f[R] if more than 98% of the total time is spent on
3676 garbage collection and less than 2% of the heap is recovered.
3677 When the heap is small, this feature can be used to prevent applications
3678 from running for long periods of time with little or no progress.
3679 To disable this option, specify the option
3680 \f[CB]\-XX:\-UseGCOverheadLimit\f[R].
3681 .RS
3682 .RE
3683 .TP
3684 .B \f[CB]\-XX:+UseNUMA\f[R]
3685 Enables performance optimization of an application on a machine with
3686 nonuniform memory architecture (NUMA) by increasing the
3687 application\[aq]s use of lower latency memory.
3688 By default, this option is disabled and no optimization for NUMA is
3689 made.
3690 The option is available only when the parallel garbage collector is used
3691 (\f[CB]\-XX:+UseParallelGC\f[R]).
3692 .RS
3693 .RE
3694 .TP
3695 .B \f[CB]\-XX:+UseParallelGC\f[R]
3696 Enables the use of the parallel scavenge garbage collector (also known
3697 as the throughput collector) to improve the performance of your
3698 application by leveraging multiple processors.
3699 .RS
3700 .PP
3701 By default, this option is disabled and the default collector is used.
3702 If it\[aq]s enabled, then the \f[CB]\-XX:+UseParallelOldGC\f[R] option is
3703 automatically enabled, unless you explicitly disable it.
3704 .RE
3705 .TP
3706 .B \f[CB]\-XX:+UseParallelOldGC\f[R]
3707 Enables the use of the parallel garbage collector for full GCs.
3708 By default, this option is disabled.
3709 Enabling it automatically enables the \f[CB]\-XX:+UseParallelGC\f[R]
3710 option.
3711 .RS
3712 .RE
3713 .TP
3714 .B \f[CB]\-XX:+UseSerialGC\f[R]
3715 Enables the use of the serial garbage collector.
3716 This is generally the best choice for small and simple applications that
3717 don\[aq]t require any special functionality from garbage collection.
3718 By default, this option is disabled and the default collector is used.
3719 .RS
3720 .RE
3721 .TP
3722 .B \f[CB]\-XX:+UseSHM\f[R]
3723 \f[B]Linux only:\f[R] Enables the JVM to use shared memory to set up
3724 large pages.
3725 .RS
3726 .PP
3727 See \f[B]Large Pages\f[R] for setting up large pages.
3728 .RE
3729 .TP
3730 .B \f[CB]\-XX:+UseStringDeduplication\f[R]
3731 Enables string deduplication.
3732 By default, this option is disabled.
3733 To use this option, you must enable the garbage\-first (G1) garbage
3734 collector.
3735 .RS
3736 .PP
3737 String deduplication reduces the memory footprint of \f[CB]String\f[R]
3738 objects on the Java heap by taking advantage of the fact that many
3739 \f[CB]String\f[R] objects are identical.
3740 Instead of each \f[CB]String\f[R] object pointing to its own character
3741 array, identical \f[CB]String\f[R] objects can point to and share the same
3742 character array.
3743 .RE
3744 .TP
3745 .B \f[CB]\-XX:+UseTLAB\f[R]
3746 Enables the use of thread\-local allocation blocks (TLABs) in the young
3747 generation space.
3748 This option is enabled by default.
3749 To disable the use of TLABs, specify the option \f[CB]\-XX:\-UseTLAB\f[R].
3750 .RS
3751 .RE
3752 .SH DEPRECATED JAVA OPTIONS
3753 .PP
3754 These \f[CB]java\f[R] options are deprecated and might be removed in a
3755 future JDK release.
3756 They\[aq]re still accepted and acted upon, but a warning is issued when
3757 they\[aq]re used.
3758 .TP
3759 .B \f[CB]\-Xfuture\f[R]
3760 Enables strict class\-file format checks that enforce close conformance
3761 to the class\-file format specification.
3762 Developers should use this flag when developing new code.
3763 Stricter checks may become the default in future releases.
3764 .RS
3765 .RE
3766 .TP
3767 .B \f[CB]\-Xloggc:\f[R]\f[I]filename\f[R]
3768 Sets the file to which verbose GC events information should be
3769 redirected for logging.
3770 The \f[CB]\-Xloggc\f[R] option overrides \f[CB]\-verbose:gc\f[R] if both are
3771 given with the same java command.
3772 \f[CB]\-Xloggc:\f[R]\f[I]filename\f[R] is replaced by
3773 \f[CB]\-Xlog:gc:\f[R]\f[I]filename\f[R].
3774 See Enable Logging with the JVM Unified Logging Framework.
3775 .RS
3776 .PP
3777 Example:
3778 .PP
3779 \f[CB]\-Xlog:gc:garbage\-collection.log\f[R]
3780 .RE
3781 .TP
3782 .B \f[CB]\-XX:+FailOverToOldVerifier\f[R]
3783 Enables automatic failover to the old verifier when the new type checker
3784 fails.
3785 By default, this option is disabled and it\[aq]s ignored (that is,
3786 treated as disabled) for classes with a recent bytecode version.
3787 You can enable it only for classes with older versions of the bytecode.
3788 .RS
3789 .RE
3790 .TP
3791 .B \f[CB]\-XX:+TraceClassLoading\f[R]
3792 Enables tracing of classes as they are loaded.
3793 By default, this option is disabled and classes aren\[aq]t traced.
3794 .RS
3795 .PP
3796 The replacement Unified Logging syntax is
3797 \f[CB]\-Xlog:class+load=\f[R]\f[I]level\f[R].
3798 See \f[B]Enable Logging with the JVM Unified Logging Framework\f[R]
3799 .PP
3800 Use \f[I]level\f[R]=\f[CB]info\f[R] for regular information, or
3801 \f[I]level\f[R]=\f[CB]debug\f[R] for additional information.
3802 In Unified Logging syntax, \f[CB]\-verbose:class\f[R] equals
3803 \f[CB]\-Xlog:class+load=info,class+unload=info\f[R].
3804 .RE
3805 .TP
3806 .B \f[CB]\-XX:+TraceClassLoadingPreorder\f[R]
3807 Enables tracing of all loaded classes in the order in which they\[aq]re
3808 referenced.
3809 By default, this option is disabled and classes aren\[aq]t traced.
3810 .RS
3811 .PP
3812 The replacement Unified Logging syntax is
3813 \f[CB]\-Xlog:class+preorder=debug\f[R].
3814 See \f[B]Enable Logging with the JVM Unified Logging Framework\f[R].
3815 .RE
3816 .TP
3817 .B \f[CB]\-XX:+TraceClassResolution\f[R]
3818 Enables tracing of constant pool resolutions.
3819 By default, this option is disabled and constant pool resolutions
3820 aren\[aq]t traced.
3821 .RS
3822 .PP
3823 The replacement Unified Logging syntax is
3824 \f[CB]\-Xlog:class+resolve=debug\f[R].
3825 See \f[B]Enable Logging with the JVM Unified Logging Framework\f[R].
3826 .RE
3827 .TP
3828 .B \f[CB]\-XX:+TraceLoaderConstraints\f[R]
3829 Enables tracing of the loader constraints recording.
3830 By default, this option is disabled and loader constraints recording
3831 isn\[aq]t traced.
3832 .RS
3833 .PP
3834 The replacement Unified Logging syntax is
3835 \f[CB]\-Xlog:class+loader+constraints=info\f[R].
3836 See \f[B]Enable Logging with the JVM Unified Logging Framework\f[R].
3837 .RE
3838 .TP
3839 .B \f[CB]\-XX:+UseConcMarkSweepGC\f[R]
3840 Enables the use of the CMS garbage collector for the old generation.
3841 CMS is an alternative to the default garbage collector (G1), which also
3842 focuses on meeting application latency requirements.
3843 By default, this option is disabled and the collector is selected
3844 automatically based on the configuration of the machine and type of the
3845 JVM.
3846 The CMS garbage collector is deprecated.
3847 .RS
3848 .RE
3849 .SH OBSOLETE JAVA OPTIONS
3850 .PP
3851 These \f[CB]java\f[R] options are still accepted but ignored, and a
3852 warning is issued when they\[aq]re used.
3853 .TP
3854 .B \f[CB]\-XX:+UseMembar\f[R]
3855 Enabled issuing membars on thread\-state transitions.
3856 This option was disabled by default on all platforms except ARM servers,
3857 where it was enabled.
3858 .RS
3859 .RE
3860 .TP
3861 .B \f[CB]\-XX:MaxPermSize=\f[R]\f[I]size\f[R]
3862 Sets the maximum permanent generation space size (in bytes).
3863 This option was deprecated in JDK 8 and superseded by the
3864 \f[CB]\-XX:MaxMetaspaceSize\f[R] option.
3865 .RS
3866 .RE
3867 .TP
3868 .B \f[CB]\-XX:PermSize=\f[R]\f[I]size\f[R]
3869 Sets the space (in bytes) allocated to the permanent generation that
3870 triggers a garbage collection if it\[aq]s exceeded.
3871 This option was deprecated in JDK 8 and superseded by the
3872 \f[CB]\-XX:MetaspaceSize\f[R] option.
3873 .RS
3874 .RE
3875 .SH REMOVED JAVA OPTIONS
3876 .PP
3877 These \f[CB]java\f[R] options have been removed in JDK 13 and using them
3878 results in an error of:
3879 .RS
3880 .PP
3881 \f[CB]Unrecognized\ VM\ option\f[R] \f[I]option\-name\f[R]
3882 .RE
3883 .TP
3884 .B \f[CB]\-XX:+AggressiveOpts\f[R]
3885 Enabled the use of aggressive performance optimization features.
3886 By default, this option was disabled and experimental performance
3887 features were not used.
3888 .RS
3889 .RE
3890 .PP
3891 For the lists and descriptions of options removed in previous releases
3892 see the \f[I]Removed Java Options\f[R] section in:
3893 .IP \[bu] 2
3894 \f[B]Java Platform, Standard Edition Tools Reference, Release 12\f[R]
3895 [https://docs.oracle.com/en/java/javase/12/tools/java.html#GUID\-3B1CE181\-CD30\-4178\-9602\-230B800D4FAE]
3896 .IP \[bu] 2
3897 \f[B]Java Platform, Standard Edition Tools Reference, Release 11\f[R]
3898 [https://docs.oracle.com/en/java/javase/11/tools/java.html#GUID\-741FC470\-AA3E\-494A\-8D2B\-1B1FE4A990D1]
3899 .IP \[bu] 2
3900 \f[B]Java Platform, Standard Edition Tools Reference, Release 10\f[R]
3901 [https://docs.oracle.com/javase/10/tools/java.htm#JSWOR624]
3902 .IP \[bu] 2
3903 \f[B]Java Platform, Standard Edition Tools Reference, Release 9\f[R]
3904 [https://docs.oracle.com/javase/9/tools/java.htm#JSWOR624]
3905 .IP \[bu] 2
3906 \f[B]Java Platform, Standard Edition Tools Reference, Release 8 for
3907 Oracle JDK on Windows\f[R]
3908 [https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html#BGBCIEFC]
3909 .IP \[bu] 2
3910 \f[B]Java Platform, Standard Edition Tools Reference, Release 8 for
3911 Oracle JDK on Solaris, Linux, and macOS\f[R]
3912 [https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html#BGBCIEFC]
3913 .SH JAVA COMMAND\-LINE ARGUMENT FILES
3914 .PP
3915 You can shorten or simplify the \f[CB]java\f[R] command by using
3916 \f[CB]\@\f[R] argument files to specify one or more text files that
3917 contain arguments, such as options and class names, which are passed to
3918 the \f[CB]java\f[R] command.
3919 This let\[aq]s you to create \f[CB]java\f[R] commands of any length on any
3920 operating system.
3921 .PP
3922 In the command line, use the at sign (\f[CB]\@\f[R]) prefix to identify an
3923 argument file that contains \f[CB]java\f[R] options and class names.
3924 When the \f[CB]java\f[R] command encounters a file beginning with the at
3925 sign (\f[CB]\@\f[R]), it expands the contents of that file into an
3926 argument list just as they would be specified on the command line.
3927 .PP
3928 The \f[CB]java\f[R] launcher expands the argument file contents until it
3929 encounters the \f[CB]\-Xdisable\-\@files\f[R] option.
3930 You can use the \f[CB]\-Xdisable\-\@files\f[R] option anywhere on the
3931 command line, including in an argument file, to stop \f[CB]\@\f[R]
3932 argument files expansion.
3933 .PP
3934 The following items describe the syntax of \f[CB]java\f[R] argument files:
3935 .IP \[bu] 2
3936 The argument file must contain only ASCII characters or characters in
3937 system default encoding that\[aq]s ASCII friendly, such as UTF\-8.
3938 .IP \[bu] 2
3939 The argument file size must not exceed MAXINT (2,147,483,647) bytes.
3940 .IP \[bu] 2
3941 The launcher doesn\[aq]t expand wildcards that are present within an
3942 argument file.
3943 .IP \[bu] 2
3944 Use white space or new line characters to separate arguments included in
3945 the file.
3946 .IP \[bu] 2
3947 White space includes a white space character, \f[CB]\\t\f[R],
3948 \f[CB]\\n\f[R], \f[CB]\\r\f[R], and \f[CB]\\f\f[R].
3949 .RS 2
3950 .PP
3951 For example, it is possible to have a path with a space, such as
3952 \f[CB]c:\\Program\ Files\f[R] that can be specified as either
3953 \f[CB]"c:\\\\Program\ Files"\f[R] or, to avoid an escape,
3954 \f[CB]c:\\Program"\ "Files\f[R].
3955 .RE
3956 .IP \[bu] 2
3957 Any option that contains spaces, such as a path component, must be
3958 within quotation marks using quotation (\[aq]"\[aq]) characters in its
3959 entirety.
3960 .IP \[bu] 2
3961 A string within quotation marks may contain the characters \f[CB]\\n\f[R],
3962 \f[CB]\\r\f[R], \f[CB]\\t\f[R], and \f[CB]\\f\f[R].
3963 They are converted to their respective ASCII codes.
3964 \ 
3965 .IP \[bu] 2
3966 If a file name contains embedded spaces, then put the whole file name in
3967 double quotation marks.
3968 .IP \[bu] 2
3969 File names in an argument file are relative to the current directory,
3970 not to the location of the argument file.
3971 .IP \[bu] 2
3972 Use the number sign \f[CB]#\f[R] in the argument file to identify
3973 comments.
3974 All characters following the \f[CB]#\f[R] are ignored until the end of
3975 line.
3976 .IP \[bu] 2
3977 Additional at sign \f[CB]\@\f[R] prefixes to \f[CB]\@\f[R] prefixed options
3978 act as an escape, (the first \f[CB]\@\f[R] is removed and the rest of the
3979 arguments are presented to the launcher literally).
3980 .IP \[bu] 2
3981 Lines may be continued using the continuation character (\f[CB]\\\f[R]) at
3982 the end\-of\-line.
3983 The two lines are concatenated with the leading white spaces trimmed.
3984 To prevent trimming the \ leading white spaces, a continuation character
3985 (\f[CB]\\\f[R]) may be placed at the first column.
3986 .IP \[bu] 2
3987 Because backslash (\\) is an escape character, a backslash
3988 character\ must be escaped with another backslash character.
3989 .IP \[bu] 2
3990 Partial quote is allowed and is closed by an end\-of\-file.
3991 .IP \[bu] 2
3992 An open quote stops at end\-of\-line unless \f[CB]\\\f[R] is the last
3993 character, which then joins the next line by removing all leading white
3994 space characters.
3995 .IP \[bu] 2
3996 Wildcards (*) aren\[aq]t allowed in these lists (such as specifying
3997 \f[CB]*.java\f[R]).
3998 .IP \[bu] 2
3999 Use of the at sign (\f[CB]\@\f[R]) to recursively interpret files
4000 isn\[aq]t supported.
4001 .SS Example of Open or Partial Quotes in an Argument File
4002 .PP
4003 In the argument file,
4004 .IP
4005 .nf
4006 \f[CB]
4007 \-cp\ "lib/
4008 cool/
4009 app/
4010 jars
4011 \f[R]
4012 .fi
4013 .PP
4014 this is interpreted as:
4015 .RS
4016 .PP
4017 \f[CB]\-cp\ lib/cool/app/jars\f[R]
4018 .RE
4019 .SS Example of a Backslash Character\ Escaped with Another Backslash
4020 Character in an Argument File
4021 .PP
4022 To output the following:
4023 .RS
4024 .PP
4025 \f[CB]\-cp\ c:\\Program\ Files\ (x86)\\Java\\jre\\lib\\ext;c:\\Program\ Files\\Java\\jre9\\lib\\ext\f[R]
4026 .RE
4027 .PP
4028 The backslash character must be specified in the argument file as:
4029 .RS
4030 .PP
4031 \f[CB]\-cp\ \ "c:\\\\Program\ Files\ (x86)\\\\Java\\\\jre\\\\lib\\\\ext;c:\\\\Program\ Files\\\\Java\\\\jre9\\\\lib\\\\ext"\f[R]
4032 .RE
4033 .SS Example of an EOL Escape Used to Force Concatenation of Lines in an
4034 Argument File
4035 .PP
4036 In the argument file,
4037 .IP
4038 .nf
4039 \f[CB]
4040 \-cp\ "/lib/cool\ app/jars:\\
4041 \ \ \ \ /lib/another\ app/jars"
4042 \f[R]
4043 .fi
4044 .PP
4045 This is interpreted as:
4046 .RS
4047 .PP
4048 \f[CB]\-cp\ /lib/cool\ app/jars:/lib/another\ app/jars\f[R]
4049 .RE
4050 .SS Example of Line Continuation with Leading Spaces in an Argument File
4051 .PP
4052 In the argument file,
4053 .IP
4054 .nf
4055 \f[CB]
4056 \-cp\ "/lib/cool\\
4057 \\app/jars”
4058 \f[R]
4059 .fi
4060 .PP
4061 This is interpreted as:
4062 .PP
4063 \f[CB]\-cp\ /lib/cool\ app/jars\f[R]
4064 .SS Examples of Using Single Argument File
4065 .PP
4066 You can use a single argument file, such as \f[CB]myargumentfile\f[R] in
4067 the following example, to hold all required \f[CB]java\f[R] arguments:
4068 .RS
4069 .PP
4070 \f[CB]java\ \@myargumentfile\f[R]
4071 .RE
4072 .SS Examples of Using Argument Files with Paths
4073 .PP
4074 You can include relative paths in argument files; however, they\[aq]re
4075 relative to the current working directory and not to the paths of the
4076 argument files themselves.
4077 In the following example, \f[CB]path1/options\f[R] and
4078 \f[CB]path2/options\f[R] represent argument files with different paths.
4079 Any relative paths that they contain are relative to the current working
4080 directory and not to the argument files:
4081 .RS
4082 .PP
4083 \f[CB]java\ \@path1/options\ \@path2/classes\f[R]
4084 .RE
4085 .SH CODE HEAP STATE ANALYTICS
4086 .SS Overview
4087 .PP
4088 There are occasions when having insight into the current state of the
4089 JVM code heap would be helpful to answer questions such as:
4090 .IP \[bu] 2
4091 Why was the JIT turned off and then on again and again?
4092 .IP \[bu] 2
4093 Where has all the code heap space gone?
4094 .IP \[bu] 2
4095 Why is the method sweeper not working effectively?
4096 .PP
4097 To provide this insight, a code heap state analytics feature has been
4098 implemented that enables on\-the\-fly analysis of the code heap.
4099 The analytics process is divided into two parts.
4100 The first part examines the entire code heap and aggregates all
4101 information that is believed to be useful or important.
4102 The second part consists of several independent steps that print the
4103 collected information with an emphasis on different aspects of the data.
4104 Data collection and printing are done on an "on request" basis.
4105 .SS Syntax
4106 .PP
4107 Requests for real\-time, on\-the\-fly analysis can be issued with the
4108 following command:
4109 .RS
4110 .PP
4111 \f[CB]jcmd\f[R] \f[I]pid\f[R] \f[CB]Compiler.CodeHeap_Analytics\f[R]
4112 [\f[I]function\f[R]] [\f[I]granularity\f[R]]
4113 .RE
4114 .PP
4115 If you are only interested in how the code heap looks like after running
4116 a sample workload, you can use the command line option:
4117 .RS
4118 .PP
4119 \f[CB]\-Xlog:codecache=Trace\f[R]
4120 .RE
4121 .PP
4122 To see the code heap state when a "CodeCache full" condition exists,
4123 start the VM with the command line option:
4124 .RS
4125 .PP
4126 \f[CB]\-Xlog:codecache=Debug\f[R]
4127 .RE
4128 .PP
4129 See \f[B]CodeHeap State Analytics (OpenJDK)\f[R]
4130 [https://bugs.openjdk.java.net/secure/attachment/75649/JVM_CodeHeap_StateAnalytics_V2.pdf]
4131 for a detailed description of the code heap state analytics feature, the
4132 supported functions, and the granularity options.
4133 .SH ENABLE LOGGING WITH THE JVM UNIFIED LOGGING FRAMEWORK
4134 .PP
4135 You use the \f[CB]\-Xlog\f[R] option to configure or enable logging with
4136 the Java Virtual Machine (JVM) unified logging framework.
4137 .SS Synopsis
4138 .RS
4139 .PP
4140 \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]...]]]]]
4141 .RE
4142 .TP
4143 .B \f[I]what\f[R]
4144 Specifies a combination of tags and levels of the form
4145 \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]...].
4146 Unless the wildcard (\f[CB]*\f[R]) is specified, only log messages tagged
4147 with exactly the tags specified are matched.
4148 See \f[B]\-Xlog Tags and Levels\f[R].
4149 .RS
4150 .RE
4151 .TP
4152 .B \f[I]output\f[R]
4153 Sets the type of output.
4154 Omitting the \f[I]output\f[R] type defaults to \f[CB]stdout\f[R].
4155 See \f[B]\-Xlog Output\f[R].
4156 .RS
4157 .RE
4158 .TP
4159 .B \f[I]decorators\f[R]
4160 Configures the output to use a custom set of decorators.
4161 Omitting \f[I]decorators\f[R] defaults to \f[CB]uptime\f[R],
4162 \f[CB]level\f[R], and \f[CB]tags\f[R].
4163 See \f[B]Decorations\f[R].
4164 .RS
4165 .RE
4166 .TP
4167 .B \f[I]output\-options\f[R]
4168 Sets the \f[CB]\-Xlog\f[R] logging output options.
4169 .RS
4170 .RE
4171 .SS Description
4172 .PP
4173 The Java Virtual Machine (JVM) unified logging framework provides a
4174 common logging system for all components of the JVM.
4175 GC logging for the JVM has been changed to use the new logging
4176 framework.
4177 The mapping of old GC flags to the corresponding new Xlog configuration
4178 is described in \f[B]Convert GC Logging Flags to Xlog\f[R].
4179 In addition, runtime logging has also been changed to use the JVM
4180 unified logging framework.
4181 The mapping of legacy runtime logging flags to the corresponding new
4182 Xlog configuration is described in \f[B]Convert Runtime Logging Flags to
4183 Xlog\f[R].
4184 .PP
4185 The following provides quick reference to the \f[CB]\-Xlog\f[R] command
4186 and syntax for options:
4187 .TP
4188 .B \f[CB]\-Xlog\f[R]
4189 Enables JVM logging on an \f[CB]info\f[R] level.
4190 .RS
4191 .RE
4192 .TP
4193 .B \f[CB]\-Xlog:help\f[R]
4194 Prints \f[CB]\-Xlog\f[R] usage syntax and available tags, levels, and
4195 decorators along with example command lines with explanations.
4196 .RS
4197 .RE
4198 .TP
4199 .B \f[CB]\-Xlog:disable\f[R]
4200 Turns off all logging and clears all configuration of the logging
4201 framework including the default configuration for warnings and errors.
4202 .RS
4203 .RE
4204 .TP
4205 .B \f[CB]\-Xlog\f[R][\f[CB]:\f[R]\f[I]option\f[R]]
4206 Applies multiple arguments in the order that they appear on the command
4207 line.
4208 Multiple \f[CB]\-Xlog\f[R] arguments for the same output override each
4209 other in their given order.
4210 .RS
4211 .PP
4212 The \f[I]option\f[R] is set as:
4213 .RS
4214 .PP
4215 [\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]]]]
4216 .RE
4217 .PP
4218 Omitting the \f[I]tag\-selection\f[R] defaults to a tag\-set of
4219 \f[CB]all\f[R] and a level of \f[CB]info\f[R].
4220 .RS
4221 .PP
4222 \f[I]tag\f[R][\f[CB]+\f[R]...] \f[CB]all\f[R]
4223 .RE
4224 .PP
4225 The \f[CB]all\f[R] tag is a meta tag consisting of all tag\-sets
4226 available.
4227 The asterisk \f[CB]*\f[R] in a tag set definition denotes a wildcard tag
4228 match.
4229 Matching with a wildcard selects all tag sets that contain \f[I]at
4230 least\f[R] the specified tags.
4231 Without the wildcard, only exact matches of the specified tag sets are
4232 selected.
4233 .PP
4234 \f[I]output\-options\f[R] is
4235 .RS
4236 .PP
4237 \f[CB]filecount=\f[R]\f[I]file\-count\f[R] \f[CB]filesize=\f[R]\f[I]file size
4238 with optional K, M or G suffix\f[R]
4239 .RE
4240 .RE
4241 .SS Default Configuration
4242 .PP
4243 When the \f[CB]\-Xlog\f[R] option and nothing else is specified on the
4244 command line, the default configuration is used.
4245 The default configuration logs all messages with a level that matches
4246 either warning or error regardless of what tags the message is
4247 associated with.
4248 The default configuration is equivalent to entering the following on the
4249 command line:
4250 .RS
4251 .PP
4252 \f[CB]\-Xlog:all=warning:stdout:uptime,level,tags\f[R]
4253 .RE
4254 .SS Controlling Logging at Runtime
4255 .PP
4256 Logging can also be controlled at run time through Diagnostic Commands
4257 (with the \f[B]jcmd\f[R] utility).
4258 Everything that can be specified on the command line can also be
4259 specified dynamically with the \f[CB]VM.log\f[R] command.
4260 As the diagnostic commands are automatically exposed as MBeans, you can
4261 use JMX to change logging configuration at run time.
4262 .SS \-Xlog Tags and Levels
4263 .PP
4264 Each log message has a level and a tag set associated with it.
4265 The level of the message corresponds to its details, and the tag set
4266 corresponds to what the message contains or which JVM component it
4267 involves (such as, \f[CB]gc\f[R], \f[CB]jit\f[R], or \f[CB]os\f[R]).
4268 Mapping GC flags to the Xlog configuration is described in \f[B]Convert
4269 GC Logging Flags to Xlog\f[R].
4270 Mapping legacy runtime logging flags to the corresponding Xlog
4271 configuration is described in \f[B]Convert Runtime Logging Flags to
4272 Xlog\f[R].
4273 .PP
4274 \f[B]Available log levels:\f[R]
4275 .IP \[bu] 2
4276 \f[CB]off\f[R]
4277 .IP \[bu] 2
4278 \f[CB]trace\f[R]
4279 .IP \[bu] 2
4280 \f[CB]debug\f[R]
4281 .IP \[bu] 2
4282 \f[CB]info\f[R]
4283 .IP \[bu] 2
4284 \f[CB]warning\f[R]
4285 .IP \[bu] 2
4286 \f[CB]error\f[R]
4287 .PP
4288 \f[B]Available log tags:\f[R]
4289 .PP
4290 There are literally dozens of log tags, which in the right combinations,
4291 will enable a range of logging output.
4292 The full set of available log tags can be seen using
4293 \f[CB]\-Xlog:help\f[R].
4294 Specifying \f[CB]all\f[R] instead of a tag combination matches all tag
4295 combinations.
4296 .SS \-Xlog Output
4297 .PP
4298 The \f[CB]\-Xlog\f[R] option supports the following types of outputs:
4299 .IP \[bu] 2
4300 \f[CB]stdout\f[R] \-\-\- Sends output to stdout
4301 .IP \[bu] 2
4302 \f[CB]stderr\f[R] \-\-\- Sends output to stderr
4303 .IP \[bu] 2
4304 \f[CB]file=\f[R]\f[I]filename\f[R] \-\-\- Sends output to text file(s).
4305 .PP
4306 When using \f[CB]file=\f[R]\f[I]filename\f[R], specifying \f[CB]%p\f[R]
4307 and/or \f[CB]%t\f[R] in the file name expands to the JVM\[aq]s PID and
4308 startup timestamp, respectively.
4309 You can also configure text files to handle file rotation based on file
4310 size and a number of files to rotate.
4311 For example, to rotate the log file every 10 MB and keep 5 files in
4312 rotation, specify the options \f[CB]filesize=10M,\ filecount=5\f[R].
4313 The target size of the files isn\[aq]t guaranteed to be exact, it\[aq]s
4314 just an approximate value.
4315 Files are rotated by default with up to 5 rotated files of target size
4316 20 MB, unless configured otherwise.
4317 Specifying \f[CB]filecount=0\f[R] means that the log file shouldn\[aq]t be
4318 rotated.
4319 There\[aq]s a possibility of the pre\-existing log file getting
4320 overwritten.
4321 .SS Decorations
4322 .PP
4323 Logging messages are decorated with information about the message.
4324 You can configure each output to use a custom set of decorators.
4325 The order of the output is always the same as listed in the table.
4326 You can configure the decorations to be used at run time.
4327 Decorations are prepended to the log message.
4328 For example:
4329 .IP
4330 .nf
4331 \f[CB]
4332 [6.567s][info][gc,old]\ Old\ collection\ complete
4333 \f[R]
4334 .fi
4335 .PP
4336 Omitting \f[CB]decorators\f[R] defaults to \f[CB]uptime\f[R],
4337 \f[CB]level\f[R], and \f[CB]tags\f[R].
4338 The \f[CB]none\f[R] decorator is special and is used to turn off all
4339 decorations.
4340 .PP
4341 \f[CB]time\f[R] (\f[CB]t\f[R]), \f[CB]utctime\f[R] (\f[CB]utc\f[R]),
4342 \f[CB]uptime\f[R] (\f[CB]u\f[R]), \f[CB]timemillis\f[R] (\f[CB]tm\f[R]),
4343 \f[CB]uptimemillis\f[R] (\f[CB]um\f[R]), \f[CB]timenanos\f[R] (\f[CB]tn\f[R]),
4344 \f[CB]uptimenanos\f[R] (\f[CB]un\f[R]), \f[CB]hostname\f[R] (\f[CB]hn\f[R]),
4345 \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]
4346 (\f[CB]l\f[R]), \f[CB]tags\f[R] (\f[CB]tg\f[R]) decorators can also be
4347 specified as \f[CB]none\f[R] for no decoration.
4348 .PP
4349 .TS
4350 tab(@);
4351 lw(14.9n) lw(55.1n).
4352 T{
4353 Decorations
4354 T}@T{
4355 Description
4356 T}
4357 _
4358 T{
4359 \f[CB]time\f[R] or \f[CB]t\f[R]
4360 T}@T{
4361 Current time and date in ISO\-8601 format.
4362 T}
4363 T{
4364 \f[CB]utctime\f[R] or \f[CB]utc\f[R]
4365 T}@T{
4366 Universal Time Coordinated or Coordinated Universal Time.
4367 T}
4368 T{
4369 \f[CB]uptime\f[R] or \f[CB]u\f[R]
4370 T}@T{
4371 Time since the start of the JVM in seconds and milliseconds.
4372 For example, 6.567s.
4373 T}
4374 T{
4375 \f[CB]timemillis\f[R] or \f[CB]tm\f[R]
4376 T}@T{
4377 The same value as generated by \f[CB]System.currentTimeMillis()\f[R]
4378 T}
4379 T{
4380 \f[CB]uptimemillis\f[R] or \f[CB]um\f[R]
4381 T}@T{
4382 Milliseconds since the JVM started.
4383 T}
4384 T{
4385 \f[CB]timenanos\f[R] or \f[CB]tn\f[R]
4386 T}@T{
4387 The same value generated by \f[CB]System.nanoTime()\f[R].
4388 T}
4389 T{
4390 \f[CB]uptimenanos\f[R] or \f[CB]un\f[R]
4391 T}@T{
4392 Nanoseconds since the JVM started.
4393 T}
4394 T{
4395 \f[CB]hostname\f[R] or \f[CB]hn\f[R]
4396 T}@T{
4397 The host name.
4398 T}
4399 T{
4400 \f[CB]pid\f[R] or \f[CB]p\f[R]
4401 T}@T{
4402 The process identifier.
4403 T}
4404 T{
4405 \f[CB]tid\f[R] or \f[CB]ti\f[R]
4406 T}@T{
4407 The thread identifier.
4408 T}
4409 T{
4410 \f[CB]level\f[R] or \f[CB]l\f[R]
4411 T}@T{
4412 The level associated with the log message.
4413 T}
4414 T{
4415 \f[CB]tags\f[R] or \f[CB]tg\f[R]
4416 T}@T{
4417 The tag\-set associated with the log message.
4418 T}
4419 .TE
4420 .SS Convert GC Logging Flags to Xlog
4421 .PP
4422 .TS
4423 tab(@);
4424 lw(22.4n) lw(16.5n) lw(31.2n).
4425 T{
4426 Legacy Garbage Collection (GC) Flag
4427 T}@T{
4428 Xlog Configuration
4429 T}@T{
4430 Comment
4431 T}
4432 _
4433 T{
4434 \f[CB]G1PrintHeapRegions\f[R]
4435 T}@T{
4436 \f[CB]\-Xlog:gc+region=trace\f[R]
4437 T}@T{
4438 Not Applicable
4439 T}
4440 T{
4441 \f[CB]GCLogFileSize\f[R]
4442 T}@T{
4443 No configuration available
4444 T}@T{
4445 Log rotation is handled by the framework.
4446 T}
4447 T{
4448 \f[CB]NumberOfGCLogFiles\f[R]
4449 T}@T{
4450 Not Applicable
4451 T}@T{
4452 Log rotation is handled by the framework.
4453 T}
4454 T{
4455 \f[CB]PrintAdaptiveSizePolicy\f[R]
4456 T}@T{
4457 \f[CB]\-Xlog:gc+ergo*=\f[R]\f[I]level\f[R]
4458 T}@T{
4459 Use a \f[I]level\f[R] of \f[CB]debug\f[R] for most of the information, or a
4460 \f[I]level\f[R] of \f[CB]trace\f[R] for all of what was logged for
4461 \f[CB]PrintAdaptiveSizePolicy\f[R].
4462 T}
4463 T{
4464 \f[CB]PrintGC\f[R]
4465 T}@T{
4466 \f[CB]\-Xlog:gc\f[R]
4467 T}@T{
4468 Not Applicable
4469 T}
4470 T{
4471 \f[CB]PrintGCApplicationConcurrentTime\f[R]
4472 T}@T{
4473 \f[CB]\-Xlog:safepoint\f[R]
4474 T}@T{
4475 Note that \f[CB]PrintGCApplicationConcurrentTime\f[R] and
4476 \f[CB]PrintGCApplicationStoppedTime\f[R] are logged on the same tag and
4477 aren\[aq]t separated in the new logging.
4478 T}
4479 T{
4480 \f[CB]PrintGCApplicationStoppedTime\f[R]
4481 T}@T{
4482 \f[CB]\-Xlog:safepoint\f[R]
4483 T}@T{
4484 Note that \f[CB]PrintGCApplicationConcurrentTime\f[R] and
4485 \f[CB]PrintGCApplicationStoppedTime\f[R] are logged on the same tag and
4486 not separated in the new logging.
4487 T}
4488 T{
4489 \f[CB]PrintGCCause\f[R]
4490 T}@T{
4491 Not Applicable
4492 T}@T{
4493 GC cause is now always logged.
4494 T}
4495 T{
4496 \f[CB]PrintGCDateStamps\f[R]
4497 T}@T{
4498 Not Applicable
4499 T}@T{
4500 Date stamps are logged by the framework.
4501 T}
4502 T{
4503 \f[CB]PrintGCDetails\f[R]
4504 T}@T{
4505 \f[CB]\-Xlog:gc*\f[R]
4506 T}@T{
4507 Not Applicable
4508 T}
4509 T{
4510 \f[CB]PrintGCID\f[R]
4511 T}@T{
4512 Not Applicable
4513 T}@T{
4514 GC ID is now always logged.
4515 T}
4516 T{
4517 \f[CB]PrintGCTaskTimeStamps\f[R]
4518 T}@T{
4519 \f[CB]\-Xlog:gc+task*=debug\f[R]
4520 T}@T{
4521 Not Applicable
4522 T}
4523 T{
4524 \f[CB]PrintGCTimeStamps\f[R]
4525 T}@T{
4526 Not Applicable
4527 T}@T{
4528 Time stamps are logged by the framework.
4529 T}
4530 T{
4531 \f[CB]PrintHeapAtGC\f[R]
4532 T}@T{
4533 \f[CB]\-Xlog:gc+heap=trace\f[R]
4534 T}@T{
4535 Not Applicable
4536 T}
4537 T{
4538 \f[CB]PrintReferenceGC\f[R]
4539 T}@T{
4540 \f[CB]\-Xlog:gc+ref*=debug\f[R]
4541 T}@T{
4542 Note that in the old logging, \f[CB]PrintReferenceGC\f[R] had an effect
4543 only if \f[CB]PrintGCDetails\f[R] was also enabled.
4544 T}
4545 T{
4546 \f[CB]PrintStringDeduplicationStatistics\f[R]
4547 T}@T{
4548 `\-Xlog:gc+stringdedup*=debug
4549 T}@T{
4550 ` Not Applicable
4551 T}
4552 T{
4553 \f[CB]PrintTenuringDistribution\f[R]
4554 T}@T{
4555 \f[CB]\-Xlog:gc+age*=\f[R]\f[I]level\f[R]
4556 T}@T{
4557 Use a \f[I]level\f[R] of \f[CB]debug\f[R] for the most relevant
4558 information, or a \f[I]level\f[R] of \f[CB]trace\f[R] for all of what was
4559 logged for \f[CB]PrintTenuringDistribution\f[R].
4560 T}
4561 T{
4562 \f[CB]UseGCLogFileRotation\f[R]
4563 T}@T{
4564 Not Applicable
4565 T}@T{
4566 What was logged for \f[CB]PrintTenuringDistribution\f[R].
4567 T}
4568 .TE
4569 .SS Convert Runtime Logging Flags to Xlog
4570 .PP
4571 .TS
4572 tab(@);
4573 lw(15.0n) lw(20.2n) lw(34.7n).
4574 T{
4575 Legacy Runtime Flag
4576 T}@T{
4577 Xlog Configuration
4578 T}@T{
4579 Comment
4580 T}
4581 _
4582 T{
4583 \f[CB]TraceExceptions\f[R]
4584 T}@T{
4585 \f[CB]\-Xlog:exceptions=info\f[R]
4586 T}@T{
4587 Not Applicable
4588 T}
4589 T{
4590 \f[CB]TraceClassLoading\f[R]
4591 T}@T{
4592 \f[CB]\-Xlog:class+load=\f[R]\f[I]level\f[R]
4593 T}@T{
4594 Use \f[I]level\f[R]=\f[CB]info\f[R] for regular information, or
4595 \f[I]level\f[R]=\f[CB]debug\f[R] for additional information.
4596 In Unified Logging syntax, \f[CB]\-verbose:class\f[R] equals
4597 \f[CB]\-Xlog:class+load=info,class+unload=info\f[R].
4598 T}
4599 T{
4600 \f[CB]TraceClassLoadingPreorder\f[R]
4601 T}@T{
4602 \f[CB]\-Xlog:class+preorder=debug\f[R]
4603 T}@T{
4604 Not Applicable
4605 T}
4606 T{
4607 \f[CB]TraceClassUnloading\f[R]
4608 T}@T{
4609 \f[CB]\-Xlog:class+unload=\f[R]\f[I]level\f[R]
4610 T}@T{
4611 Use \f[I]level\f[R]=\f[CB]info\f[R] for regular information, or
4612 \f[I]level\f[R]=\f[CB]trace\f[R] for additional information.
4613 In Unified Logging syntax, \f[CB]\-verbose:class\f[R] equals
4614 \f[CB]\-Xlog:class+load=info,class+unload=info\f[R].
4615 T}
4616 T{
4617 \f[CB]VerboseVerification\f[R]
4618 T}@T{
4619 \f[CB]\-Xlog:verification=info\f[R]
4620 T}@T{
4621 Not Applicable
4622 T}
4623 T{
4624 \f[CB]TraceClassPaths\f[R]
4625 T}@T{
4626 \f[CB]\-Xlog:class+path=info\f[R]
4627 T}@T{
4628 Not Applicable
4629 T}
4630 T{
4631 \f[CB]TraceClassResolution\f[R]
4632 T}@T{
4633 \f[CB]\-Xlog:class+resolve=debug\f[R]
4634 T}@T{
4635 Not Applicable
4636 T}
4637 T{
4638 \f[CB]TraceClassInitialization\f[R]
4639 T}@T{
4640 \f[CB]\-Xlog:class+init=info\f[R]
4641 T}@T{
4642 Not Applicable
4643 T}
4644 T{
4645 \f[CB]TraceLoaderConstraints\f[R]
4646 T}@T{
4647 \f[CB]\-Xlog:class+loader+constraints=info\f[R]
4648 T}@T{
4649 Not Applicable
4650 T}
4651 T{
4652 \f[CB]TraceClassLoaderData\f[R]
4653 T}@T{
4654 \f[CB]\-Xlog:class+loader+data=\f[R]\f[I]level\f[R]
4655 T}@T{
4656 Use \f[I]level\f[R]=\f[CB]debug\f[R] for regular information or
4657 \f[I]level\f[R]=\f[CB]trace\f[R] for additional information.
4658 T}
4659 T{
4660 \f[CB]TraceSafepointCleanupTime\f[R]
4661 T}@T{
4662 \f[CB]\-Xlog:safepoint+cleanup=info\f[R]
4663 T}@T{
4664 Not Applicable
4665 T}
4666 T{
4667 \f[CB]TraceSafepoint\f[R]
4668 T}@T{
4669 \f[CB]\-Xlog:safepoint=debug\f[R]
4670 T}@T{
4671 Not Applicable
4672 T}
4673 T{
4674 \f[CB]TraceMonitorInflation\f[R]
4675 T}@T{
4676 \f[CB]\-Xlog:monitorinflation=debug\f[R]
4677 T}@T{
4678 Not Applicable
4679 T}
4680 T{
4681 \f[CB]TraceBiasedLocking\f[R]
4682 T}@T{
4683 \f[CB]\-Xlog:biasedlocking=\f[R]\f[I]level\f[R]
4684 T}@T{
4685 Use \f[I]level\f[R]=\f[CB]info\f[R] for regular information, or
4686 \f[I]level\f[R]=\f[CB]trace\f[R] for additional information.
4687 T}
4688 T{
4689 \f[CB]TraceRedefineClasses\f[R]
4690 T}@T{
4691 \f[CB]\-Xlog:redefine+class*=\f[R]\f[I]level\f[R]
4692 T}@T{
4693 \f[I]level\f[R]=\f[CB]info\f[R], \f[CB]debug\f[R], and \f[CB]trace\f[R] provide
4694 increasing amounts of information.
4695 T}
4696 .TE
4697 .SS \-Xlog Usage Examples
4698 .PP
4699 The following are \f[CB]\-Xlog\f[R] examples.
4700 .TP
4701 .B \f[CB]\-Xlog\f[R]
4702 Logs all messages by using the \f[CB]info\f[R] level to \f[CB]stdout\f[R]
4703 with \f[CB]uptime\f[R], \f[CB]levels\f[R], and \f[CB]tags\f[R] decorations.
4704 This is equivalent to using:
4705 .RS
4706 .RS
4707 .PP
4708 \f[CB]\-Xlog:all=info:stdout:uptime,levels,tags\f[R]
4709 .RE
4710 .RE
4711 .TP
4712 .B \f[CB]\-Xlog:gc\f[R]
4713 Logs messages tagged with the \f[CB]gc\f[R] tag using \f[CB]info\f[R] level
4714 to \f[CB]stdout\f[R].
4715 The default configuration for all other messages at level
4716 \f[CB]warning\f[R] is in effect.
4717 .RS
4718 .RE
4719 .TP
4720 .B \f[CB]\-Xlog:gc,safepoint\f[R]
4721 Logs messages tagged either with the \f[CB]gc\f[R] or \f[CB]safepoint\f[R]
4722 tags, both using the \f[CB]info\f[R] level, to \f[CB]stdout\f[R], with
4723 default decorations.
4724 Messages tagged with both \f[CB]gc\f[R] and \f[CB]safepoint\f[R] won\[aq]t
4725 be logged.
4726 .RS
4727 .RE
4728 .TP
4729 .B \f[CB]\-Xlog:gc+ref=debug\f[R]
4730 Logs messages tagged with both \f[CB]gc\f[R] and \f[CB]ref\f[R] tags, using
4731 the \f[CB]debug\f[R] level to \f[CB]stdout\f[R], with default decorations.
4732 Messages tagged only with one of the two tags won\[aq]t be logged.
4733 .RS
4734 .RE
4735 .TP
4736 .B \f[CB]\-Xlog:gc=debug:file=gc.txt:none\f[R]
4737 Logs messages tagged with the \f[CB]gc\f[R] tag using the \f[CB]debug\f[R]
4738 level to a file called \f[CB]gc.txt\f[R] with no decorations.
4739 The default configuration for all other messages at level
4740 \f[CB]warning\f[R] is still in effect.
4741 .RS
4742 .RE
4743 .TP
4744 .B \f[CB]\-Xlog:gc=trace:file=gctrace.txt:uptimemillis,pids:filecount=5,filesize=1024\f[R]
4745 Logs messages tagged with the \f[CB]gc\f[R] tag using the \f[CB]trace\f[R]
4746 level to a rotating file set with 5 files with size 1 MB with the base
4747 name \f[CB]gctrace.txt\f[R] and uses decorations \f[CB]uptimemillis\f[R] and
4748 \f[CB]pid\f[R].
4749 .RS
4750 .PP
4751 The default configuration for all other messages at level
4752 \f[CB]warning\f[R] is still in effect.
4753 .RE
4754 .TP
4755 .B \f[CB]\-Xlog:gc::uptime,tid\f[R]
4756 Logs messages tagged with the \f[CB]gc\f[R] tag using the default
4757 \[aq]info\[aq] level to default the output \f[CB]stdout\f[R] and uses
4758 decorations \f[CB]uptime\f[R] and \f[CB]tid\f[R].
4759 The default configuration for all other messages at level
4760 \f[CB]warning\f[R] is still in effect.
4761 .RS
4762 .RE
4763 .TP
4764 .B \f[CB]\-Xlog:gc*=info,safepoint*=off\f[R]
4765 Logs messages tagged with at least \f[CB]gc\f[R] using the \f[CB]info\f[R]
4766 level, but turns off logging of messages tagged with \f[CB]safepoint\f[R].
4767 Messages tagged with both \f[CB]gc\f[R] and \f[CB]safepoint\f[R] won\[aq]t
4768 be logged.
4769 .RS
4770 .RE
4771 .TP
4772 .B \f[CB]\-Xlog:disable\ \-Xlog:safepoint=trace:safepointtrace.txt\f[R]
4773 Turns off all logging, including warnings and errors, and then enables
4774 messages tagged with \f[CB]safepoint\f[R]using \f[CB]trace\f[R]level to the
4775 file \f[CB]safepointtrace.txt\f[R].
4776 The default configuration doesn\[aq]t apply, because the command line
4777 started with \f[CB]\-Xlog:disable\f[R].
4778 .RS
4779 .RE
4780 .SS Complex \-Xlog Usage Examples
4781 .PP
4782 The following describes a few complex examples of using the
4783 \f[CB]\-Xlog\f[R] option.
4784 .TP
4785 .B \f[CB]\-Xlog:gc+class*=debug\f[R]
4786 Logs messages tagged with at least \f[CB]gc\f[R] and \f[CB]class\f[R] tags
4787 using the \f[CB]debug\f[R] level to \f[CB]stdout\f[R].
4788 The default configuration for all other messages at the level
4789 \f[CB]warning\f[R] is still in effect
4790 .RS
4791 .RE
4792 .TP
4793 .B \f[CB]\-Xlog:gc+meta*=trace,class*=off:file=gcmetatrace.txt\f[R]
4794 Logs messages tagged with at least the \f[CB]gc\f[R] and \f[CB]meta\f[R]
4795 tags using the \f[CB]trace\f[R] level to the file \f[CB]metatrace.txt\f[R]
4796 but turns off all messages tagged with \f[CB]class\f[R].
4797 Messages tagged with \f[CB]gc\f[R], \f[CB]meta\f[R], and \f[CB]class\f[R]
4798 aren\[aq]t be logged as \f[CB]class*\f[R] is set to off.
4799 The default configuration for all other messages at level
4800 \f[CB]warning\f[R] is in effect except for those that include
4801 \f[CB]class\f[R].
4802 .RS
4803 .RE
4804 .TP
4805 .B \f[CB]\-Xlog:gc+meta=trace\f[R]
4806 Logs messages tagged with exactly the \f[CB]gc\f[R] and \f[CB]meta\f[R] tags
4807 using the \f[CB]trace\f[R] level to \f[CB]stdout\f[R].
4808 The default configuration for all other messages at level
4809 \f[CB]warning\f[R] is still be in effect.
4810 .RS
4811 .RE
4812 .TP
4813 .B \f[CB]\-Xlog:gc+class+heap*=debug,meta*=warning,threads*=off\f[R]
4814 Logs messages tagged with at least \f[CB]gc\f[R], \f[CB]class\f[R], and
4815 \f[CB]heap\f[R] tags using the \f[CB]trace\f[R] level to \f[CB]stdout\f[R] but
4816 only log messages tagged with \f[CB]meta\f[R] with level.
4817 The default configuration for all other messages at the level
4818 \f[CB]warning\f[R] is in effect except for those that include
4819 \f[CB]threads\f[R].
4820 .RS
4821 .RE
4822 .SH VALIDATE JAVA VIRTUAL MACHINE FLAG ARGUMENTS
4823 .PP
4824 You use values provided to all Java Virtual Machine (JVM) command\-line
4825 flags for validation and, if the input value is invalid or
4826 out\-of\-range, then an appropriate error message is displayed.
4827 .PP
4828 Whether they\[aq]re set ergonomically, in a command line, by an input
4829 tool, or through the APIs (for example, classes contained in the package
4830 \f[CB]java.lang.management\f[R]) the values provided to all Java Virtual
4831 Machine (JVM) command\-line flags are validated.
4832 Ergonomics are described in Java Platform, Standard Edition HotSpot
4833 Virtual Machine Garbage Collection Tuning Guide.
4834 .PP
4835 Range and constraints are validated either when all flags have their
4836 values set during JVM initialization or a flag\[aq]s value is changed
4837 during runtime (for example using the \f[CB]jcmd\f[R] tool).
4838 The JVM is terminated if a value violates either the range or constraint
4839 check and an appropriate error message is printed on the error stream.
4840 .PP
4841 For example, if a flag violates a range or a constraint check, then the
4842 JVM exits with an error:
4843 .IP
4844 .nf
4845 \f[CB]
4846 java\ \-XX:AllocatePrefetchStyle=5\ \-version\ \ \ 
4847 intx\ AllocatePrefetchStyle=5\ is\ outside\ the\ allowed\ range\ [\ 0\ ...\ 3\ ]\ \ \ 
4848 Improperly\ specified\ VM\ option\ \[aq]AllocatePrefetchStyle=5\[aq]\ \ \ 
4849 Error:\ Could\ not\ create\ the\ Java\ Virtual\ Machine.\ \ 
4850 Error:\ A\ fatal\ exception\ has\ occurred.\ Program\ will\ exit.
4851 \f[R]
4852 .fi
4853 .PP
4854 The flag \f[CB]\-XX:+PrintFlagsRanges\f[R] prints the range of all the
4855 flags.
4856 This flag allows automatic testing of the flags by the values provided
4857 by the ranges.
4858 For the flags that have the ranges specified, the type, name, and the
4859 actual range is printed in the output.
4860 .PP
4861 For example,
4862 .IP
4863 .nf
4864 \f[CB]
4865 intx\ \ \ ThreadStackSize\ [\ 0\ ...\ 9007199254740987\ ]\ {pd\ product}
4866 \f[R]
4867 .fi
4868 .PP
4869 For the flags that don\[aq]t have the range specified, the values
4870 aren\[aq]t displayed in the print out.
4871 For example:
4872 .IP
4873 .nf
4874 \f[CB]
4875 size_t\ NewSize\ \ \ \ \ \ \ \ \ [\ \ \ ...\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ]\ {product}
4876 \f[R]
4877 .fi
4878 .PP
4879 This helps to identify the flags that need to be implemented.
4880 The automatic testing framework can skip those flags that don\[aq]t have
4881 values and aren\[aq]t implemented.
4882 .SH LARGE PAGES
4883 .PP
4884 You use large pages, also known as huge pages, as memory pages that are
4885 significantly larger than the standard memory page size (which varies
4886 depending on the processor and operating system).
4887 Large pages optimize processor Translation\-Lookaside Buffers.
4888 .PP
4889 A Translation\-Lookaside Buffer (TLB) is a page translation cache that
4890 holds the most\-recently used virtual\-to\-physical address
4891 translations.
4892 A TLB is a scarce system resource.
4893 A TLB miss can be costly because the processor must then read from the
4894 hierarchical page table, which may require multiple memory accesses.
4895 By using a larger memory page size, a single TLB entry can represent a
4896 larger memory range.
4897 This results in less pressure on a TLB, and memory\-intensive
4898 applications may have better performance.
4899 .PP
4900 However, large pages page memory can negatively affect system
4901 performance.
4902 For example, when a large mount of memory is pinned by an application,
4903 it may create a shortage of regular memory and cause excessive paging in
4904 other applications and slow down the entire system.
4905 Also, a system that has been up for a long time could produce excessive
4906 fragmentation, which could make it impossible to reserve enough large
4907 page memory.
4908 When this happens, either the OS or JVM reverts to using regular pages.
4909 .PP
4910 Oracle Solaris, Linux, and Windows support large pages.
4911 .SS Large Pages Support for Oracle Solaris
4912 .PP
4913 Oracle Solaris includes Multiple Page Size Support (MPSS).
4914 No additional configuration is necessary.
4915 .SS Large Pages Support for Linux
4916 .PP
4917 The 2.6 kernel supports large pages.
4918 Some vendors have backported the code to their 2.4\-based releases.
4919 To check if your system can support large page memory, try the
4920 following:
4921 .IP
4922 .nf
4923 \f[CB]
4924 #\ cat\ /proc/meminfo\ |\ grep\ Huge
4925 HugePages_Total:\ 0
4926 HugePages_Free:\ 0
4927 Hugepagesize:\ 2048\ kB
4928 \f[R]
4929 .fi
4930 .PP
4931 If the output shows the three "Huge" variables, then your system can
4932 support large page memory but it needs to be configured.
4933 If the command prints nothing, then your system doesn\[aq]t support
4934 large pages.
4935 To configure the system to use large page memory, login as
4936 \f[CB]root\f[R], and then follow these steps:
4937 .IP "1." 3
4938 If you\[aq]re using the option \f[CB]\-XX:+UseSHM\f[R] (instead of
4939 \f[CB]\-XX:+UseHugeTLBFS\f[R]), then increase the \f[CB]SHMMAX\f[R] value.
4940 It must be larger than the Java heap size.
4941 On a system with 4 GB of physical RAM (or less), the following makes all
4942 the memory sharable:
4943 .RS 4
4944 .RS
4945 .PP
4946 \f[CB]#\ echo\ 4294967295\ >\ /proc/sys/kernel/shmmax\f[R]
4947 .RE
4948 .RE
4949 .IP "2." 3
4950 If you\[aq]re using the option \f[CB]\-XX:+UseSHM\f[R] or
4951 \f[CB]\-XX:+UseHugeTLBFS\f[R], then specify the number of large pages.
4952 In the following example, 3 GB of a 4 GB system are reserved for large
4953 pages (assuming a large page size of 2048kB, then 3 GB = 3 * 1024 MB =
4954 3072 MB = 3072 * 1024 kB = 3145728 kB and 3145728 kB / 2048 kB = 1536):
4955 .RS 4
4956 .RS
4957 .PP
4958 \f[CB]#\ echo\ 1536\ >\ /proc/sys/vm/nr_hugepages\f[R]
4959 .RE
4960 .RS
4961 .PP
4962 \f[B]Note:\f[R] The values contained in \f[CB]/proc\f[R] resets after you
4963 reboot your system, so may want to set them in an initialization script
4964 (for example, \f[CB]rc.local\f[R] or \f[CB]sysctl.conf\f[R]).
4965 .RE
4966 .RE
4967 .IP \[bu] 2
4968 If you configure (or resize) the OS kernel parameters
4969 \f[CB]/proc/sys/kernel/shmmax\f[R] or \f[CB]/proc/sys/vm/nr_hugepages\f[R],
4970 Java processes may allocate large pages for areas in addition to the
4971 Java heap.
4972 These steps can allocate large pages for the following areas:
4973 .RS 2
4974 .IP \[bu] 2
4975 Java heap
4976 .IP \[bu] 2
4977 Code cache
4978 .IP \[bu] 2
4979 The marking bitmap data structure for the parallel GC
4980 .PP
4981 Consequently, if you configure the \f[CB]nr_hugepages\f[R] parameter to
4982 the size of the Java heap, then the JVM can fail in allocating the code
4983 cache areas on large pages because these areas are quite large in size.
4984 .RE
4985 .SS Large Pages Support for Windows
4986 .PP
4987 To use large pages support on Windows, the administrator must first
4988 assign additional privileges to the user who is running the application:
4989 .IP "1." 3
4990 Select \f[B]Control Panel\f[R], \f[B]Administrative Tools\f[R], and then
4991 \f[B]Local Security Policy\f[R].
4992 .IP "2." 3
4993 Select \f[B]Local Policies\f[R] and then \f[B]User Rights Assignment\f[R].
4994 .IP "3." 3
4995 Double\-click \f[B]Lock pages in memory\f[R], then add users and/or
4996 groups.
4997 .IP "4." 3
4998 Reboot your system.
4999 .PP
5000 Note that these steps are required even if it\[aq]s the administrator
5001 who\[aq]s running the application, because administrators by default
5002 don\[aq]t have the privilege to lock pages in memory.
5003 .SH APPLICATION CLASS DATA SHARING
5004 .PP
5005 Application Class Data Sharing (AppCDS) extends class data sharing (CDS)
5006 to enable application classes to be placed in a shared archive.
5007 .PP
5008 In addition to the core library classes, AppCDS supports \f[B]Class Data
5009 Sharing\f[R]
5010 [https://docs.oracle.com/en/java/javase/12/vm/class\-data\-sharing.html#GUID\-7EAA3411\-8CF0\-4D19\-BD05\-DF5E1780AA91]
5011 from the following locations:
5012 .IP \[bu] 2
5013 Platform classes from the runtime image
5014 .IP \[bu] 2
5015 Application classes from the runtime image
5016 .IP \[bu] 2
5017 Application classes from the class path
5018 .IP \[bu] 2
5019 Application classes from the module path
5020 .PP
5021 Archiving application classes provides better start up time at runtime.
5022 When running multiple JVM processes, AppCDS also reduces the runtime
5023 footprint with memory sharing for read\-only metadata.
5024 .PP
5025 CDS/AppCDS supports archiving classes from JAR files only.
5026 .PP
5027 Prior to JDK 11, a non\-empty directory was reported as a fatal error in
5028 the following conditions:
5029 .IP \[bu] 2
5030 For base CDS, a non\-empty directory cannot exist in the
5031 \f[CB]\-Xbootclasspath/a\f[R] path
5032 .IP \[bu] 2
5033 With \f[CB]\-XX:+UseAppCDS\f[R], a non\-empty directory could not exist in
5034 the \f[CB]\-Xbootclasspath/a\f[R] path, class path, and module path.
5035 .PP
5036 In JDK 11 and later, \f[CB]\-XX:+UseAppCDS\f[R] is obsolete and the
5037 behavior for a non\-empty directory is based on the class types in the
5038 classlist.
5039 A non\-empty directory is reported as a fatal error in the following
5040 conditions:
5041 .IP \[bu] 2
5042 If application classes or platform classes are not loaded, dump time
5043 only reports an error if a non\-empty directory exists in
5044 \f[CB]\-Xbootclasspath/a\f[R] path
5045 .IP \[bu] 2
5046 If application classes or platform classes are loaded, dump time reports
5047 an error for a non\-empty directory that exists in
5048 \f[CB]\-Xbootclasspath/a\f[R] path, class path, or module path
5049 .PP
5050 In JDK 11 and later, using
5051 \f[CB]\-XX:DumpLoadedClassList=\f[R]\f[I]class_list_file\f[R] results a
5052 generated classlist with all classes (both system library classes and
5053 application classes) included.
5054 You no longer have to specify \f[CB]\-XX:+UseAppCDS\f[R] with
5055 \f[CB]\-XX:DumpLoadedClassList\f[R] to produce a complete class list.
5056 .PP
5057 In JDK 11 and later, because \f[CB]UseAppCDS\f[R] is obsolete,
5058 \f[CB]SharedArchiveFile\f[R] becomes a product flag by default.
5059 Specifying \f[CB]+UnlockDiagnosticVMOptions\f[R] for
5060 \f[CB]SharedArchiveFile\f[R] is no longer needed in any configuration.
5061 .PP
5062 Class Data Sharing (CDS)/AppCDS does not support archiving array classes
5063 in a class list.
5064 When an array in the class list is encountered, CDS dump time gives the
5065 explicit error message:
5066 .RS
5067 .PP
5068 \f[CB]Preload\ Warning:\ Cannot\ find\f[R] \f[I]array_name\f[R]
5069 .RE
5070 .PP
5071 Although an array in the class list is not allowed, some array classes
5072 can still be created at CDS/AppCDS dump time.
5073 Those arrays are created during the execution of the Java code used by
5074 the Java class loaders (\f[CB]PlatformClassLoader\f[R] and the system
5075 class loader) to load classes at dump time.
5076 The created arrays are archived with the rest of the loaded classes.
5077 .SS Extending Class Data Sharing to Support the Module Path
5078 .PP
5079 In JDK 11, Class Data Sharing (CDS) has been improved to support
5080 archiving classes from the module path.
5081 .IP \[bu] 2
5082 To create a CDS archive using the \f[CB]\-\-module\-path\f[R] VM option,
5083 use the following command line syntax:
5084 .RS 2
5085 .RS
5086 .PP
5087 \f[CB]java\ \-Xshare:dump\ \-XX:SharedClassListFile=\f[R]\f[I]class_list_file\f[R]
5088 \f[CB]\-XX:SharedArchiveFile=\f[R]\f[I]shared_archive_file\f[R]
5089 \f[CB]\-\-module\-path=\f[R]\f[I]path_to_modular_jar\f[R] \f[CB]\-m\f[R]
5090 \f[I]module_name\f[R]
5091 .RE
5092 .RE
5093 .IP \[bu] 2
5094 To run with a CDS archive using the \f[CB]\-\-module\-path\f[R] VM option,
5095 use the following the command line syntax:
5096 .RS 2
5097 .RS
5098 .PP
5099 \f[CB]java\ \-XX:SharedArchiveFile=\f[R]\f[I]shared_archive_file\f[R]
5100 \f[CB]\-\-module\-path=\f[R]\f[I]path_to_modular_jar\f[R] \f[CB]\-m\f[R]
5101 \f[I]module_name\f[R]
5102 .RE
5103 .RE
5104 .PP
5105 The following table describes how the VM options related to module paths
5106 can be used along with the \f[CB]\-Xshare\f[R] option.
5107 .PP
5108 .TS
5109 tab(@);
5110 l l l.
5111 T{
5112 Option
5113 T}@T{
5114 \-Xshare:dump
5115 T}@T{
5116 \-Xshare:{on,auto}
5117 T}
5118 _
5119 T{
5120 \f[CB]\-\-module\-path\f[R][1] \f[I]mp\f[R]
5121 T}@T{
5122 Allowed
5123 T}@T{
5124 Allowed[2]
5125 T}
5126 T{
5127 \f[CB]\-\-module\f[R]
5128 T}@T{
5129 Allowed
5130 T}@T{
5131 Allowed
5132 T}
5133 T{
5134 \f[CB]\-\-add\-module\f[R]
5135 T}@T{
5136 Allowed
5137 T}@T{
5138 Allowed
5139 T}
5140 T{
5141 \f[CB]\-\-upgrade\-module\-path\f[R][3]
5142 T}@T{
5143 Disallowed (exits if specified)
5144 T}@T{
5145 Allowed (disables CDS)
5146 T}
5147 T{
5148 \f[CB]\-\-patch\-module\f[R][4]
5149 T}@T{
5150 Disallowed (exits if specified)
5151 T}@T{
5152 Allowed (disables CDS)
5153 T}
5154 T{
5155 \f[CB]\-\-limit\-modules\f[R][5]
5156 T}@T{
5157 Disallowed (exits if specified)
5158 T}@T{
5159 Allowed (disables CDS)
5160 T}
5161 .TE
5162 .PP
5163 [1] Although there are two ways of specifying a module in a
5164 \f[CB]\-\-module\-path\f[R], that is, modular JAR or exploded module, only
5165 modular JARs are supported.
5166 .PP
5167 [2] Different \f[I]mp\f[R] can be specified during dump time versus run
5168 time.
5169 If an archived class K was loaded from \f[CB]mp1.jar\f[R] at dump time,
5170 but changes in \f[I]mp\f[R] cause it to be available from a different
5171 \f[CB]mp2.jar\f[R] at run time, then the archived version of K will be
5172 disregarded at run time; K will be loaded dynamically.
5173 .PP
5174 [3] Currently, only two system modules are upgradeable
5175 (\f[CB]java.compiler\f[R] and \f[CB]jdk.internal.vm.compiler\f[R]).
5176 However, these modules are seldom upgraded in production software.
5177 .PP
5178 [4] As documented in JEP 261, using \f[CB]\-\-patch\-module\f[R] is
5179 strongly discouraged for production use.
5180 .PP
5181 [5] \f[CB]\-\-limit\-modules\f[R] is intended for testing purposes.
5182 It is seldom used in production software.
5183 .PP
5184 If \f[CB]\-\-upgrade\-module\-path\f[R], \f[CB]\-\-patch\-module\f[R], or
5185 \f[CB]\-\-limit\-modules\f[R] is specified at dump time, an error will be
5186 printed and the JVM will exit.
5187 For example, if the \f[CB]\-\-limit\-modules\f[R] option is specified at
5188 dump time, the user will see the following error:
5189 .IP
5190 .nf
5191 \f[CB]
5192 Error\ occurred\ during\ initialization\ of\ VM
5193 Cannot\ use\ the\ following\ option\ when\ dumping\ the\ shared\ archive:\ \-\-limit\-modules
5194 \f[R]
5195 .fi
5196 .PP
5197 If \f[CB]\-\-upgrade\-module\-path\f[R], \f[CB]\-\-patch\-module\f[R], or
5198 \f[CB]\-\-limit\-modules\f[R] is specified at run time, a warning message
5199 will be printed indicating that CDS is disabled.
5200 For example, if the \f[CB]\-\-limit\-modules\f[R] options is specified at
5201 run time, the user will see the following warning:
5202 .IP
5203 .nf
5204 \f[CB]
5205 Java\ HotSpot(TM)\ 64\-Bit\ Server\ VM\ warning:\ CDS\ is\ disabled\ when\ the\ \-\-limit\-modules\ option\ is\ specified.
5206 \f[R]
5207 .fi
5208 .PP
5209 Several other noteworthy things include:
5210 .IP \[bu] 2
5211 Any valid combinations of \f[CB]\-cp\f[R] and \f[CB]\-\-module\-path\f[R]
5212 are supported.
5213 .IP \[bu] 2
5214 A non\-empty directory in the module path causes a fatal error.
5215 The user will see the following error messages:
5216 .RS 2
5217 .IP
5218 .nf
5219 \f[CB]
5220 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
5221 \f[R]
5222 .fi
5223 .RE
5224 .IP \[bu] 2
5225 Unlike the class path, there\[aq]s no restriction that the module path
5226 at dump time must be equal to or be a prefix of the module path at run
5227 time.
5228 .IP \[bu] 2
5229 The archive is invalidated if an existing JAR in the module path is
5230 updated after archive generation.
5231 .IP \[bu] 2
5232 Removing a JAR from the module path does not invalidate the shared
5233 archive.
5234 Archived classes from the removed JAR are not used at runtime.
5235 .SS Dynamic CDS archive
5236 .PP
5237 Dynamic CDS archive extends AppCDS to allow archiving of classes when a
5238 Java application exits.
5239 It improves the usability of AppCDS by eliminating the trial run step
5240 for creating a class list for each application.
5241 The archived classes include all loaded application classes and library
5242 classes that are not present in the default CDS archive which is
5243 included in the JDK.
5244 .PP
5245 A base archive is required when creating a dynamic archive.
5246 If the base archive is not specified, the default CDS archive is used as
5247 the base archive.
5248 .PP
5249 To create a dynamic CDS archive with the default CDS archive as the base
5250 archive, just add the
5251 \f[CB]\-XX:ArchiveClassesAtExit=<dynamic\ archive>\f[R] option to the
5252 command line for running the Java application.
5253 .PP
5254 If the default CDS archive does not exist, the VM will exit with the
5255 following error:
5256 .IP
5257 .nf
5258 \f[CB]
5259 ArchiveClassesAtExit\ not\ supported\ when\ base\ CDS\ archive\ is\ not\ loaded
5260 \f[R]
5261 .fi
5262 .PP
5263 To run the Java application using a dynamic CDS archive, just add the
5264 \f[CB]\-XX:SharedArchiveFile=<dynamic\ archive>\f[R] option to the command
5265 line for running the Java application.
5266 .PP
5267 The base archive is not required to be specified in the command line.
5268 The base archive information, including its name and full path, will be
5269 retrieved from the dynamic archive header.
5270 Note that the user could also use the \f[CB]\-XX:SharedArchiveFile\f[R]
5271 option for specifying a regular AppCDS archive.
5272 Therefore, the specified archive in the \f[CB]\-XX:SharedArchiveFile\f[R]
5273 option could be either a regular or dynamic archive.
5274 During VM start up the specified archive header will be read.
5275 If \f[CB]\-XX:SharedArchiveFile\f[R] refers to a regular archive, then the
5276 behavior will be unchanged.
5277 If \f[CB]\-XX:SharedArchiveFile\f[R] refers to a dynamic archive, the VM
5278 will retrieve the base archive location from the dynamic archive.
5279 If the dynamic archive was created with the default CDS archive, then
5280 the current default CDS archive will be used, and will be found relative
5281 to the current run time environment.
5282 .PP
5283 Please refer to \f[B]JDK\-8221706\f[R]
5284 [https://bugs.openjdk.java.net/browse/JDK\-8221706] for details on error
5285 checking during dynamic CDS archive dump time and run time.
5286 .SS Creating a Shared Archive File and Using It to Run an Application
5287 .SS AppCDS archive
5288 .PP
5289 The following steps create a shared archive file that contains all the
5290 classes used by the \f[CB]test.Hello\f[R] application.
5291 The last step runs the application with the shared archive file.
5292 .IP "1." 3
5293 Create a list of all classes used by the \f[CB]test.Hello\f[R]
5294 application.
5295 The following command creates a file named \f[CB]hello.classlist\f[R] that
5296 contains a list of all classes used by this application:
5297 .RS 4
5298 .RS
5299 .PP
5300 \f[CB]java\ \-Xshare:off\ \-XX:DumpLoadedClassList=hello.classlist\ \-cp\ hello.jar\ test.Hello\f[R]
5301 .RE
5302 .PP
5303 Note that the classpath specified by the \f[CB]\-cp\f[R] parameter must
5304 contain only JAR files.
5305 .RE
5306 .IP "2." 3
5307 Create a shared archive, named \f[CB]hello.jsa\f[R], that contains all the
5308 classes in \f[CB]hello.classlist\f[R]:
5309 .RS 4
5310 .RS
5311 .PP
5312 \f[CB]java\ \-Xshare:dump\ \-XX:SharedArchiveFile=hello.jsa\ \-XX:SharedClassListFile=hello.classlist\ \-cp\ hello.jar\f[R]
5313 .RE
5314 .PP
5315 Note that the classpath used at archive creation time must be the same
5316 as (or a prefix of) the classpath used at run time.
5317 .RE
5318 .IP "3." 3
5319 Run the application \f[CB]test.Hello\f[R] with the shared archive
5320 \f[CB]hello.jsa\f[R]:
5321 .RS 4
5322 .RS
5323 .PP
5324 \f[CB]java\ \-XX:SharedArchiveFile=hello.jsa\ \-cp\ hello.jar\ test.Hello\f[R]
5325 .RE
5326 .RE
5327 .IP "4." 3
5328 \f[B]Optional\f[R] Verify that the \f[CB]test.Hello\f[R] application is
5329 using the class contained in the \f[CB]hello.jsa\f[R] shared archive:
5330 .RS 4
5331 .RS
5332 .PP
5333 \f[CB]java\ \-XX:SharedArchiveFile=hello.jsa\ \-cp\ hello.jar\ \-verbose:class\ test.Hello\f[R]
5334 .RE
5335 .PP
5336 The output of this command should contain the following text:
5337 .IP
5338 .nf
5339 \f[CB]
5340 Loaded\ test.Hello\ from\ shared\ objects\ file\ by\ sun/misc/Launcher$AppClassLoader
5341 \f[R]
5342 .fi
5343 .RE
5344 .SS Dynamic CDS archive
5345 .PP
5346 The following steps create a dynamic CDS archive file that contains the
5347 classes used by the \f[CB]test.Hello\f[R] application and are not included
5348 in the default CDS archive.
5349 The second step runs the application with the dynamic CDS archive.
5350 .IP "1." 3
5351 Create a dynamic CDS archive, named \f[CB]hello.jsa\f[R], that contains
5352 all the classes in \f[CB]hello.jar\f[R] loaded by the application
5353 \f[CB]test.Hello\f[R]:
5354 .RS 4
5355 .RS
5356 .PP
5357 \f[CB]java\ \-XX:ArchiveClassesAtExit=hello.jsa\ \-cp\ hello.jar\ Hello\f[R]
5358 .RE
5359 .PP
5360 Note that the classpath used at archive creation time must be the same
5361 as (or a prefix of) the classpath used at run time.
5362 .RE
5363 .IP "2." 3
5364 Run the application \f[CB]test.Hello\f[R] with the shared archive
5365 \f[CB]hello.jsa\f[R]:
5366 .RS 4
5367 .RS
5368 .PP
5369 \f[CB]java\ \-XX:SharedArchiveFile=hello.jsa\ \-cp\ hello.jar\ test.Hello\f[R]
5370 .RE
5371 .RE
5372 .IP "3." 3
5373 \f[B]Optional\f[R] Repeat step 4 of the previous section to verify that
5374 the \f[CB]test.Hello\f[R] application is using the class contained in the
5375 \f[CB]hello.jsa\f[R] shared archive.
5376 .PP
5377 To automate the above steps 1 and 2, one can write a script such as the
5378 following:
5379 .IP
5380 .nf
5381 \f[CB]
5382 \ \ \ \ ARCHIVE=hello.jsa
5383 \ \ \ \ if\ test\ \-f\ $ARCHIVE;\ then
5384 \ \ \ \ \ \ \ \ FLAG="\-XX:SharedArchiveFile=$ARCHIVE"
5385 \ \ \ \ else
5386 \ \ \ \ \ \ \ \ FLAG="\-XX:ArchiveClassesAtExit=$ARCHIVE"
5387 \ \ \ \ fi
5388 \ \ \ \ $JAVA_HOME/bin/java\ \-cp\ hello.jar\ $FLAG\ test.Hello
5389 \f[R]
5390 .fi
5391 .PP
5392 Like an AppCDS archive, the archive needs to be re\-generated if the
5393 Java version has changed.
5394 The above script could be adjusted to account for the Java version as
5395 follows:
5396 .IP
5397 .nf
5398 \f[CB]
5399 \ \ \ \ ARCHIVE=hello.jsa
5400 \ \ \ \ VERSION=foo.version
5401 \ \ \ \ if\ test\ \-f\ $ARCHIVE\ \-a\ \-f\ $VERSION\ &&\ cmp\ \-s\ $VERSION\ $JAVA_HOME/release;\ then
5402 \ \ \ \ \ \ \ \ FLAG="\-XX:SharedArchiveFile=$ARCHIVE"
5403 \ \ \ \ else
5404 \ \ \ \ \ \ \ \ FLAG="\-XX:ArchiveClassesAtExit=$ARCHIVE"
5405 \ \ \ \ \ \ \ \ cp\ \-f\ $JAVA_HOME/release\ $VERSION
5406 \ \ \ \ fi
5407 \ \ \ \ $JAVA_HOME/bin/java\ \-cp\ hello.jar\ $FLAG\ test.Hello
5408 \f[R]
5409 .fi
5410 .PP
5411 Currently, we don\[aq]t support concurrent dumping operations to the
5412 same CDS archive.
5413 Care should be taken to avoid multiple writers to the same CDS archive.
5414 .PP
5415 The user could also create a dynamic CDS archive with a specific base
5416 archive, e.g.
5417 named as \f[CB]base.jsa\f[R] as follows:
5418 .RS
5419 .PP
5420 \f[CB]java\ \-XX:SharedArchiveFile=base.jsa\ \-XX:ArchiveClassesAtExit=hello.jsa\ \-cp\ hello.jar\ Hello\f[R]
5421 .RE
5422 .PP
5423 To run the application using the dynamic CDS archive \f[CB]hello.jsa\f[R]
5424 and a specific base CDS archive \f[CB]base.jsa\f[R]:
5425 .RS
5426 .PP
5427 \f[CB]java\ \-XX:SharedArchiveFile=base.jsa:hello.jsa\ \-cp\ hello.jar\ Hello\f[R]
5428 .RE
5429 .PP
5430 Note that on Windows, the above path delimiter \f[CB]:\f[R] should be
5431 replaced with \f[CB];\f[R].
5432 .PP
5433 The above command for specifying a base archive is useful if the base
5434 archive used for creating the dynamic archive has been moved.
5435 Normally, just specifying the dynamic archive should be sufficient since
5436 the base archive info can be retrieved from the dynamic archive header.
5437 .SS Sharing a Shared Archive Across Multiple Application Processes
5438 .PP
5439 You can share the same archive file across multiple applications
5440 processes.
5441 This reduces memory usage because the archive is memory\-mapped into the
5442 address space of the processes.
5443 The operating system automatically shares the read\-only pages across
5444 these processes.
5445 .PP
5446 The following steps demonstrate how to create a common archive that can
5447 be shared by different applications.
5448 Classes from \f[CB]common.jar\f[R], \f[CB]hello.jar\f[R] and \f[CB]hi.jar\f[R]
5449 are archived in the \f[CB]common.jsa\f[R] because they are all in the
5450 classpath during the archiving step (step 3).
5451 .PP
5452 To include classes from \f[CB]hello.jar\f[R] and \f[CB]hi.jar\f[R], the
5453 \f[CB]\&.jar\f[R] files must be added to the classpath specified by the
5454 \f[CB]\-cp\f[R] parameter.
5455 .IP "1." 3
5456 Create a list of all classes used by the \f[CB]Hello\f[R] application and
5457 another list for the \f[CB]Hi\f[R] application:
5458 .RS 4
5459 .RS
5460 .PP
5461 \f[CB]java\ \-XX:DumpLoadedClassList=hello.classlist\ \-cp\ common.jar:hello.jar\ Hello\f[R]
5462 .RE
5463 .RS
5464 .PP
5465 \f[CB]java\ \-XX:DumpLoadedClassList=hi.classlist\ \-cp\ common.jar:hi.jar\ Hi\f[R]
5466 .RE
5467 .RE
5468 .IP "2." 3
5469 Create a single list of classes used by all the applications that will
5470 share the shared archive file.
5471 .RS 4
5472 .PP
5473 \f[B]Oracle Solaris, Linux, and macOS\f[R] The following commands combine
5474 the files \f[CB]hello.classlist\f[R] and \f[CB]hi.classlist\f[R] into one
5475 file, \f[CB]common.classlist\f[R]:
5476 .RS
5477 .PP
5478 \f[CB]cat\ hello.classlist\ hi.classlist\ >\ common.classlist\f[R]
5479 .RE
5480 .PP
5481 \f[B]Windows\f[R] The following commands combine the files
5482 \f[CB]hello.classlist\f[R] and \f[CB]hi.classlist\f[R] into one file,
5483 \f[CB]common.classlist\f[R]:
5484 .RS
5485 .PP
5486 \f[CB]type\ hello.classlist\ hi.classlist\ >\ common.classlist\f[R]
5487 .RE
5488 .RE
5489 .IP "3." 3
5490 Create a shared archive named \f[CB]common.jsa\f[R] that contains all the
5491 classes in \f[CB]common.classlist\f[R]:
5492 .RS 4
5493 .RS
5494 .PP
5495 \f[CB]java\ \-Xshare:dump\ \-XX:SharedArchiveFile=common.jsa\ \-XX:SharedClassListFile=common.classlist\ \-cp\ common.jar:hello.jar:hi.jar\f[R]
5496 .RE
5497 .PP
5498 The classpath parameter used is the common class path prefix shared by
5499 the \f[CB]Hello\f[R] and \f[CB]Hi\f[R] applications.
5500 .RE
5501 .IP "4." 3
5502 Run the \f[CB]Hello\f[R] and \f[CB]Hi\f[R] applications with the same shared
5503 archive:
5504 .RS 4
5505 .RS
5506 .PP
5507 \f[CB]java\ \-XX:SharedArchiveFile=common.jsa\ \-cp\ common.jar:hello.jar:hi.jar\ Hello\f[R]
5508 .RE
5509 .RS
5510 .PP
5511 \f[CB]java\ \-XX:SharedArchiveFile=common.jsa\ \-cp\ common.jar:hello.jar:hi.jar\ Hi\f[R]
5512 .RE
5513 .RE
5514 .SS Specifying Additional Shared Data Added to an Archive File
5515 .PP
5516 The \f[CB]SharedArchiveConfigFile\f[R] option is used to specify
5517 additional shared data to add to the archive file.
5518 .RS
5519 .PP
5520 \f[CB]\-XX:SharedArchiveConfigFile=\f[R]\f[I]shared_config_file\f[R]
5521 .RE
5522 .PP
5523 JDK 9 and later supports adding both symbols and\ string objects to an
5524 archive for memory sharing\ when you have multiple JVM processes running
5525 on the same host.
5526 An example of this is having multiple JVM processes that use the same
5527 set of Java EE classes.
5528 When these common classes are loaded and used, new symbols and strings
5529 may be created and added to the JVM\[aq]s internal "symbol" and "string"
5530 tables.\ At runtime, the symbols or string objects mapped from the
5531 archive file can be shared across multiple JVM processes, resulting in a
5532 reduction of overall memory usage.\ In addition, archiving strings also
5533 provides added performance benefits in both startup time and runtime
5534 execution.
5535 .PP
5536 In JDK 10 and later, CONSTANT_String entries in archived classes are
5537 resolved to interned String objects at dump time, and all interned
5538 String objects are archived.
5539 However, even though all CONSTANT_String literals in all archived
5540 classes are resolved, it might still beneficial to add additional
5541 strings that are not string literals in class files, but are likely to
5542 be used by your application at run time.
5543 .PP
5544 Symbol data should be generated by the \f[CB]jcmd\f[R] tool attaching to a
5545 running JVM process.
5546 See \f[B]jcmd\f[R].
5547 .PP
5548 The following is an example of the symbol dumping command in
5549 \f[CB]jcmd\f[R]:\ 
5550 .RS
5551 .PP
5552 \f[CB]jcmd\f[R] \f[I]pid\f[R] \f[CB]VM.symboltable\ \-verbose\f[R]
5553 .RE
5554 .RS
5555 .PP
5556 \f[B]Note:\f[R] The first line (process ID) and the second line
5557 (\f[CB]\@VERSION\ ...\f[R]) of this \f[CB]jcmd\f[R] output should be
5558 excluded from the configuration file.
5559 .RE
5560 .SS Example of a Configuration File
5561 .PP
5562 The following is an example of a configuration file:
5563 .IP
5564 .nf
5565 \f[CB]
5566 VERSION:\ 1.0
5567 \@SECTION:\ Symbol
5568 10\ \-1:\ linkMethod
5569 \f[R]
5570 .fi
5571 .PP
5572 In the configuration file example, the \f[CB]\@SECTION:\ Symbol\f[R] entry
5573 uses the following format:
5574 .RS
5575 .PP
5576 \f[I]length\f[R] \f[I]refcount\f[R]\f[CB]:\f[R] \f[I]symbol\f[R]
5577 .RE
5578 .PP
5579 The \f[I]refcount\f[R] for a shared symbol is always \f[CB]\-1\f[R].
5580 .PP
5581 \f[CB]\@SECTION\f[R] specifies the type of the section that follows it.
5582 All data within the section must be the same type that\[aq]s specified
5583 by \f[CB]\@SECTION\f[R].
5584 Different types of data can\[aq]t be mixed.
5585 Multiple separated data sections for the same type specified by
5586 different \f[CB]\@SECTION\f[R] are allowed within one
5587 \f[CB]shared_config_file\f[R] .
5588 .SH PERFORMANCE TUNING EXAMPLES
5589 .PP
5590 You can use the Java advanced runtime options to optimize the
5591 performance of your applications.
5592 .SS Tuning for Higher Throughput
5593 .PP
5594 Use the following commands and advanced options to achieve higher
5595 throughput performance for your application:
5596 .RS
5597 .PP
5598 \f[CB]java\ \-server\ \-XX:+UseParallelGC\ \-XX:+UseLargePages\ \-Xmn10g\ \ \-Xms26g\ \-Xmx26g\f[R]
5599 .RE
5600 .SS Tuning for Lower Response Time
5601 .PP
5602 Use the following commands and advanced options to achieve lower
5603 response times for your application:
5604 .RS
5605 .PP
5606 \f[CB]java\ \-XX:+UseG1GC\ \-Xms26g\ Xmx26g\ \-XX:MaxGCPauseMillis=500\f[R]
5607 .RE
5608 .SS Keeping the Java Heap Small and Reducing the Dynamic Footprint of
5609 Embedded Applications
5610 .PP
5611 Use the following advanced runtime options to keep the Java heap small
5612 and reduce the dynamic footprint of embedded applications:
5613 .RS
5614 .PP
5615 \f[CB]\-XX:MaxHeapFreeRatio=10\ \-XX:MinHeapFreeRatio=5\f[R]
5616 .RE
5617 .RS
5618 .PP
5619 \f[B]Note:\f[R] The defaults for these two options are 70% and 40%
5620 respectively.
5621 Because performance sacrifices can occur when using these small
5622 settings, you should optimize for a small footprint by reducing these
5623 settings as much as possible without introducing unacceptable
5624 performance degradation.
5625 .RE
5626 .SH EXIT STATUS
5627 .PP
5628 The following exit values are typically returned by the launcher when
5629 the launcher is called with the wrong arguments, serious errors, or
5630 exceptions thrown by the JVM.
5631 However, a Java application may choose to return any value by using the
5632 API call \f[CB]System.exit(exitValue)\f[R].
5633 The values are:
5634 .IP \[bu] 2
5635 \f[CB]0\f[R]: Successful completion
5636 .IP \[bu] 2
5637 \f[CB]>0\f[R]: An error occurred