< prev index next >

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

Print this page


   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 .\" Title: java
  24 .\" Language: English
  25 .\" Date: 03 March 2015
  26 .\" SectDesc: Basic Tools
  27 .\" Software: JDK 8
  28 .\" Arch: generic
  29 .\" Part Number: E38207-04
  30 .\" Doc ID: JSSON
  31 .\"
  32 .if n .pl 99999
  33 .TH "java" "1" "03 March 2015" "JDK 8" "Basic Tools"
  34 .\" -----------------------------------------------------------------
  35 .\" * Define some portability stuff
  36 .\" -----------------------------------------------------------------
  37 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  38 .\" http://bugs.debian.org/507673
  39 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  40 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  41 .ie \n(.g .ds Aq \(aq
  42 .el       .ds Aq '
  43 .\" -----------------------------------------------------------------
  44 .\" * set default formatting
  45 .\" -----------------------------------------------------------------
  46 .\" disable hyphenation
  47 .nh
  48 .\" disable justification (adjust text to left margin only)
  49 .ad l
  50 .\" -----------------------------------------------------------------
  51 .\" * MAIN CONTENT STARTS HERE *
  52 .\" -----------------------------------------------------------------
  53 .SH "NAME"
  54 java \- Launches a Java application\&.
  55 .SH "SYNOPSIS"
  56 .sp
  57 .if n \{\
  58 .RS 4
  59 .\}
  60 .nf
  61 \fBjava\fR [\fIoptions\fR] \fIclassname\fR [\fIargs\fR]
  62 .fi
  63 .if n \{\
  64 .RE
  65 .\}
  66 .sp
  67 .if n \{\
  68 .RS 4
  69 .\}
  70 .nf
  71 \fBjava\fR [\fIoptions\fR] \fB\-jar\fR \fIfilename\fR [\fIargs\fR]
  72 .fi
  73 .if n \{\
  74 .RE
  75 .\}
  76 .PP
  77 \fIoptions\fR
  78 .RS 4
  79 Command\-line options separated by spaces\&. See Options\&.
  80 .RE
  81 .PP
  82 \fIclassname\fR
  83 .RS 4
  84 The name of the class to be launched\&.
  85 .RE
  86 .PP
  87 \fIfilename\fR
  88 .RS 4
  89 The name of the Java Archive (JAR) file to be called\&. Used only with the
  90 \fB\-jar\fR
  91 option\&.
  92 .RE
  93 .PP
  94 \fIargs\fR
  95 .RS 4
  96 The arguments passed to the
  97 \fBmain()\fR
  98 method separated by spaces\&.
  99 .RE
 100 .SH "DESCRIPTION"
 101 .PP
 102 The
 103 \fBjava\fR
 104 command starts a Java application\&. It does this by starting the Java Runtime Environment (JRE), loading the specified class, and calling that class\*(Aqs
 105 \fBmain()\fR
 106 method\&. The method must be declared
 107 \fIpublic\fR
 108 and
 109 \fIstatic\fR, it must not return any value, and it must accept a
 110 \fBString\fR
 111 array as a parameter\&. The method declaration has the following form:
 112 .sp
 113 .if n \{\
 114 .RS 4
 115 .\}
 116 .nf
 117 \fBpublic static void main(String[] args)\fR
 118  
 119 .fi
 120 .if n \{\
 121 .RE
 122 .\}
 123 .PP
 124 The
 125 \fBjava\fR
 126 command can be used to launch a JavaFX application by loading a class that either has a
 127 \fBmain()\fR
 128 method or that extends
 129 \fBjavafx\&.application\&.Application\fR\&. In the latter case, the launcher constructs an instance of the
 130 \fBApplication\fR
 131 class, calls its
 132 \fBinit()\fR
 133 method, and then calls the
 134 \fBstart(javafx\&.stage\&.Stage)\fR
 135 method\&.
 136 .PP
 137 By default, the first argument that is not an option of the
 138 \fBjava\fR
 139 command is the fully qualified name of the class to be called\&. If the
 140 \fB\-jar\fR
 141 option is specified, its argument is the name of the JAR file containing class and resource files for the application\&. The startup class must be indicated by the
 142 \fBMain\-Class\fR
 143 manifest header in its source code\&.
 144 .PP
 145 The JRE searches for the startup class (and other classes used by the application) in three sets of locations: the bootstrap class path, the installed extensions, and the user\(cqs class path\&.
 146 .PP
 147 Arguments after the class file name or the JAR file name are passed to the
 148 \fBmain()\fR
 149 method\&.
 150 .SH "OPTIONS"
 151 .PP
 152 The
 153 \fBjava\fR
 154 command supports a wide range of options that can be divided into the following categories:
 155 .sp
 156 .RS 4
 157 .ie n \{\
 158 \h'-04'\(bu\h'+03'\c
 159 .\}
 160 .el \{\
 161 .sp -1
 162 .IP \(bu 2.3
 163 .\}
 164 Standard Options
 165 .RE
 166 .sp
 167 .RS 4
 168 .ie n \{\
 169 \h'-04'\(bu\h'+03'\c
 170 .\}
 171 .el \{\
 172 .sp -1
 173 .IP \(bu 2.3
 174 .\}
 175 Non\-Standard Options
 176 .RE
 177 .sp
 178 .RS 4
 179 .ie n \{\
 180 \h'-04'\(bu\h'+03'\c
 181 .\}
 182 .el \{\
 183 .sp -1
 184 .IP \(bu 2.3
 185 .\}
 186 Advanced Runtime Options
 187 .RE
 188 .sp
 189 .RS 4
 190 .ie n \{\
 191 \h'-04'\(bu\h'+03'\c
 192 .\}
 193 .el \{\
 194 .sp -1
 195 .IP \(bu 2.3
 196 .\}
 197 Advanced JIT Compiler Options
 198 .RE
 199 .sp
 200 .RS 4
 201 .ie n \{\
 202 \h'-04'\(bu\h'+03'\c
 203 .\}
 204 .el \{\
 205 .sp -1
 206 .IP \(bu 2.3
 207 .\}
 208 Advanced Serviceability Options
 209 .RE
 210 .sp
 211 .RS 4
 212 .ie n \{\
 213 \h'-04'\(bu\h'+03'\c
 214 .\}
 215 .el \{\
 216 .sp -1
 217 .IP \(bu 2.3
 218 .\}
 219 Advanced Garbage Collection Options
 220 .RE
 221 .PP
 222 Standard options are guaranteed to be supported by all implementations of the Java Virtual Machine (JVM)\&. They are used for common actions, such as checking the version of the JRE, setting the class path, enabling verbose output, and so on\&.
 223 .PP
 224 Non\-standard options are general purpose options that are specific to the Java HotSpot Virtual Machine, so they are not guaranteed to be supported by all JVM implementations, and are subject to change\&. These options start with
 225 \fB\-X\fR\&.
 226 .PP
 227 Advanced options are not recommended for casual use\&. These are developer options used for tuning specific areas of the Java HotSpot Virtual Machine operation that often have specific system requirements and may require privileged access to system configuration parameters\&. They are also not guaranteed to be supported by all JVM implementations, and are subject to change\&. Advanced options start with
 228 \fB\-XX\fR\&.
 229 .PP
 230 To keep track of the options that were deprecated or removed in the latest release, there is a section named Deprecated and Removed Options at the end of the document\&.
 231 .PP
 232 Boolean options are used to either enable a feature that is disabled by default or disable a feature that is enabled by default\&. Such options do not require a parameter\&. Boolean
 233 \fB\-XX\fR
 234 options are enabled using the plus sign (\fB\-XX:+\fR\fIOptionName\fR) and disabled using the minus sign (\fB\-XX:\-\fR\fIOptionName\fR)\&.
 235 .PP
 236 For options that require an argument, the argument may be separated from the option name by a space, a colon (:), or an equal sign (=), or the argument may directly follow the option (the exact syntax differs for each option)\&. If you are expected to specify the size in bytes, you can use no suffix, or use the suffix
 237 \fBk\fR
 238 or
 239 \fBK\fR
 240 for kilobytes (KB),
 241 \fBm\fR
 242 or
 243 \fBM\fR
 244 for megabytes (MB),
 245 \fBg\fR
 246 or
 247 \fBG\fR
 248 for gigabytes (GB)\&. For example, to set the size to 8 GB, you can specify either
 249 \fB8g\fR,
 250 \fB8192m\fR,
 251 \fB8388608k\fR, or
 252 \fB8589934592\fR
 253 as the argument\&. If you are expected to specify the percentage, use a number from 0 to 1 (for example, specify
 254 \fB0\&.25\fR
 255 for 25%)\&.
 256 .SS "Standard Options"
 257 .PP
 258 These are the most commonly used options that are supported by all implementations of the JVM\&.
 259 .PP
 260 \-agentlib:\fIlibname\fR[=\fIoptions\fR]
 261 .RS 4
 262 Loads the specified native agent library\&. After the library name, a comma\-separated list of options specific to the library can be used\&.
 263 .sp
 264 If the option
 265 \fB\-agentlib:foo\fR
 266 is specified, then the JVM attempts to load the library named
 267 \fBlibfoo\&.so\fR
 268 in the location specified by the
 269 \fBLD_LIBRARY_PATH\fR
 270 system variable (on OS X this variable is
 271 \fBDYLD_LIBRARY_PATH\fR)\&.
 272 .sp
 273 The following example shows how to load the heap profiling tool (HPROF) library and get sample CPU information every 20 ms, with a stack depth of 3:
 274 .sp
 275 .if n \{\
 276 .RS 4
 277 .\}
 278 .nf
 279 \fB\-agentlib:hprof=cpu=samples,interval=20,depth=3\fR
 280  
 281 .fi
 282 .if n \{\
 283 .RE
 284 .\}
 285 The following example shows how to load the Java Debug Wire Protocol (JDWP) library and listen for the socket connection on port 8000, suspending the JVM before the main class loads:
 286 .sp
 287 .if n \{\
 288 .RS 4
 289 .\}
 290 .nf
 291 \fB\-agentlib:jdwp=transport=dt_socket,server=y,address=8000\fR
 292  
 293 .fi
 294 .if n \{\
 295 .RE
 296 .\}
 297 For more information about the native agent libraries, refer to the following:
 298 .sp
 299 .RS 4
 300 .ie n \{\
 301 \h'-04'\(bu\h'+03'\c
 302 .\}
 303 .el \{\
 304 .sp -1
 305 .IP \(bu 2.3
 306 .\}
 307 The
 308 \fBjava\&.lang\&.instrument\fR
 309 package description at http://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package\-summary\&.html
 310 .RE
 311 .sp
 312 .RS 4
 313 .ie n \{\
 314 \h'-04'\(bu\h'+03'\c
 315 .\}
 316 .el \{\
 317 .sp -1
 318 .IP \(bu 2.3
 319 .\}
 320 Agent Command Line Options in the JVM Tools Interface guide at http://docs\&.oracle\&.com/javase/8/docs/platform/jvmti/jvmti\&.html#starting
 321 .RE
 322 .RE
 323 .PP
 324 \-agentpath:\fIpathname\fR[=\fIoptions\fR]
 325 .RS 4
 326 Loads the native agent library specified by the absolute path name\&. This option is equivalent to
 327 \fB\-agentlib\fR
 328 but uses the full path and file name of the library\&.
 329 .RE
 330 .PP
 331 \-client
 332 .RS 4
 333 Selects the Java HotSpot Client VM\&. The 64\-bit version of the Java SE Development Kit (JDK) currently ignores this option and instead uses the Server JVM\&.
 334 .sp
 335 For default JVM selection, see Server\-Class Machine Detection at
 336 http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/server\-class\&.html
 337 .RE
 338 .PP
 339 \-D\fIproperty\fR=\fIvalue\fR
 340 .RS 4
 341 Sets a system property value\&. The
 342 \fIproperty\fR
 343 variable is a string with no spaces that represents the name of the property\&. The
 344 \fIvalue\fR
 345 variable is a string that represents the value of the property\&. If
 346 \fIvalue\fR
 347 is a string with spaces, then enclose it in quotation marks (for example
 348 \fB\-Dfoo="foo bar"\fR)\&.
 349 .RE
 350 .PP
 351 \-d32
 352 .RS 4
 353 Runs the application in a 32\-bit environment\&. If a 32\-bit environment is not installed or is not supported, then an error will be reported\&. By default, the application is run in a 32\-bit environment unless a 64\-bit system is used\&.
 354 .RE
 355 .PP
 356 \-d64
 357 .RS 4
 358 Runs the application in a 64\-bit environment\&. If a 64\-bit environment is not installed or is not supported, then an error will be reported\&. By default, the application is run in a 32\-bit environment unless a 64\-bit system is used\&.
 359 .sp
 360 Currently only the Java HotSpot Server VM supports 64\-bit operation, and the
 361 \fB\-server\fR
 362 option is implicit with the use of
 363 \fB\-d64\fR\&. The
 364 \fB\-client\fR
 365 option is ignored with the use of
 366 \fB\-d64\fR\&. This is subject to change in a future release\&.
 367 .RE
 368 .PP
 369 \-disableassertions[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
 370 .br
 371 \-da[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
 372 .RS 4
 373 Disables assertions\&. By default, assertions are disabled in all packages and classes\&.
 374 .sp
 375 With no arguments,
 376 \fB\-disableassertions\fR
 377 (\fB\-da\fR) disables assertions in all packages and classes\&. With the
 378 \fIpackagename\fR
 379 argument ending in
 380 \fB\&.\&.\&.\fR, the switch disables assertions in the specified package and any subpackages\&. If the argument is simply
 381 \fB\&.\&.\&.\fR, then the switch disables assertions in the unnamed package in the current working directory\&. With the
 382 \fIclassname\fR
 383 argument, the switch disables assertions in the specified class\&.
 384 .sp
 385 The
 386 \fB\-disableassertions\fR
 387 (\fB\-da\fR) option applies to all class loaders and to system classes (which do not have a class loader)\&. There is one exception to this rule: if the option is provided with no arguments, then it does not apply to system classes\&. This makes it easy to disable assertions in all classes except for system classes\&. The
 388 \fB\-disablesystemassertions\fR
 389 option enables you to disable assertions in all system classes\&.
 390 .sp
 391 To explicitly enable assertions in specific packages or classes, use the
 392 \fB\-enableassertions\fR
 393 (\fB\-ea\fR) option\&. Both options can be used at the same time\&. For example, to run the
 394 \fBMyClass\fR
 395 application with assertions enabled in package
 396 \fBcom\&.wombat\&.fruitbat\fR
 397 (and any subpackages) but disabled in class
 398 \fBcom\&.wombat\&.fruitbat\&.Brickbat\fR, use the following command:
 399 .sp
 400 .if n \{\
 401 .RS 4
 402 .\}
 403 .nf
 404 \fBjava \-ea:com\&.wombat\&.fruitbat\&.\&.\&. \-da:com\&.wombat\&.fruitbat\&.Brickbat MyClass\fR
 405  
 406 .fi
 407 .if n \{\
 408 .RE
 409 .\}
 410 .RE
 411 .PP
 412 \-disablesystemassertions
 413 .br
 414 \-dsa
 415 .RS 4
 416 Disables assertions in all system classes\&.
 417 .RE
 418 .PP
 419 \-enableassertions[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
 420 .br
 421 \-ea[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
 422 .RS 4
 423 Enables assertions\&. By default, assertions are disabled in all packages and classes\&.
 424 .sp
 425 With no arguments,
 426 \fB\-enableassertions\fR
 427 (\fB\-ea\fR) enables assertions in all packages and classes\&. With the
 428 \fIpackagename\fR
 429 argument ending in
 430 \fB\&.\&.\&.\fR, the switch enables assertions in the specified package and any subpackages\&. If the argument is simply
 431 \fB\&.\&.\&.\fR, then the switch enables assertions in the unnamed package in the current working directory\&. With the
 432 \fIclassname\fR
 433 argument, the switch enables assertions in the specified class\&.
 434 .sp
 435 The
 436 \fB\-enableassertions\fR
 437 (\fB\-ea\fR) option applies to all class loaders and to system classes (which do not have a class loader)\&. There is one exception to this rule: if the option is provided with no arguments, then it does not apply to system classes\&. This makes it easy to enable assertions in all classes except for system classes\&. The
 438 \fB\-enablesystemassertions\fR
 439 option provides a separate switch to enable assertions in all system classes\&.
 440 .sp
 441 To explicitly disable assertions in specific packages or classes, use the
 442 \fB\-disableassertions\fR
 443 (\fB\-da\fR) option\&. If a single command contains multiple instances of these switches, then they are processed in order before loading any classes\&. For example, to run the
 444 \fBMyClass\fR
 445 application with assertions enabled only in package
 446 \fBcom\&.wombat\&.fruitbat\fR
 447 (and any subpackages) but disabled in class
 448 \fBcom\&.wombat\&.fruitbat\&.Brickbat\fR, use the following command:
 449 .sp
 450 .if n \{\
 451 .RS 4
 452 .\}
 453 .nf
 454 \fBjava \-ea:com\&.wombat\&.fruitbat\&.\&.\&. \-da:com\&.wombat\&.fruitbat\&.Brickbat MyClass\fR
 455  
 456 .fi
 457 .if n \{\
 458 .RE
 459 .\}
 460 .RE
 461 .PP
 462 \-enablesystemassertions
 463 .br
 464 \-esa
 465 .RS 4
 466 Enables assertions in all system classes\&.



 467 .RE
 468 .PP
 469 \-help
 470 .br
 471 \-?
 472 .RS 4
 473 Displays usage information for the
 474 \fBjava\fR
 475 command without actually running the JVM\&.
 476 .RE
 477 .PP
 478 \-jar \fIfilename\fR
 479 .RS 4
 480 Executes a program encapsulated in a JAR file\&. The
 481 \fIfilename\fR
 482 argument is the name of a JAR file with a manifest that contains a line in the form
 483 \fBMain\-Class:\fR\fIclassname\fR
 484 that defines the class with the
 485 \fBpublic static void main(String[] args)\fR
 486 method that serves as your application\*(Aqs starting point\&.
 487 .sp
 488 When you use the
 489 \fB\-jar\fR
 490 option, the specified JAR file is the source of all user classes, and other class path settings are ignored\&.
 491 .sp
 492 For more information about JAR files, see the following resources:
 493 .sp
 494 .RS 4
 495 .ie n \{\
 496 \h'-04'\(bu\h'+03'\c
 497 .\}
 498 .el \{\
 499 .sp -1
 500 .IP \(bu 2.3
 501 .\}
 502 jar(1)
 503 .RE
 504 .sp
 505 .RS 4
 506 .ie n \{\
 507 \h'-04'\(bu\h'+03'\c
 508 .\}
 509 .el \{\
 510 .sp -1
 511 .IP \(bu 2.3
 512 .\}
 513 The Java Archive (JAR) Files guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jar/index\&.html
 514 .RE
 515 .sp
 516 .RS 4
 517 .ie n \{\
 518 \h'-04'\(bu\h'+03'\c
 519 .\}
 520 .el \{\
 521 .sp -1
 522 .IP \(bu 2.3
 523 .\}
 524 Lesson: Packaging Programs in JAR Files at
 525 
 526 http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.html
 527 .RE
 528 .RE
 529 .PP
 530 \-javaagent:\fIjarpath\fR[=\fIoptions\fR]
 531 .RS 4
 532 Loads the specified Java programming language agent\&. For more information about instrumenting Java applications, see the
 533 \fBjava\&.lang\&.instrument\fR
 534 package description in the Java API documentation at http://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package\-summary\&.html
 535 .RE
 536 .PP
 537 \-jre\-restrict\-search
 538 .RS 4
 539 Includes user\-private JREs in the version search\&.
 540 .RE
 541 .PP
 542 \-no\-jre\-restrict\-search
 543 .RS 4
 544 Excludes user\-private JREs from the version search\&.
 545 .RE
 546 .PP
 547 \-server
 548 .RS 4
 549 Selects the Java HotSpot Server VM\&. The 64\-bit version of the JDK supports only the Server VM, so in that case the option is implicit\&.
 550 .sp
 551 For default JVM selection, see Server\-Class Machine Detection at
 552 http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/server\-class\&.html
 553 .RE
 554 .PP
 555 \-showversion
 556 .RS 4
 557 Displays version information and continues execution of the application\&. This option is equivalent to the
 558 \fB\-version\fR
 559 option except that the latter instructs the JVM to exit after displaying version information\&.
 560 .RE
 561 .PP
 562 \-splash:\fIimgname\fR
 563 .RS 4
 564 Shows the splash screen with the image specified by
 565 \fIimgname\fR\&. For example, to show the
 566 \fBsplash\&.gif\fR
 567 file from the
 568 \fBimages\fR
 569 directory when starting your application, use the following option:
 570 .sp
 571 .if n \{\
 572 .RS 4
 573 .\}
 574 .nf
 575 \fB\-splash:images/splash\&.gif\fR
 576  
 577 .fi
 578 .if n \{\
 579 .RE
 580 .\}
 581 .RE
 582 .PP
 583 \-verbose:class
 584 .RS 4
 585 Displays information about each loaded class\&.
 586 .RE
 587 .PP
 588 \-verbose:gc
 589 .RS 4
 590 Displays information about each garbage collection (GC) event\&.
 591 .RE
 592 .PP
 593 \-verbose:jni
 594 .RS 4
 595 Displays information about the use of native methods and other Java Native Interface (JNI) activity\&.
 596 .RE
 597 .PP
 598 \-version
 599 .RS 4
 600 Displays version information and then exits\&. This option is equivalent to the
 601 \fB\-showversion\fR
 602 option except that the latter does not instruct the JVM to exit after displaying version information\&.
 603 .RE
 604 .PP
 605 \-version:\fIrelease\fR
 606 .RS 4
 607 Specifies the release version to be used for running the application\&. If the version of the
 608 \fBjava\fR
 609 command called does not meet this specification and an appropriate implementation is found on the system, then the appropriate implementation will be used\&.
 610 .sp
 611 The
 612 \fIrelease\fR
 613 argument specifies either the exact version string, or a list of version strings and ranges separated by spaces\&. A
 614 \fIversion string\fR
 615 is the developer designation of the version number in the following form:
 616 \fB1\&.\fR\fIx\fR\fB\&.0_\fR\fIu\fR
 617 (where
 618 \fIx\fR
 619 is the major version number, and
 620 \fIu\fR
 621 is the update version number)\&. A
 622 \fIversion range\fR
 623 is made up of a version string followed by a plus sign (\fB+\fR) to designate this version or later, or a part of a version string followed by an asterisk (\fB*\fR) to designate any version string with a matching prefix\&. Version strings and ranges can be combined using a space for a logical
 624 \fIOR\fR
 625 combination, or an ampersand (\fB&\fR) for a logical
 626 \fIAND\fR
 627 combination of two version strings/ranges\&. For example, if running the class or JAR file requires either JRE 6u13 (1\&.6\&.0_13), or any JRE 6 starting from 6u10 (1\&.6\&.0_10), specify the following:
 628 .sp
 629 .if n \{\
 630 .RS 4
 631 .\}
 632 .nf
 633 \fB\-version:"1\&.6\&.0_13 1\&.6* & 1\&.6\&.0_10+"\fR
 634  
 635 .fi
 636 .if n \{\
 637 .RE
 638 .\}
 639 Quotation marks are necessary only if there are spaces in the
 640 \fIrelease\fR
 641 parameter\&.
 642 .sp
 643 For JAR files, the preference is to specify version requirements in the JAR file manifest rather than on the command line\&.
 644 .RE
 645 .SS "Non\-Standard Options"
 646 .PP
 647 These options are general purpose options that are specific to the Java HotSpot Virtual Machine\&.
 648 .PP
 649 \-X
 650 .RS 4
 651 Displays help for all available
 652 \fB\-X\fR
 653 options\&.
 654 .RE
 655 .PP
 656 \-Xbatch
 657 .RS 4
 658 Disables background compilation\&. By default, the JVM compiles the method as a background task, running the method in interpreter mode until the background compilation is finished\&. The
 659 \fB\-Xbatch\fR
 660 flag disables background compilation so that compilation of all methods proceeds as a foreground task until completed\&.
 661 .sp
 662 This option is equivalent to
 663 \fB\-XX:\-BackgroundCompilation\fR\&.
 664 .RE
 665 .PP
 666 \-Xbootclasspath:\fIpath\fR
 667 .RS 4
 668 Specifies a list of directories, JAR files, and ZIP archives separated by colons (:) to search for boot class files\&. These are used in place of the boot class files included in the JDK\&.
 669 .sp
 670 Do not deploy applications that use this option to override a class in
 671 \fBrt\&.jar\fR, because this violates the JRE binary code license\&.
 672 .RE
 673 .PP
 674 \-Xbootclasspath/a:\fIpath\fR
 675 .RS 4
 676 Specifies a list of directories, JAR files, and ZIP archives separated by colons (:) to append to the end of the default bootstrap class path\&.
 677 .sp
 678 Do not deploy applications that use this option to override a class in
 679 \fBrt\&.jar\fR, because this violates the JRE binary code license\&.
 680 .RE
 681 .PP
 682 \-Xbootclasspath/p:\fIpath\fR
 683 .RS 4
 684 Specifies a list of directories, JAR files, and ZIP archives separated by colons (:) to prepend to the front of the default bootstrap class path\&.
 685 .sp
 686 Do not deploy applications that use this option to override a class in
 687 \fBrt\&.jar\fR, because this violates the JRE binary code license\&.
 688 .RE
 689 .PP
 690 \-Xcheck:jni
 691 .RS 4
 692 Performs additional checks for Java Native Interface (JNI) functions\&. Specifically, it validates the parameters passed to the JNI function and the runtime environment data before processing the JNI request\&. Any invalid data encountered indicates a problem in the native code, and the JVM will terminate with an irrecoverable error in such cases\&. Expect a performance degradation when this option is used\&.
 693 .RE
 694 .PP
 695 \-Xcomp
 696 .RS 4
 697 Forces compilation of methods on first invocation\&. By default, the Client VM (\fB\-client\fR) performs 1,000 interpreted method invocations and the Server VM (\fB\-server\fR) performs 10,000 interpreted method invocations to gather information for efficient compilation\&. Specifying the
 698 \fB\-Xcomp\fR
 699 option disables interpreted method invocations to increase compilation performance at the expense of efficiency\&.
 700 .sp
 701 You can also change the number of interpreted method invocations before compilation using the
 702 \fB\-XX:CompileThreshold\fR
 703 option\&.
 704 .RE
 705 .PP
 706 \-Xdebug
 707 .RS 4
 708 Does nothing\&. Provided for backward compatibility\&.
 709 .RE
 710 .PP
 711 \-Xdiag
 712 .RS 4
 713 Shows additional diagnostic messages\&.
 714 .RE
 715 .PP
 716 \-Xfuture
 717 .RS 4
 718 Enables strict class\-file format checks that enforce close conformance to the class\-file format specification\&. Developers are encouraged to use this flag when developing new code because the stricter checks will become the default in future releases\&.
 719 .sp
 720 This option is deprecated and may be removed in a future release.
 721 .RE
 722 .PP
 723 \-Xint
 724 .RS 4
 725 Runs the application in interpreted\-only mode\&. Compilation to native code is disabled, and all bytecode is executed by the interpreter\&. The performance benefits offered by the just in time (JIT) compiler are not present in this mode\&.








































































































































































































































































































































































































































































































































 726 .RE
 727 .PP
 728 \-Xinternalversion
 729 .RS 4
 730 Displays more detailed JVM version information than the
 731 \fB\-version\fR
 732 option, and then exits\&.
 733 .RE
 734 .PP
 735 \-Xloggc:\fIfilename\fR
 736 .RS 4
 737 Sets the file to which verbose GC events information should be redirected for logging\&. The information written to this file is similar to the output of
 738 \fB\-verbose:gc\fR
 739 with the time elapsed since the first GC event preceding each logged event\&. The
 740 \fB\-Xloggc\fR
 741 option overrides
 742 \fB\-verbose:gc\fR
 743 if both are given with the same
 744 \fBjava\fR
 745 command\&.
 746 .sp
 747 Example:
 748 .sp
 749 .if n \{\
 750 .RS 4
 751 .\}
 752 .nf
 753 \fB\-Xloggc:garbage\-collection\&.log\fR
 754  
 755 .fi
 756 .if n \{\
 757 .RE
 758 .\}
 759 .RE
 760 .PP
 761 \-Xmaxjitcodesize=\fIsize\fR
 762 .RS 4
 763 Specifies the maximum code cache size (in bytes) for JIT\-compiled code\&. Append the letter
 764 \fBk\fR
 765 or
 766 \fBK\fR
 767 to indicate kilobytes,
 768 \fBm\fR
 769 or
 770 \fBM\fR
 771 to indicate megabytes,
 772 \fBg\fR
 773 or
 774 \fBG\fR
 775 to indicate gigabytes\&. The default maximum code cache size is 240 MB; if you disable tiered compilation with the option
 776 \fB\-XX:\-TieredCompilation\fR, then the default size is 48 MB:
 777 .sp
 778 .if n \{\
 779 .RS 4
 780 .\}
 781 .nf
 782 \fB\-Xmaxjitcodesize=240m\fR
 783  
 784 .fi
 785 .if n \{\
 786 .RE
 787 .\}
 788 This option is equivalent to
 789 \fB\-XX:ReservedCodeCacheSize\fR\&.
 790 .RE
 791 .PP
 792 \-Xmixed
 793 .RS 4
 794 Executes all bytecode by the interpreter except for hot methods, which are compiled to native code\&.
 795 .RE
 796 .PP
 797 \-Xmn\fIsize\fR
 798 .RS 4
 799 Sets the initial and maximum size (in bytes) of the heap for the young generation (nursery)\&. Append the letter
 800 \fBk\fR
 801 or
 802 \fBK\fR
 803 to indicate kilobytes,
 804 \fBm\fR
 805 or
 806 \fBM\fR
 807 to indicate megabytes,
 808 \fBg\fR
 809 or
 810 \fBG\fR
 811 to indicate gigabytes\&.
 812 .sp
 813 The young generation region of the heap is used for new objects\&. GC is performed in this region more often than in other regions\&. If the size for the young generation is too small, then a lot of minor garbage collections will be performed\&. If the size is too large, then only full garbage collections will be performed, which can take a long time to complete\&. Oracle recommends that you keep the size for the young generation between a half and a quarter of the overall heap size\&.
 814 .sp
 815 The following examples show how to set the initial and maximum size of young generation to 256 MB using various units:
 816 .sp
 817 .if n \{\
 818 .RS 4
 819 .\}
 820 .nf
 821 \fB\-Xmn256m\fR
 822 \fB\-Xmn262144k\fR
 823 \fB\-Xmn268435456\fR
 824  
 825 .fi
 826 .if n \{\
 827 .RE
 828 .\}
 829 Instead of the
 830 \fB\-Xmn\fR
 831 option to set both the initial and maximum size of the heap for the young generation, you can use
 832 \fB\-XX:NewSize\fR
 833 to set the initial size and
 834 \fB\-XX:MaxNewSize\fR
 835 to set the maximum size\&.
 836 .RE
 837 .PP
 838 \-Xms\fIsize\fR
 839 .RS 4
 840 Sets the initial size (in bytes) of the heap\&. This value must be a multiple of 1024 and greater than 1 MB\&. Append the letter
 841 \fBk\fR
 842 or
 843 \fBK\fR
 844 to indicate kilobytes,
 845 \fBm\fR
 846 or
 847 \fBM\fR
 848 to indicate megabytes,
 849 \fBg\fR
 850 or
 851 \fBG\fR
 852 to indicate gigabytes\&.
 853 .sp
 854 The following examples show how to set the size of allocated memory to 6 MB using various units:
 855 .sp
 856 .if n \{\
 857 .RS 4
 858 .\}
 859 .nf
 860 \fB\-Xms6291456\fR
 861 \fB\-Xms6144k\fR
 862 \fB\-Xms6m\fR
 863  
 864 .fi
 865 .if n \{\
 866 .RE
 867 .\}
 868 If you do not set this option, then the initial size will be set as the sum of the sizes allocated for the old generation and the young generation\&. The initial size of the heap for the young generation can be set using the
 869 \fB\-Xmn\fR
 870 option or the
 871 \fB\-XX:NewSize\fR
 872 option\&.
 873 .RE
 874 .PP
 875 \-Xmx\fIsize\fR
 876 .RS 4
 877 Specifies the maximum size (in bytes) of the memory allocation pool in bytes\&. This value must be a multiple of 1024 and greater than 2 MB\&. Append the letter
 878 \fBk\fR
 879 or
 880 \fBK\fR
 881 to indicate kilobytes,
 882 \fBm\fR
 883 or
 884 \fBM\fR
 885 to indicate megabytes,
 886 \fBg\fR
 887 or
 888 \fBG\fR
 889 to indicate gigabytes\&. The default value is chosen at runtime based on system configuration\&. For server deployments,
 890 \fB\-Xms\fR
 891 and
 892 \fB\-Xmx\fR
 893 are often set to the same value\&. See the section "Ergonomics" in
 894 \fIJava SE HotSpot Virtual Machine Garbage Collection Tuning Guide\fR
 895 at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gctuning/index\&.html\&.
 896 .sp
 897 The following examples show how to set the maximum allowed size of allocated memory to 80 MB using various units:
 898 .sp
 899 .if n \{\
 900 .RS 4
 901 .\}
 902 .nf
 903 \fB\-Xmx83886080\fR
 904 \fB\-Xmx81920k\fR
 905 \fB\-Xmx80m\fR
 906  
 907 .fi
 908 .if n \{\
 909 .RE
 910 .\}
 911 The
 912 \fB\-Xmx\fR
 913 option is equivalent to
 914 \fB\-XX:MaxHeapSize\fR\&.
 915 .RE
 916 .PP
 917 \-Xnoclassgc
 918 .RS 4
 919 Disables garbage collection (GC) of classes\&. This can save some GC time, which shortens interruptions during the application run\&.
 920 .sp
 921 When you specify
 922 \fB\-Xnoclassgc\fR
 923 at startup, the class objects in the application will be left untouched during GC and will always be considered live\&. This can result in more memory being permanently occupied which, if not used carefully, will throw an out of memory exception\&.
 924 .RE
 925 .PP
 926 \-Xprof
 927 .RS 4
 928 Profiles the running program and sends profiling data to standard output\&. This option is provided as a utility that is useful in program development and is not intended to be used in production systems\&.
 929 .RE
 930 .PP
 931 \-Xrs
 932 .RS 4
 933 Reduces the use of operating system signals by the JVM\&.
 934 .sp
 935 Shutdown hooks enable orderly shutdown of a Java application by running user cleanup code (such as closing database connections) at shutdown, even if the JVM terminates abruptly\&.
 936 .sp
 937 The JVM catches signals to implement shutdown hooks for unexpected termination\&. The JVM uses
 938 \fBSIGHUP\fR,
 939 \fBSIGINT\fR, and
 940 \fBSIGTERM\fR
 941 to initiate the running of shutdown hooks\&.
 942 .sp
 943 The JVM uses a similar mechanism to implement the feature of dumping thread stacks for debugging purposes\&. The JVM uses
 944 \fBSIGQUIT\fR
 945 to perform thread dumps\&.
 946 .sp
 947 Applications embedding the JVM frequently need to trap signals such as
 948 \fBSIGINT\fR
 949 or
 950 \fBSIGTERM\fR, which can lead to interference with the JVM signal handlers\&. The
 951 \fB\-Xrs\fR
 952 option is available to address this issue\&. When
 953 \fB\-Xrs\fR
 954 is used, the signal masks for
 955 \fBSIGINT\fR,
 956 \fBSIGTERM\fR,
 957 \fBSIGHUP\fR, and
 958 \fBSIGQUIT\fR
 959 are not changed by the JVM, and signal handlers for these signals are not installed\&.
 960 .sp
 961 There are two consequences of specifying
 962 \fB\-Xrs\fR:
 963 .sp
 964 .RS 4
 965 .ie n \{\
 966 \h'-04'\(bu\h'+03'\c
 967 .\}
 968 .el \{\
 969 .sp -1
 970 .IP \(bu 2.3
 971 .\}
 972 \fBSIGQUIT\fR
 973 thread dumps are not available\&.
 974 .RE
 975 .sp
 976 .RS 4
 977 .ie n \{\
 978 \h'-04'\(bu\h'+03'\c
 979 .\}
 980 .el \{\
 981 .sp -1
 982 .IP \(bu 2.3
 983 .\}
 984 User code is responsible for causing shutdown hooks to run, for example, by calling
 985 \fBSystem\&.exit()\fR
 986 when the JVM is to be terminated\&.
 987 .RE
 988 .RE
 989 .PP
 990 \-Xshare:\fImode\fR
 991 .RS 4
 992 Sets the class data sharing (CDS) mode\&. Possible
 993 \fImode\fR
 994 arguments for this option include the following:
 995 .PP
 996 auto
 997 .RS 4
 998 Use CDS if possible\&. This is the default value for Java HotSpot 32\-Bit Client VM\&.
 999 .RE
1000 .PP
1001 on
1002 .RS 4
1003 Require the use of CDS\&. Print an error message and exit if class data sharing cannot be used\&.
1004 .RE
1005 .PP
1006 off
1007 .RS 4
1008 Do not use CDS\&. This is the default value for Java HotSpot 32\-Bit Server VM, Java HotSpot 64\-Bit Client VM, and Java HotSpot 64\-Bit Server VM\&.
1009 .RE
1010 .PP
1011 dump
1012 .RS 4
1013 Manually generate the CDS archive\&. Specify the application class path as described in "Setting the Class Path "\&.
1014 .sp
1015 You should regenerate the CDS archive with each new JDK release\&.
1016 .RE
1017 .RE
1018 .PP
1019 \-XshowSettings:\fIcategory\fR
1020 .RS 4
1021 Shows settings and continues\&. Possible
1022 \fIcategory\fR
1023 arguments for this option include the following:
1024 .PP
1025 all
1026 .RS 4
1027 Shows all categories of settings\&. This is the default value\&.
1028 .RE
1029 .PP
1030 locale
1031 .RS 4
1032 Shows settings related to locale\&.
1033 .RE
1034 .PP
1035 properties
1036 .RS 4
1037 Shows settings related to system properties\&.
1038 .RE
1039 .PP
1040 vm
1041 .RS 4
1042 Shows the settings of the JVM\&.
1043 .RE
1044 .RE
1045 .PP
1046 \-Xss\fIsize\fR
1047 .RS 4
1048 Sets the thread stack size (in bytes)\&. Append the letter
1049 \fBk\fR
1050 or
1051 \fBK\fR
1052 to indicate KB,
1053 \fBm\fR
1054 or
1055 \fBM\fR
1056 to indicate MB,
1057 \fBg\fR
1058 or
1059 \fBG\fR
1060 to indicate GB\&. The default value depends on the platform:
1061 .sp
1062 .RS 4
1063 .ie n \{\
1064 \h'-04'\(bu\h'+03'\c
1065 .\}
1066 .el \{\
1067 .sp -1
1068 .IP \(bu 2.3
1069 .\}
1070 Linux/ARM (32\-bit): 320 KB
1071 .RE
1072 .sp
1073 .RS 4
1074 .ie n \{\
1075 \h'-04'\(bu\h'+03'\c
1076 .\}
1077 .el \{\
1078 .sp -1
1079 .IP \(bu 2.3
1080 .\}
1081 Linux/i386 (32\-bit): 320 KB
1082 .RE
1083 .sp
1084 .RS 4
1085 .ie n \{\
1086 \h'-04'\(bu\h'+03'\c
1087 .\}
1088 .el \{\
1089 .sp -1
1090 .IP \(bu 2.3
1091 .\}
1092 Linux/x64 (64\-bit): 1024 KB
1093 .RE
1094 .sp
1095 .RS 4
1096 .ie n \{\
1097 \h'-04'\(bu\h'+03'\c
1098 .\}
1099 .el \{\
1100 .sp -1
1101 .IP \(bu 2.3
1102 .\}
1103 OS X (64\-bit): 1024 KB
1104 .RE
1105 .sp
1106 .RS 4
1107 .ie n \{\
1108 \h'-04'\(bu\h'+03'\c
1109 .\}
1110 .el \{\
1111 .sp -1
1112 .IP \(bu 2.3
1113 .\}
1114 Oracle Solaris/i386 (32\-bit): 320 KB
1115 .RE
1116 .sp
1117 .RS 4
1118 .ie n \{\
1119 \h'-04'\(bu\h'+03'\c
1120 .\}
1121 .el \{\
1122 .sp -1
1123 .IP \(bu 2.3
1124 .\}
1125 Oracle Solaris/x64 (64\-bit): 1024 KB
1126 .RE
1127 .sp
1128 The following examples set the thread stack size to 1024 KB in different units:
1129 .sp
1130 .if n \{\
1131 .RS 4
1132 .\}
1133 .nf
1134 \fB\-Xss1m\fR
1135 \fB\-Xss1024k\fR
1136 \fB\-Xss1048576\fR
1137  
1138 .fi
1139 .if n \{\
1140 .RE
1141 .\}
1142 This option is equivalent to
1143 \fB\-XX:ThreadStackSize\fR\&.
1144 .RE
1145 .PP
1146 \-Xusealtsigs
1147 .RS 4
1148 Use alternative signals instead of
1149 \fBSIGUSR1\fR
1150 and
1151 \fBSIGUSR2\fR
1152 for JVM internal signals\&. This option is equivalent to
1153 \fB\-XX:+UseAltSigs\fR\&.
1154 .RE
1155 .PP
1156 \-Xverify:\fImode\fR
1157 .RS 4
1158 Sets the mode of the bytecode verifier\&. Bytecode verification helps to troubleshoot some problems, but it also adds overhead to the running application\&. Possible
1159 \fImode\fR
1160 arguments for this option include the following:
1161 .PP
1162 none
1163 .RS 4
1164 Do not verify the bytecode\&. This reduces startup time and also reduces the protection provided by Java\&.
1165 .sp
1166 This option is deprecated and may be removed in a future release.
1167 .RE
1168 .PP
1169 remote
1170 .RS 4
1171 Verify those classes that are not loaded by the bootstrap class loader\&. This is the default behavior if you do not specify the
1172 \fB\-Xverify\fR
1173 option\&.
1174 .RE
1175 .PP
1176 all
1177 .RS 4
1178 Verify all classes\&.
1179 .RE
1180 .RE
1181 .SS "Advanced Runtime Options"
1182 .PP
1183 These options control the runtime behavior of the Java HotSpot VM\&.
1184 .PP
1185 \-XX:+DisableAttachMechanism
1186 .RS 4
1187 Enables the option that disables the mechanism that lets tools attach to the JVM\&. By default, this option is disabled, meaning that the attach mechanism is enabled and you can use tools such as
1188 \fBjcmd\fR,
1189 \fBjstack\fR,
1190 \fBjmap\fR, and
1191 \fBjinfo\fR\&.
1192 .RE
1193 .PP
1194 \-XX:ErrorFile=\fIfilename\fR
1195 .RS 4
1196 Specifies the path and file name to which error data is written when an irrecoverable error occurs\&. By default, this file is created in the current working directory and named
1197 \fBhs_err_pid\fR\fIpid\fR\fB\&.log\fR
1198 where
1199 \fIpid\fR
1200 is the identifier of the process that caused the error\&. The following example shows how to set the default log file (note that the identifier of the process is specified as
1201 \fB%p\fR):
1202 .sp
1203 .if n \{\
1204 .RS 4
1205 .\}
1206 .nf
1207 \fB\-XX:ErrorFile=\&./hs_err_pid%p\&.log\fR
1208  
1209 .fi
1210 .if n \{\
1211 .RE
1212 .\}
1213 The following example shows how to set the error log to
1214 \fB/var/log/java/java_error\&.log\fR:
1215 .sp
1216 .if n \{\
1217 .RS 4
1218 .\}
1219 .nf
1220 \fB\-XX:ErrorFile=/var/log/java/java_error\&.log\fR
1221  
1222 .fi
1223 .if n \{\
1224 .RE
1225 .\}
1226 If the file cannot be created in the specified directory (due to insufficient space, permission problem, or another issue), then the file is created in the temporary directory for the operating system\&. The temporary directory is
1227 \fB/tmp\fR\&.
1228 .RE
1229 .PP
1230 \-XX:+FailOverToOldVerifier
1231 .RS 4
1232 Enables automatic failover to the old verifier when the new type checker fails\&. By default, this option is disabled and it is ignored (that is, treated as disabled) for classes with a recent bytecode version\&. You can enable it for classes with older versions of the bytecode\&.
1233 .RE










































































































































































































































































































































































1234 .PP
1235 \-XX:LargePageSizeInBytes=\fIsize\fR
1236 .RS 4
1237 On Solaris, sets the maximum size (in bytes) for large pages used for Java heap\&. The
1238 \fIsize\fR
1239 argument must be a power of 2 (2, 4, 8, 16, \&.\&.\&.)\&. Append the letter
1240 \fBk\fR
1241 or
1242 \fBK\fR
1243 to indicate kilobytes,
1244 \fBm\fR
1245 or
1246 \fBM\fR
1247 to indicate megabytes,
1248 \fBg\fR
1249 or
1250 \fBG\fR
1251 to indicate gigabytes\&. By default, the size is set to 0, meaning that the JVM chooses the size for large pages automatically\&.
1252 .sp
1253 The following example illustrates how to set the large page size to 4 megabytes (MB):
1254 .sp
1255 .if n \{\
1256 .RS 4
1257 .\}
1258 .nf
1259 \fB\-XX:LargePageSizeInBytes=4m\fR
1260  
1261 .fi
1262 .if n \{\
1263 .RE
1264 .\}
1265 .RE
1266 .PP
1267 \-XX:MaxDirectMemorySize=\fIsize\fR
1268 .RS 4
1269 Sets the maximum total size (in bytes) of the New I/O (the
1270 \fBjava\&.nio\fR
1271 package) direct\-buffer allocations\&. Append the letter
1272 \fBk\fR
1273 or
1274 \fBK\fR
1275 to indicate kilobytes,
1276 \fBm\fR
1277 or
1278 \fBM\fR
1279 to indicate megabytes,
1280 \fBg\fR
1281 or
1282 \fBG\fR
1283 to indicate gigabytes\&. By default, the size is set to 0, meaning that the JVM chooses the size for NIO direct\-buffer allocations automatically\&.
1284 .sp
1285 The following examples illustrate how to set the NIO size to 1024 KB in different units:
1286 .sp
1287 .if n \{\
1288 .RS 4
1289 .\}
1290 .nf
1291 \fB\-XX:MaxDirectMemorySize=1m\fR
1292 \fB\-XX:MaxDirectMemorySize=1024k\fR
1293 \fB\-XX:MaxDirectMemorySize=1048576\fR
1294  
1295 .fi
1296 .if n \{\
1297 .RE
1298 .\}
1299 .RE
1300 .PP
1301 \-XX:NativeMemoryTracking=\fImode\fR
1302 .RS 4
1303 Specifies the mode for tracking JVM native memory usage\&. Possible
1304 \fImode\fR
1305 arguments for this option include the following:
1306 .PP
1307 off
1308 .RS 4
1309 Do not track JVM native memory usage\&. This is the default behavior if you do not specify the
1310 \fB\-XX:NativeMemoryTracking\fR
1311 option\&.
1312 .RE
1313 .PP
1314 summary
1315 .RS 4
1316 Only track memory usage by JVM subsystems, such as Java heap, class, code, and thread\&.
1317 .RE
1318 .PP
1319 detail
1320 .RS 4
1321 In addition to tracking memory usage by JVM subsystems, track memory usage by individual
1322 \fBCallSite\fR, individual virtual memory region and its committed regions\&.
1323 .RE
1324 .RE
1325 .PP
1326 \-XX:ObjectAlignmentInBytes=\fIalignment\fR
1327 .RS 4
1328 Sets the memory alignment of Java objects (in bytes)\&. By default, the value is set to 8 bytes\&. The specified value should be a power of two, and must be within the range of 8 and 256 (inclusive)\&. This option makes it possible to use compressed pointers with large Java heap sizes\&.
1329 .sp
1330 The heap size limit in bytes is calculated as:
1331 .sp
1332 \fB4GB * ObjectAlignmentInBytes\fR
1333 .sp
1334 Note: As the alignment value increases, the unused space between objects will also increase\&. As a result, you may not realize any benefits from using compressed pointers with large Java heap sizes\&.
1335 .RE
1336 .PP
1337 \-XX:OnError=\fIstring\fR
1338 .RS 4
1339 Sets a custom command or a series of semicolon\-separated commands to run when an irrecoverable error occurs\&. If the string contains spaces, then it must be enclosed in quotation marks\&.
1340 .sp
1341 The following example shows how the
1342 \fB\-XX:OnError\fR
1343 option can be used to run the
1344 \fBgcore\fR
1345 command to create the core image, and the debugger is started to attach to the process in case of an irrecoverable error (the
1346 \fB%p\fR
1347 designates the current process):
1348 .sp
1349 .if n \{\
1350 .RS 4
1351 .\}
1352 .nf
1353 \fB\-XX:OnError="gcore %p;dbx \- %p"\fR
1354  
1355 .fi
1356 .if n \{\
1357 .RE
1358 .\}
1359 .RE
1360 .PP
1361 \-XX:OnOutOfMemoryError=\fIstring\fR
1362 .RS 4
1363 Sets a custom command or a series of semicolon\-separated commands to run when an
1364 \fBOutOfMemoryError\fR
1365 exception is first thrown\&. If the string contains spaces, then it must be enclosed in quotation marks\&. For an example of a command string, see the description of the
1366 \fB\-XX:OnError\fR
1367 option\&.
1368 .RE
1369 .PP
1370 \-XX:+PerfDataSaveToFile
1371 .RS 4
1372 If enabled, saves
1373 jstat(1) binary data when the Java application exits\&. This binary data is saved in a file named
1374 \fBhsperfdata_\fR\fI<pid>\fR, where
1375 \fI<pid>\fR
1376 is the process identifier of the Java application you ran\&. Use
1377 \fBjstat\fR
1378 to display the performance data contained in this file as follows:
1379 .sp
1380 .if n \{\
1381 .RS 4
1382 .\}
1383 .nf
1384 \fBjstat \-class file:///\fR\fB\fI<path>\fR\fR\fB/hsperfdata_\fR\fB\fI<pid>\fR\fR
1385 \fBjstat \-gc file:///\fR\fB\fI<path>\fR\fR\fB/hsperfdata_\fR\fB\fI<pid>\fR\fR
1386 .fi
1387 .if n \{\
1388 .RE
1389 .\}
1390 .RE

1391 .PP
1392 \-XX:+PrintCommandLineFlags
1393 .RS 4
1394 Enables printing of ergonomically selected JVM flags that appeared on the command line\&. It can be useful to know the ergonomic values set by the JVM, such as the heap space size and the selected garbage collector\&. By default, this option is disabled and flags are not printed\&.
1395 .RE
1396 .PP
1397 \-XX:+PrintNMTStatistics
1398 .RS 4
1399 Enables printing of collected native memory tracking data at JVM exit when native memory tracking is enabled (see
1400 \fB\-XX:NativeMemoryTracking\fR)\&. By default, this option is disabled and native memory tracking data is not printed\&.
1401 .RE
1402 .PP
1403 \-XX:+ShowMessageBoxOnError
1404 .RS 4
1405 Enables displaying of a dialog box when the JVM experiences an irrecoverable error\&. This prevents the JVM from exiting and keeps the process active so that you can attach a debugger to it to investigate the cause of the error\&. By default, this option is disabled\&.
1406 .RE
1407 .PP
1408 \-XX:ThreadStackSize=\fIsize\fR
1409 .RS 4
1410 Sets the thread stack size (in bytes)\&. Append the letter
1411 \fBk\fR
1412 or
1413 \fBK\fR
1414 to indicate kilobytes,
1415 \fBm\fR
1416 or
1417 \fBM\fR
1418 to indicate megabytes,
1419 \fBg\fR
1420 or
1421 \fBG\fR
1422 to indicate gigabytes\&. The default value depends on the platform:
1423 .sp
1424 .RS 4
1425 .ie n \{\
1426 \h'-04'\(bu\h'+03'\c
1427 .\}
1428 .el \{\
1429 .sp -1
1430 .IP \(bu 2.3
1431 .\}
1432 Linux/ARM (32\-bit): 320 KB
1433 .RE
1434 .sp
1435 .RS 4
1436 .ie n \{\
1437 \h'-04'\(bu\h'+03'\c
1438 .\}
1439 .el \{\
1440 .sp -1
1441 .IP \(bu 2.3
1442 .\}
1443 Linux/i386 (32\-bit): 320 KB
1444 .RE
1445 .sp
1446 .RS 4
1447 .ie n \{\
1448 \h'-04'\(bu\h'+03'\c
1449 .\}
1450 .el \{\
1451 .sp -1
1452 .IP \(bu 2.3
1453 .\}



































































































































































































1454 Linux/x64 (64\-bit): 1024 KB
1455 .RE
1456 .sp
1457 .RS 4
1458 .ie n \{\
1459 \h'-04'\(bu\h'+03'\c
1460 .\}
1461 .el \{\
1462 .sp -1
1463 .IP \(bu 2.3
1464 .\}
1465 OS X (64\-bit): 1024 KB
1466 .RE
1467 .sp
1468 .RS 4
1469 .ie n \{\
1470 \h'-04'\(bu\h'+03'\c
1471 .\}
1472 .el \{\
1473 .sp -1
1474 .IP \(bu 2.3
1475 .\}
1476 Oracle Solaris/i386 (32\-bit): 320 KB
1477 .RE
1478 .sp
1479 .RS 4
1480 .ie n \{\
1481 \h'-04'\(bu\h'+03'\c
1482 .\}
1483 .el \{\
1484 .sp -1
1485 .IP \(bu 2.3
1486 .\}
1487 Oracle Solaris/x64 (64\-bit): 1024 KB
1488 .RE
1489 .sp
1490 The following examples show how to set the thread stack size to 1024 KB in different units:
1491 .sp
1492 .if n \{\
1493 .RS 4
1494 .\}
1495 .nf
1496 \fB\-XX:ThreadStackSize=1m\fR
1497 \fB\-XX:ThreadStackSize=1024k\fR
1498 \fB\-XX:ThreadStackSize=1048576\fR
1499  
1500 .fi
1501 .if n \{\
1502 .RE
1503 .\}
1504 This option is equivalent to
1505 \fB\-Xss\fR\&.
1506 .RE
1507 .PP
1508 \-XX:+TraceClassLoading
1509 .RS 4
1510 Enables tracing of classes as they are loaded\&. By default, this option is disabled and classes are not traced\&.
1511 .RE
1512 .PP
1513 \-XX:+TraceClassLoadingPreorder
1514 .RS 4
1515 Enables tracing of all loaded classes in the order in which they are referenced\&. By default, this option is disabled and classes are not traced\&.
1516 .RE
1517 .PP
1518 \-XX:+TraceClassResolution
1519 .RS 4
1520 Enables tracing of constant pool resolutions\&. By default, this option is disabled and constant pool resolutions are not traced\&.
1521 .RE
1522 .PP
1523 \-XX:+TraceClassUnloading
1524 .RS 4
1525 Enables tracing of classes as they are unloaded\&. By default, this option is disabled and classes are not traced\&.
1526 .RE
1527 .PP
1528 \-XX:+TraceLoaderConstraints
1529 .RS 4
1530 Enables tracing of the loader constraints recording\&. By default, this option is disabled and loader constraints recording is not traced\&.
1531 .RE
1532 .PP
1533 \-XX:+UseAltSigs
1534 .RS 4
1535 Enables the use of alternative signals instead of
1536 \fBSIGUSR1\fR
1537 and
1538 \fBSIGUSR2\fR
1539 for JVM internal signals\&. By default, this option is disabled and alternative signals are not used\&. This option is equivalent to
1540 \fB\-Xusealtsigs\fR\&.
1541 .RE
1542 .PP
1543 \-XX:\-UseBiasedLocking
1544 .RS 4
1545 Disables the use of biased locking\&. Some applications with significant amounts of uncontended synchronization may attain significant speedups with this flag enabled, whereas applications with certain patterns of locking may see slowdowns\&. For more information about the biased locking technique, see the example in Java Tuning White Paper at http://www\&.oracle\&.com/technetwork/java/tuning\-139912\&.html#section4\&.2\&.5
1546 .sp
1547 By default, this option is enabled\&.
1548 .RE
1549 .PP
1550 \-XX:\-UseCompressedOops
1551 .RS 4
1552 Disables the use of compressed pointers\&. By default, this option is enabled, and compressed pointers are used when Java heap sizes are less than 32 GB\&. When this option is enabled, object references are represented as 32\-bit offsets instead of 64\-bit pointers, which typically increases performance when running the application with Java heap sizes less than 32 GB\&. This option works only for 64\-bit JVMs\&.
1553 .sp
1554 It is also possible to use compressed pointers when Java heap sizes are greater than 32GB\&. See the
1555 \fB\-XX:ObjectAlignmentInBytes\fR
1556 option\&.
1557 .RE
1558 .PP
1559 \-XX:+UseHugeTLBFS
1560 .RS 4
1561 This option for Linux is the equivalent of specifying
1562 \fB\-XX:+UseLargePages\fR\&. This option is disabled by default\&. This option pre\-allocates all large pages up\-front, when memory is reserved; consequently the JVM cannot dynamically grow or shrink large pages memory areas; see
1563 \fB\-XX:UseTransparentHugePages\fR
1564 if you want this behavior\&.
1565 .sp
1566 For more information, see "Large Pages"\&.
1567 .RE
1568 .PP
1569 \-XX:+UseLargePages
1570 .RS 4
1571 Enables the use of large page memory\&. By default, this option is disabled and large page memory is not used\&.
1572 .sp
1573 For more information, see "Large Pages"\&.
1574 .RE
1575 .PP
1576 \-XX:+UseMembar
1577 .RS 4
1578 Enables issuing of membars on thread state transitions\&. This option is disabled by default on all platforms except ARM servers, where it is enabled\&. (It is recommended that you do not disable this option on ARM servers\&.)
1579 .RE
1580 .PP
1581 \-XX:+UsePerfData
1582 .RS 4
1583 Enables the
1584 \fBperfdata\fR
1585 feature\&. This option is enabled by default to allow JVM monitoring and performance testing\&. Disabling it suppresses the creation of the
1586 \fBhsperfdata_userid\fR
1587 directories\&. To disable the
1588 \fBperfdata\fR
1589 feature, specify
1590 \fB\-XX:\-UsePerfData\fR\&.
1591 .RE
1592 .PP
1593 \-XX:+UseTransparentHugePages
1594 .RS 4
1595 On Linux, enables the use of large pages that can dynamically grow or shrink\&. This option is disabled by default\&. You may encounter performance problems with transparent huge pages as the OS moves other pages around to create huge pages; this option is made available for experimentation\&.
1596 .sp
1597 For more information, see "Large Pages"\&.
1598 .RE
1599 .PP
1600 \-XX:+AllowUserSignalHandlers
1601 .RS 4
1602 Enables installation of signal handlers by the application\&. By default, this option is disabled and the application is not allowed to install signal handlers\&.
1603 .RE
1604 .SS "Advanced JIT Compiler Options"
1605 .PP
1606 These options control the dynamic just\-in\-time (JIT) compilation performed by the Java HotSpot VM\&.
1607 .PP
1608 \-XX:AllocateInstancePrefetchLines=\fIlines\fR
1609 .RS 4
1610 Sets the number of lines to prefetch ahead of the instance allocation pointer\&. By default, the number of lines to prefetch is set to 1:
1611 .sp
1612 .if n \{\
1613 .RS 4
1614 .\}
1615 .nf
1616 \fB\-XX:AllocateInstancePrefetchLines=1\fR
1617  
1618 .fi
1619 .if n \{\
1620 .RE
1621 .\}
1622 Only the Java HotSpot Server VM supports this option\&.
1623 .RE
1624 .PP
1625 \-XX:AllocatePrefetchDistance=\fIsize\fR
1626 .RS 4
1627 Sets the size (in bytes) of the prefetch distance for object allocation\&. Memory about to be written with the value of new objects is prefetched up to this distance starting from the address of the last allocated object\&. Each Java thread has its own allocation point\&.
1628 .sp
1629 Negative values denote that prefetch distance is chosen based on the platform\&. Positive values are bytes to prefetch\&. Append the letter
1630 \fBk\fR
1631 or
1632 \fBK\fR
1633 to indicate kilobytes,
1634 \fBm\fR
1635 or
1636 \fBM\fR
1637 to indicate megabytes,
1638 \fBg\fR
1639 or
1640 \fBG\fR
1641 to indicate gigabytes\&. The default value is set to \-1\&.
1642 .sp
1643 The following example shows how to set the prefetch distance to 1024 bytes:
1644 .sp
1645 .if n \{\
1646 .RS 4
1647 .\}
1648 .nf
1649 \fB\-XX:AllocatePrefetchDistance=1024\fR
1650  
1651 .fi
1652 .if n \{\
1653 .RE
1654 .\}
1655 Only the Java HotSpot Server VM supports this option\&.
1656 .RE
1657 .PP
1658 \-XX:AllocatePrefetchInstr=\fIinstruction\fR
1659 .RS 4
1660 Sets the prefetch instruction to prefetch ahead of the allocation pointer\&. Only the Java HotSpot Server VM supports this option\&. Possible values are from 0 to 3\&. The actual instructions behind the values depend on the platform\&. By default, the prefetch instruction is set to 0:
1661 .sp
1662 .if n \{\
1663 .RS 4
1664 .\}
1665 .nf
1666 \fB\-XX:AllocatePrefetchInstr=0\fR
1667  
1668 .fi
1669 .if n \{\
1670 .RE
1671 .\}
1672 Only the Java HotSpot Server VM supports this option\&.
1673 .RE
1674 .PP
1675 \-XX:AllocatePrefetchLines=\fIlines\fR
1676 .RS 4
1677 Sets the number of cache lines to load after the last object allocation by using the prefetch instructions generated in compiled code\&. The default value is 1 if the last allocated object was an instance, and 3 if it was an array\&.
1678 .sp
1679 The following example shows how to set the number of loaded cache lines to 5:
1680 .sp
1681 .if n \{\
1682 .RS 4
1683 .\}
1684 .nf
1685 \fB\-XX:AllocatePrefetchLines=5\fR
1686  
1687 .fi
1688 .if n \{\
1689 .RE
1690 .\}
1691 Only the Java HotSpot Server VM supports this option\&.
1692 .RE
1693 .PP
1694 \-XX:AllocatePrefetchStepSize=\fIsize\fR
1695 .RS 4
1696 Sets the step size (in bytes) for sequential prefetch instructions\&. Append the letter
1697 \fBk\fR
1698 or
1699 \fBK\fR
1700 to indicate kilobytes,
1701 \fBm\fR
1702 or
1703 \fBM\fR
1704 to indicate megabytes,
1705 \fBg\fR
1706 or
1707 \fBG\fR
1708 to indicate gigabytes\&. By default, the step size is set to 16 bytes:
1709 .sp
1710 .if n \{\
1711 .RS 4
1712 .\}
1713 .nf
1714 \fB\-XX:AllocatePrefetchStepSize=16\fR
1715  
1716 .fi
1717 .if n \{\
1718 .RE
1719 .\}
1720 Only the Java HotSpot Server VM supports this option\&.
1721 .RE
1722 .PP
1723 \-XX:AllocatePrefetchStyle=\fIstyle\fR
1724 .RS 4
1725 Sets the generated code style for prefetch instructions\&. The
1726 \fIstyle\fR
1727 argument is an integer from 0 to 3:
1728 .PP
1729 0
1730 .RS 4
1731 Do not generate prefetch instructions\&.
1732 .RE
1733 .PP
1734 1
1735 .RS 4
1736 Execute prefetch instructions after each allocation\&. This is the default parameter\&.
1737 .RE
1738 .PP
1739 2
1740 .RS 4
1741 Use the thread\-local allocation block (TLAB) watermark pointer to determine when prefetch instructions are executed\&.
1742 .RE
1743 .PP
1744 3
1745 .RS 4
1746 Use BIS instruction on SPARC for allocation prefetch\&.
1747 .RE
1748 .sp
1749 Only the Java HotSpot Server VM supports this option\&.
1750 .RE
1751 .PP
1752 \-XX:+BackgroundCompilation
1753 .RS 4
1754 Enables background compilation\&. This option is enabled by default\&. To disable background compilation, specify
1755 \fB\-XX:\-BackgroundCompilation\fR
1756 (this is equivalent to specifying
1757 \fB\-Xbatch\fR)\&.
1758 .RE
1759 .PP
1760 \-XX:CICompilerCount=\fIthreads\fR
1761 .RS 4
1762 Sets the number of compiler threads to use for compilation\&. By default, the number of threads is set to 2 for the server JVM, to 1 for the client JVM, and it scales to the number of cores if tiered compilation is used\&. The following example shows how to set the number of threads to 2:
1763 .sp
1764 .if n \{\
1765 .RS 4
1766 .\}
1767 .nf
1768 \fB\-XX:CICompilerCount=2\fR
1769  
1770 .fi
1771 .if n \{\
1772 .RE
1773 .\}
1774 .RE
1775 .PP
1776 \-XX:CodeCacheMinimumFreeSpace=\fIsize\fR
1777 .RS 4
1778 Sets the minimum free space (in bytes) required for compilation\&. Append the letter
1779 \fBk\fR
1780 or
1781 \fBK\fR
1782 to indicate kilobytes,
1783 \fBm\fR
1784 or
1785 \fBM\fR
1786 to indicate megabytes,
1787 \fBg\fR
1788 or
1789 \fBG\fR
1790 to indicate gigabytes\&. When less than the minimum free space remains, compiling stops\&. By default, this option is set to 500 KB\&. The following example shows how to set the minimum free space to 1024 MB:
1791 .sp
1792 .if n \{\
1793 .RS 4
1794 .\}
1795 .nf
1796 \fB\-XX:CodeCacheMinimumFreeSpace=1024m\fR
1797  
1798 .fi
1799 .if n \{\
1800 .RE
1801 .\}
1802 .RE
1803 .PP
1804 \-XX:CompileCommand=\fIcommand\fR,\fImethod\fR[,\fIoption\fR]
1805 .RS 4
1806 Specifies a command to perform on a method\&. For example, to exclude the
1807 \fBindexOf()\fR
1808 method of the
1809 \fBString\fR
1810 class from being compiled, use the following:
1811 .sp
1812 .if n \{\
1813 .RS 4
1814 .\}
1815 .nf
1816 \fB\-XX:CompileCommand=exclude,java/lang/String\&.indexOf\fR
1817  
1818 .fi
1819 .if n \{\
1820 .RE
1821 .\}
1822 Note that the full class name is specified, including all packages and subpackages separated by a slash (\fB/\fR)\&. For easier cut and paste operations, it is also possible to use the method name format produced by the
1823 \fB\-XX:+PrintCompilation\fR
1824 and
1825 \fB\-XX:+LogCompilation\fR
1826 options:
1827 .sp
1828 .if n \{\
1829 .RS 4
1830 .\}
1831 .nf
1832 \fB\-XX:CompileCommand=exclude,java\&.lang\&.String::indexOf\fR
1833  
1834 .fi
1835 .if n \{\
1836 .RE
1837 .\}
1838 If the method is specified without the signature, the command will be applied to all methods with the specified name\&. However, you can also specify the signature of the method in the class file format\&. In this case, you should enclose the arguments in quotation marks, because otherwise the shell treats the semicolon as command end\&. For example, if you want to exclude only the
1839 \fBindexOf(String)\fR
1840 method of the
1841 \fBString\fR
1842 class from being compiled, use the following:
1843 .sp
1844 .if n \{\
1845 .RS 4
1846 .\}
1847 .nf
1848 \fB\-XX:CompileCommand="exclude,java/lang/String\&.indexOf,(Ljava/lang/String;)I"\fR
1849  
1850 .fi
1851 .if n \{\
1852 .RE
1853 .\}
1854 You can also use the asterisk (*) as a wildcard for class and method names\&. For example, to exclude all
1855 \fBindexOf()\fR
1856 methods in all classes from being compiled, use the following:
1857 .sp
1858 .if n \{\
1859 .RS 4
1860 .\}
1861 .nf
1862 \fB\-XX:CompileCommand=exclude,*\&.indexOf\fR
1863  
1864 .fi
1865 .if n \{\
1866 .RE
1867 .\}
1868 The commas and periods are aliases for spaces, making it easier to pass compiler commands through a shell\&. You can pass arguments to
1869 \fB\-XX:CompileCommand\fR
1870 using spaces as separators by enclosing the argument in quotation marks:
1871 .sp
1872 .if n \{\
1873 .RS 4
1874 .\}
1875 .nf
1876 \fB\-XX:CompileCommand="exclude java/lang/String indexOf"\fR
1877  
1878 .fi
1879 .if n \{\
1880 .RE
1881 .\}
1882 Note that after parsing the commands passed on the command line using the
1883 \fB\-XX:CompileCommand\fR
1884 options, the JIT compiler then reads commands from the
1885 \fB\&.hotspot_compiler\fR
1886 file\&. You can add commands to this file or specify a different file using the
1887 \fB\-XX:CompileCommandFile\fR
1888 option\&.
1889 .sp
1890 To add several commands, either specify the
1891 \fB\-XX:CompileCommand\fR
1892 option multiple times, or separate each argument with the newline separator (\fB\en\fR)\&. The following commands are available:
1893 .PP
1894 break
1895 .RS 4
1896 Set a breakpoint when debugging the JVM to stop at the beginning of compilation of the specified method\&.
1897 .RE
1898 .PP
1899 compileonly
1900 .RS 4
1901 Exclude all methods from compilation except for the specified method\&. As an alternative, you can use the
1902 \fB\-XX:CompileOnly\fR
1903 option, which allows to specify several methods\&.
1904 .RE
1905 .PP
1906 dontinline
1907 .RS 4
1908 Prevent inlining of the specified method\&.
1909 .RE
1910 .PP
1911 exclude
1912 .RS 4
1913 Exclude the specified method from compilation\&.
1914 .RE
1915 .PP
1916 help
1917 .RS 4
1918 Print a help message for the
1919 \fB\-XX:CompileCommand\fR
1920 option\&.
1921 .RE
1922 .PP
1923 inline
1924 .RS 4
1925 Attempt to inline the specified method\&.
1926 .RE
1927 .PP
1928 log
1929 .RS 4
1930 Exclude compilation logging (with the
1931 \fB\-XX:+LogCompilation\fR
1932 option) for all methods except for the specified method\&. By default, logging is performed for all compiled methods\&.
1933 .RE
1934 .PP
1935 option
1936 .RS 4
1937 This command can be used to pass a JIT compilation option to the specified method in place of the last argument (\fIoption\fR)\&. The compilation option is set at the end, after the method name\&. For example, to enable the
1938 \fBBlockLayoutByFrequency\fR
1939 option for the
1940 \fBappend()\fR
1941 method of the
1942 \fBStringBuffer\fR
1943 class, use the following:
1944 .sp
1945 .if n \{\
1946 .RS 4
1947 .\}
1948 .nf
1949 \fB\-XX:CompileCommand=option,java/lang/StringBuffer\&.append,BlockLayoutByFrequency\fR
1950  
1951 .fi
1952 .if n \{\
1953 .RE
1954 .\}
1955 You can specify multiple compilation options, separated by commas or spaces\&.
1956 .RE
1957 .PP
1958 print
1959 .RS 4
1960 Print generated assembler code after compilation of the specified method\&.
1961 .RE
1962 .PP
1963 quiet
1964 .RS 4
1965 Do not print the compile commands\&. By default, the commands that you specify with the \-\fBXX:CompileCommand\fR
1966 option are printed; for example, if you exclude from compilation the
1967 \fBindexOf()\fR
1968 method of the
1969 \fBString\fR
1970 class, then the following will be printed to standard output:
1971 .sp
1972 .if n \{\
1973 .RS 4
1974 .\}
1975 .nf
1976 \fBCompilerOracle: exclude java/lang/String\&.indexOf\fR
1977  
1978 .fi
1979 .if n \{\
1980 .RE
1981 .\}
1982 You can suppress this by specifying the
1983 \fB\-XX:CompileCommand=quiet\fR
1984 option before other
1985 \fB\-XX:CompileCommand\fR
1986 options\&.
1987 .RE
1988 .RE
1989 .PP
1990 \-XX:CompileCommandFile=\fIfilename\fR
1991 .RS 4
1992 Sets the file from which JIT compiler commands are read\&. By default, the
1993 \fB\&.hotspot_compiler\fR
1994 file is used to store commands performed by the JIT compiler\&.
1995 .sp
1996 Each line in the command file represents a command, a class name, and a method name for which the command is used\&. For example, this line prints assembly code for the
1997 \fBtoString()\fR
1998 method of the
1999 \fBString\fR



























































2000 class:
2001 .sp
2002 .if n \{\
2003 .RS 4
2004 .\}
2005 .nf
2006 \fBprint java/lang/String toString\fR
2007  
2008 .fi
2009 .if n \{\
2010 .RE
2011 .\}
2012 For more information about specifying the commands for the JIT compiler to perform on methods, see the
2013 \fB\-XX:CompileCommand\fR
2014 option\&.
2015 .RE
2016 .PP
2017 \-XX:CompileOnly=\fImethods\fR
2018 .RS 4
2019 Sets the list of methods (separated by commas) to which compilation should be restricted\&. Only the specified methods will be compiled\&. Specify each method with the full class name (including the packages and subpackages)\&. For example, to compile only the
2020 \fBlength()\fR
2021 method of the
2022 \fBString\fR
2023 class and the
2024 \fBsize()\fR
2025 method of the
2026 \fBList\fR
2027 class, use the following:
2028 .sp
2029 .if n \{\
2030 .RS 4
2031 .\}
2032 .nf
2033 \fB\-XX:CompileOnly=java/lang/String\&.length,java/util/List\&.size\fR
2034  
2035 .fi
2036 .if n \{\
2037 .RE
2038 .\}
2039 Note that the full class name is specified, including all packages and subpackages separated by a slash (\fB/\fR)\&. For easier cut and paste operations, it is also possible to use the method name format produced by the
2040 \fB\-XX:+PrintCompilation\fR
2041 and
2042 \fB\-XX:+LogCompilation\fR
2043 options:
2044 .sp
2045 .if n \{\
2046 .RS 4
2047 .\}
2048 .nf
2049 \fB\-XX:CompileOnly=java\&.lang\&.String::length,java\&.util\&.List::size\fR
2050  
2051 .fi
2052 .if n \{\
2053 .RE
2054 .\}
2055 Although wildcards are not supported, you can specify only the class or package name to compile all methods in that class or package, as well as specify just the method to compile methods with this name in any class:
2056 .sp
2057 .if n \{\
2058 .RS 4
2059 .\}
2060 .nf
2061 \fB\-XX:CompileOnly=java/lang/String\fR
2062 \fB\-XX:CompileOnly=java/lang\fR
2063 \fB\-XX:CompileOnly=\&.length\fR
2064  
2065 .fi
2066 .if n \{\
2067 .RE
2068 .\}
2069 .RE


































































2070 .PP
2071 \-XX:CompileThreshold=\fIinvocations\fR
2072 .RS 4
2073 Sets the number of interpreted method invocations before compilation\&. By default, in the server JVM, the JIT compiler performs 10,000 interpreted method invocations to gather information for efficient compilation\&. For the client JVM, the default setting is 1,500 invocations\&. This option is ignored when tiered compilation is enabled; see the option
2074 \fB\-XX:+TieredCompilation\fR\&. The following example shows how to set the number of interpreted method invocations to 5,000:
2075 .sp
2076 .if n \{\
2077 .RS 4
2078 .\}
2079 .nf
2080 \fB\-XX:CompileThreshold=5000\fR
2081  
2082 .fi
2083 .if n \{\
2084 .RE
2085 .\}
2086 You can completely disable interpretation of Java methods before compilation by specifying the
2087 \fB\-Xcomp\fR
2088 option\&.
2089 .RE
2090 .PP
2091 \-XX:+DoEscapeAnalysis
2092 .RS 4
2093 Enables the use of escape analysis\&. This option is enabled by default\&. To disable the use of escape analysis, specify
2094 \fB\-XX:\-DoEscapeAnalysis\fR\&. Only the Java HotSpot Server VM supports this option\&.
2095 .RE
2096 .PP
2097 \-XX:InitialCodeCacheSize=\fIsize\fR
2098 .RS 4
2099 Sets the initial code cache size (in bytes)\&. Append the letter
2100 \fBk\fR
2101 or
2102 \fBK\fR
2103 to indicate kilobytes,
2104 \fBm\fR
2105 or
2106 \fBM\fR
2107 to indicate megabytes,
2108 \fBg\fR
2109 or
2110 \fBG\fR
2111 to indicate gigabytes\&. The default value is set to 500 KB\&. The initial code cache size should be not less than the system\*(Aqs minimal memory page size\&. The following example shows how to set the initial code cache size to 32 KB:
2112 .sp
2113 .if n \{\
2114 .RS 4
2115 .\}
2116 .nf
2117 \fB\-XX:InitialCodeCacheSize=32k\fR
2118  
2119 .fi
2120 .if n \{\
2121 .RE
2122 .\}
2123 .RE
2124 .PP
2125 \-XX:+Inline
2126 .RS 4
2127 Enables method inlining\&. This option is enabled by default to increase performance\&. To disable method inlining, specify
2128 \fB\-XX:\-Inline\fR\&.
2129 .RE
2130 .PP
2131 \-XX:InlineSmallCode=\fIsize\fR
2132 .RS 4
2133 Sets the maximum code size (in bytes) for compiled methods that should be inlined\&. Append the letter
2134 \fBk\fR
2135 or
2136 \fBK\fR
2137 to indicate kilobytes,
2138 \fBm\fR
2139 or
2140 \fBM\fR
2141 to indicate megabytes,
2142 \fBg\fR
2143 or
2144 \fBG\fR
2145 to indicate gigabytes\&. Only compiled methods with the size smaller than the specified size will be inlined\&. By default, the maximum code size is set to 1000 bytes:
2146 .sp
2147 .if n \{\
2148 .RS 4
2149 .\}
2150 .nf
2151 \fB\-XX:InlineSmallCode=1000\fR
2152  
2153 .fi
2154 .if n \{\
2155 .RE
2156 .\}
2157 .RE
2158 .PP
2159 \-XX:+LogCompilation
2160 .RS 4
2161 Enables logging of compilation activity to a file named
2162 \fBhotspot\&.log\fR
2163 in the current working directory\&. You can specify a different log file path and name using the
2164 \fB\-XX:LogFile\fR
2165 option\&.
2166 .sp
2167 By default, this option is disabled and compilation activity is not logged\&. The
2168 \fB\-XX:+LogCompilation\fR
2169 option has to be used together with the
2170 \fB\-XX:UnlockDiagnosticVMOptions\fR
2171 option that unlocks diagnostic JVM options\&.
2172 .sp
2173 You can enable verbose diagnostic output with a message printed to the console every time a method is compiled by using the
2174 \fB\-XX:+PrintCompilation\fR
2175 option\&.
2176 .RE
2177 .PP
2178 \-XX:MaxInlineSize=\fIsize\fR
2179 .RS 4
2180 Sets the maximum bytecode size (in bytes) of a method to be inlined\&. Append the letter
2181 \fBk\fR
2182 or
2183 \fBK\fR
2184 to indicate kilobytes,
2185 \fBm\fR
2186 or
2187 \fBM\fR
2188 to indicate megabytes,
2189 \fBg\fR
2190 or
2191 \fBG\fR
2192 to indicate gigabytes\&. By default, the maximum bytecode size is set to 35 bytes:
2193 .sp
2194 .if n \{\
2195 .RS 4
2196 .\}
2197 .nf
2198 \fB\-XX:MaxInlineSize=35\fR
2199  
2200 .fi
2201 .if n \{\
2202 .RE
2203 .\}
2204 .RE

































































2205 .PP
2206 \-XX:MaxNodeLimit=\fInodes\fR
2207 .RS 4
2208 Sets the maximum number of nodes to be used during single method compilation\&. By default, the maximum number of nodes is set to 65,000:
2209 .sp
2210 .if n \{\
2211 .RS 4
2212 .\}
2213 .nf
2214 \fB\-XX:MaxNodeLimit=65000\fR
2215  
2216 .fi
2217 .if n \{\
2218 .RE
2219 .\}
2220 .RE









































































































































































































































































































































































































































































































































2221 .PP
2222 \-XX:MaxTrivialSize=\fIsize\fR
2223 .RS 4
2224 Sets the maximum bytecode size (in bytes) of a trivial method to be inlined\&. Append the letter
2225 \fBk\fR
2226 or
2227 \fBK\fR
2228 to indicate kilobytes,
2229 \fBm\fR
2230 or
2231 \fBM\fR
2232 to indicate megabytes,
2233 \fBg\fR
2234 or
2235 \fBG\fR
2236 to indicate gigabytes\&. By default, the maximum bytecode size of a trivial method is set to 6 bytes:
2237 .sp
2238 .if n \{\
2239 .RS 4
2240 .\}
2241 .nf
2242 \fB\-XX:MaxTrivialSize=6\fR
2243  
2244 .fi
2245 .if n \{\
2246 .RE
2247 .\}
2248 .RE
2249 .PP
2250 \-XX:+OptimizeStringConcat
2251 .RS 4
2252 Enables the optimization of
2253 \fBString\fR
2254 concatenation operations\&. This option is enabled by default\&. To disable the optimization of
2255 \fBString\fR
2256 concatenation operations, specify
2257 \fB\-XX:\-OptimizeStringConcat\fR\&. Only the Java HotSpot Server VM supports this option\&.
2258 .RE
2259 .PP
2260 \-XX:+PrintAssembly
2261 .RS 4
2262 Enables printing of assembly code for bytecoded and native methods by using the external
2263 \fBdisassembler\&.so\fR
2264 library\&. This enables you to see the generated code, which may help you to diagnose performance issues\&.
2265 .sp
2266 By default, this option is disabled and assembly code is not printed\&. The
2267 \fB\-XX:+PrintAssembly\fR
2268 option has to be used together with the
2269 \fB\-XX:UnlockDiagnosticVMOptions\fR
2270 option that unlocks diagnostic JVM options\&.
2271 .RE

























































































































































































































































































































































































































































































































































































2272 .PP
2273 \-XX:+PrintCompilation
2274 .RS 4
2275 Enables verbose diagnostic output from the JVM by printing a message to the console every time a method is compiled\&. This enables you to see which methods actually get compiled\&. By default, this option is disabled and diagnostic output is not printed\&.
2276 .sp
2277 You can also log compilation activity to a file by using the
2278 \fB\-XX:+LogCompilation\fR
2279 option\&.
2280 .RE
2281 .PP
2282 \-XX:+PrintInlining
2283 .RS 4
2284 Enables printing of inlining decisions\&. This enables you to see which methods are getting inlined\&.
2285 .sp
2286 By default, this option is disabled and inlining information is not printed\&. The
2287 \fB\-XX:+PrintInlining\fR
2288 option has to be used together with the
2289 \fB\-XX:+UnlockDiagnosticVMOptions\fR
2290 option that unlocks diagnostic JVM options\&.
2291 .RE
2292 .PP
2293 \-XX:ReservedCodeCacheSize=\fIsize\fR
2294 .RS 4
2295 Sets the maximum code cache size (in bytes) for JIT\-compiled code\&. Append the letter
2296 \fBk\fR
2297 or
2298 \fBK\fR
2299 to indicate kilobytes,
2300 \fBm\fR
2301 or
2302 \fBM\fR
2303 to indicate megabytes,
2304 \fBg\fR
2305 or
2306 \fBG\fR
2307 to indicate gigabytes\&. The default maximum code cache size is 240 MB; if you disable tiered compilation with the option
2308 \fB\-XX:\-TieredCompilation\fR, then the default size is 48 MB\&. This option has a limit of 2 GB; otherwise, an error is generated\&. The maximum code cache size should not be less than the initial code cache size; see the option
2309 \fB\-XX:InitialCodeCacheSize\fR\&. This option is equivalent to
2310 \fB\-Xmaxjitcodesize\fR\&.
2311 .RE

































































































2312 .PP
2313 \-XX:RTMAbortRatio=\fIabort_ratio\fR
2314 .RS 4
2315 The RTM abort ratio is specified as a percentage (%) of all executed RTM transactions\&. If a number of aborted transactions becomes greater than this ratio, then the compiled code will be deoptimized\&. This ratio is used when the
2316 \fB\-XX:+UseRTMDeopt\fR
2317 option is enabled\&. The default value of this option is 50\&. This means that the compiled code will be deoptimized if 50% of all transactions are aborted\&.
2318 .RE

































2319 .PP
2320 \-XX:RTMRetryCount=\fInumber_of_retries\fR
2321 .RS 4
2322 RTM locking code will be retried, when it is aborted or busy, the number of times specified by this option before falling back to the normal locking mechanism\&. The default value for this option is 5\&. The
2323 \fB\-XX:UseRTMLocking\fR
2324 option must be enabled\&.
2325 .RE
2326 .PP
2327 \-XX:\-TieredCompilation
2328 .RS 4
2329 Disables the use of tiered compilation\&. By default, this option is enabled\&. Only the Java HotSpot Server VM supports this option\&.
2330 .RE























































































































































































































































































































































































































































































































































































2331 .PP
2332 \-XX:+UseAES
2333 .RS 4
2334 Enables hardware\-based AES intrinsics for Intel, AMD, and SPARC hardware\&. Intel Westmere (2010 and newer), AMD Bulldozer (2011 and newer), and SPARC (T4 and newer) are the supported hardware\&. UseAES is used in conjunction with UseAESIntrinsics\&.
2335 .RE




































































2336 .PP
2337 \-XX:+UseAESIntrinsics
2338 .RS 4
2339 UseAES and UseAESIntrinsics flags are enabled by default and are supported only for Java HotSpot Server VM 32\-bit and 64\-bit\&. To disable hardware\-based AES intrinsics, specify
2340 \fB\-XX:\-UseAES \-XX:\-UseAESIntrinsics\fR\&. For example, to enable hardware AES, use the following flags:
2341 .sp
2342 .if n \{\
2343 .RS 4
2344 .\}
2345 .nf
2346 \fB\-XX:+UseAES \-XX:+UseAESIntrinsics\fR
2347  
2348 .fi
2349 .if n \{\
2350 .RE
2351 .\}
2352 To support UseAES and UseAESIntrinsics flags for 32\-bit and 64\-bit use
2353 \fB\-server\fR
2354 option to choose Java HotSpot Server VM\&. These flags are not supported on Client VM\&.
2355 .RE

































































































































2356 .PP
2357 \-XX:+UseCodeCacheFlushing
2358 .RS 4
2359 Enables flushing of the code cache before shutting down the compiler\&. This option is enabled by default\&. To disable flushing of the code cache before shutting down the compiler, specify
2360 \fB\-XX:\-UseCodeCacheFlushing\fR\&.
2361 .RE


























































































































2362 .PP
2363 \-XX:+UseCondCardMark
2364 .RS 4
2365 Enables checking of whether the card is already marked before updating the card table\&. This option is disabled by default and should only be used on machines with multiple sockets, where it will increase performance of Java applications that rely heavily on concurrent operations\&. Only the Java HotSpot Server VM supports this option\&.







































































































































































































































































2366 .RE
2367 .PP
2368 \-XX:+UseRTMDeopt
2369 .RS 4
2370 Auto\-tunes RTM locking depending on the abort ratio\&. This ratio is specified by
2371 \fB\-XX:RTMAbortRatio\fR
2372 option\&. If the number of aborted transactions exceeds the abort ratio, then the method containing the lock will be deoptimized and recompiled with all locks as normal locks\&. This option is disabled by default\&. The
2373 \fB\-XX:+UseRTMLocking\fR
2374 option must be enabled\&.
2375 .RE













2376 .PP
2377 \-XX:+UseRTMLocking
2378 .RS 4
2379 Generate Restricted Transactional Memory (RTM) locking code for all inflated locks, with the normal locking mechanism as the fallback handler\&. This option is disabled by default\&. Options related to RTM are only available for the Java HotSpot Server VM on x86 CPUs that support Transactional Synchronization Extensions (TSX)\&.
2380 .sp
2381 RTM is part of Intel\*(Aqs TSX, which is an x86 instruction set extension and facilitates the creation of multithreaded applications\&. RTM introduces the new instructions
2382 \fBXBEGIN\fR,
2383 \fBXABORT\fR,
2384 \fBXEND\fR, and
2385 \fBXTEST\fR\&. The
2386 \fBXBEGIN\fR
2387 and
2388 \fBXEND\fR
2389 instructions enclose a set of instructions to run as a transaction\&. If no conflict is found when running the transaction, the memory and register modifications are committed together at the
2390 \fBXEND\fR
2391 instruction\&. The
2392 \fBXABORT\fR
2393 instruction can be used to explicitly abort a transaction and the
2394 \fBXEND\fR
2395 instruction to check if a set of instructions are being run in a transaction\&.
2396 .sp
2397 A lock on a transaction is inflated when another thread tries to access the same transaction, thereby blocking the thread that did not originally request access to the transaction\&. RTM requires that a fallback set of operations be specified in case a transaction aborts or fails\&. An RTM lock is a lock that has been delegated to the TSX\*(Aqs system\&.
2398 .sp
2399 RTM improves performance for highly contended locks with low conflict in a critical region (which is code that must not be accessed by more than one thread concurrently)\&. RTM also improves the performance of coarse\-grain locking, which typically does not perform well in multithreaded applications\&. (Coarse\-grain locking is the strategy of holding locks for long periods to minimize the overhead of taking and releasing locks, while fine\-grained locking is the strategy of trying to achieve maximum parallelism by locking only when necessary and unlocking as soon as possible\&.) Also, for lightly contended locks that are used by different threads, RTM can reduce false cache line sharing, also known as cache line ping\-pong\&. This occurs when multiple threads from different processors are accessing different resources, but the resources share the same cache line\&. As a result, the processors repeatedly invalidate the cache lines of other processors, which forces them to read from main memory instead of their cache\&.


































































































2400 .RE
2401 .PP
2402 \-XX:+UseSHA
2403 .RS 4
2404 Enables hardware\-based intrinsics for SHA crypto hash functions for SPARC hardware\&.
2405 \fBUseSHA\fR
2406 is used in conjunction with the
2407 \fBUseSHA1Intrinsics\fR,
2408 \fBUseSHA256Intrinsics\fR, and
2409 \fBUseSHA512Intrinsics\fR
2410 options\&.
2411 .sp
2412 The
2413 \fBUseSHA\fR
2414 and
2415 \fBUseSHA*Intrinsics\fR
2416 flags are enabled by default, and are supported only for Java HotSpot Server VM 64\-bit on SPARC T4 and newer\&.
2417 .sp
2418 This feature is only applicable when using the
2419 \fBsun\&.security\&.provider\&.Sun\fR
2420 provider for SHA operations\&.
2421 .sp
2422 To disable all hardware\-based SHA intrinsics, specify
2423 \fB\-XX:\-UseSHA\fR\&. To disable only a particular SHA intrinsic, use the appropriate corresponding option\&. For example:
2424 \fB\-XX:\-UseSHA256Intrinsics\fR\&.
2425 .RE
2426 .PP
2427 \-XX:+UseSHA1Intrinsics
2428 .RS 4
2429 Enables intrinsics for SHA\-1 crypto hash function\&.
2430 .RE
2431 .PP
2432 \-XX:+UseSHA256Intrinsics
2433 .RS 4
2434 Enables intrinsics for SHA\-224 and SHA\-256 crypto hash functions\&.
2435 .RE


















































2436 .PP
2437 \-XX:+UseSHA512Intrinsics
2438 .RS 4
2439 Enables intrinsics for SHA\-384 and SHA\-512 crypto hash functions\&.
2440 .RE
2441 .PP
2442 \-XX:+UseSuperWord
2443 .RS 4
2444 Enables the transformation of scalar operations into superword operations\&. This option is enabled by default\&. To disable the transformation of scalar operations into superword operations, specify
2445 \fB\-XX:\-UseSuperWord\fR\&. Only the Java HotSpot Server VM supports this option\&.
2446 .RE
2447 .SS "Advanced Serviceability Options"
2448 .PP
2449 These options provide the ability to gather system information and perform extensive debugging\&.


2450 .PP
2451 \-XX:+ExtendedDTraceProbes
2452 .RS 4
2453 Enables additional
2454 \fBdtrace\fR
2455 tool probes that impact the performance\&. By default, this option is disabled and
2456 \fBdtrace\fR
2457 performs only standard probes\&.
2458 .RE
2459 .PP
2460 \-XX:+HeapDumpOnOutOfMemory
2461 .RS 4
2462 Enables the dumping of the Java heap to a file in the current directory by using the heap profiler (HPROF) when a
2463 \fBjava\&.lang\&.OutOfMemoryError\fR
2464 exception is thrown\&. You can explicitly set the heap dump file path and name using the
2465 \fB\-XX:HeapDumpPath\fR
2466 option\&. By default, this option is disabled and the heap is not dumped when an
2467 \fBOutOfMemoryError\fR
2468 exception is thrown\&.
2469 .RE
2470 .PP
2471 \-XX:HeapDumpPath=\fIpath\fR
2472 .RS 4
2473 Sets the path and file name for writing the heap dump provided by the heap profiler (HPROF) when the
2474 \fB\-XX:+HeapDumpOnOutOfMemoryError\fR
2475 option is set\&. By default, the file is created in the current working directory, and it is named
2476 \fBjava_pid\fR\fIpid\fR\fB\&.hprof\fR
2477 where
2478 \fIpid\fR
2479 is the identifier of the process that caused the error\&. The following example shows how to set the default file explicitly (\fB%p\fR
2480 represents the current process identificator):
2481 .sp
2482 .if n \{\
2483 .RS 4
2484 .\}
2485 .nf
2486 \fB\-XX:HeapDumpPath=\&./java_pid%p\&.hprof\fR
2487  


2488 .fi
2489 .if n \{\
2490 .RE
2491 .\}
2492 The following example shows how to set the heap dump file to
2493 \fB/var/log/java/java_heapdump\&.hprof\fR:
2494 .sp
2495 .if n \{\
2496 .RS 4
2497 .\}
2498 .nf
2499 \fB\-XX:HeapDumpPath=/var/log/java/java_heapdump\&.hprof\fR
2500  
2501 .fi
2502 .if n \{\
2503 .RE
2504 .\}
2505 .RE
2506 .PP
2507 \-XX:LogFile=\fIpath\fR
2508 .RS 4
2509 Sets the path and file name where log data is written\&. By default, the file is created in the current working directory, and it is named
2510 \fBhotspot\&.log\fR\&.
2511 .sp
2512 The following example shows how to set the log file to
2513 \fB/var/log/java/hotspot\&.log\fR:
2514 .sp
2515 .if n \{\
2516 .RS 4
2517 .\}
2518 .nf
2519 \fB\-XX:LogFile=/var/log/java/hotspot\&.log\fR
2520  

2521 .fi
2522 .if n \{\
2523 .RE
2524 .\}
2525 .RE
2526 .PP
2527 \-XX:+PrintClassHistogram
2528 .RS 4
2529 Enables printing of a class instance histogram after a
2530 \fBControl+C\fR
2531 event (\fBSIGTERM\fR)\&. By default, this option is disabled\&.
2532 .sp
2533 Setting this option is equivalent to running the
2534 \fBjmap \-histo\fR
2535 command, or the
2536 \fBjcmd \fR\fIpid\fR\fB GC\&.class_histogram\fR
2537 command, where
2538 \fIpid\fR
2539 is the current Java process identifier\&.
2540 .RE
2541 .PP
2542 \-XX:+PrintConcurrentLocks
2543 .RS 4
2544 Enables printing of locks after a event\&. By default, this option is disabled\&.
2545 .sp
2546 Enables printing of
2547 \fBjava\&.util\&.concurrent\fR
2548 locks after a
2549 \fBControl+C\fR
2550 event (\fBSIGTERM\fR)\&. By default, this option is disabled\&.
2551 .sp
2552 Setting this option is equivalent to running the
2553 \fBjstack \-l\fR
2554 command or the
2555 \fBjcmd \fR\fIpid\fR\fB Thread\&.print \-l\fR
2556 command, where
2557 \fIpid\fR
2558 is the current Java process identifier\&.
2559 .RE
2560 .PP
2561 \-XX:+UnlockDiagnosticVMOptions
2562 .RS 4
2563 Unlocks the options intended for diagnosing the JVM\&. By default, this option is disabled and diagnostic options are not available\&.
2564 .RE
2565 .SS "Advanced Garbage Collection Options"
2566 .PP
2567 These options control how garbage collection (GC) is performed by the Java HotSpot VM\&.
2568 .PP
2569 \-XX:+AggressiveHeap
2570 .RS 4
2571 Enables Java heap optimization\&. This sets various parameters to be optimal for long\-running jobs with intensive memory allocation, based on the configuration of the computer (RAM and CPU)\&. By default, the option is disabled and the heap is not optimized\&.
2572 .RE
2573 .PP
2574 \-XX:+AlwaysPreTouch
2575 .RS 4
2576 Enables touching of every page on the Java heap during JVM initialization\&. This gets all pages into the memory before entering the
2577 \fBmain()\fR
2578 method\&. The option can be used in testing to simulate a long\-running system with all virtual memory mapped to physical memory\&. By default, this option is disabled and all pages are committed as JVM heap space fills\&.
2579 .RE
2580 .PP
2581 \-XX:+CMSClassUnloadingEnabled
2582 .RS 4
2583 Enables class unloading when using the concurrent mark\-sweep (CMS) garbage collector\&. This option is enabled by default\&. To disable class unloading for the CMS garbage collector, specify
2584 \fB\-XX:\-CMSClassUnloadingEnabled\fR\&.
2585 .RE
2586 .PP
2587 \-XX:CMSExpAvgFactor=\fIpercent\fR
2588 .RS 4
2589 Sets the percentage of time (0 to 100) used to weight the current sample when computing exponential averages for the concurrent collection statistics\&. By default, the exponential averages factor is set to 25%\&. The following example shows how to set the factor to 15%:
2590 .sp
2591 .if n \{\
2592 .RS 4
2593 .\}
2594 .nf
2595 \fB\-XX:CMSExpAvgFactor=15\fR
2596  

2597 .fi
2598 .if n \{\
2599 .RE
2600 .\}
2601 .RE












2602 .PP
2603 \-XX:CMSInitiatingOccupancyFraction=\fIpercent\fR
2604 .RS 4
2605 Sets the percentage of the old generation occupancy (0 to 100) at which to start a CMS collection cycle\&. The default value is set to \-1\&. Any negative value (including the default) implies that
2606 \fB\-XX:CMSTriggerRatio\fR
2607 is used to define the value of the initiating occupancy fraction\&.
2608 .sp
2609 The following example shows how to set the occupancy fraction to 20%:
2610 .sp
2611 .if n \{\
2612 .RS 4
2613 .\}
2614 .nf
2615 \fB\-XX:CMSInitiatingOccupancyFraction=20\fR
2616  
2617 .fi
2618 .if n \{\
2619 .RE
2620 .\}
2621 .RE
2622 .PP
2623 \-XX:+CMSScavengeBeforeRemark
2624 .RS 4
2625 Enables scavenging attempts before the CMS remark step\&. By default, this option is disabled\&.
2626 .RE
2627 .PP
2628 \-XX:CMSTriggerRatio=\fIpercent\fR
2629 .RS 4
2630 Sets the percentage (0 to 100) of the value specified by
2631 \fB\-XX:MinHeapFreeRatio\fR
2632 that is allocated before a CMS collection cycle commences\&. The default value is set to 80%\&.
2633 .sp
2634 The following example shows how to set the occupancy fraction to 75%:
2635 .sp
2636 .if n \{\
2637 .RS 4
2638 .\}
2639 .nf
2640 \fB\-XX:CMSTriggerRatio=75\fR
2641  
2642 .fi
2643 .if n \{\
2644 .RE
2645 .\}
2646 .RE
2647 .PP
2648 \-XX:ConcGCThreads=\fIthreads\fR
2649 .RS 4
2650 Sets the number of threads used for concurrent GC\&. The default value depends on the number of CPUs available to the JVM\&.
2651 .sp
2652 For example, to set the number of threads for concurrent GC to 2, specify the following option:
2653 .sp
2654 .if n \{\
2655 .RS 4
2656 .\}
2657 .nf
2658 \fB\-XX:ConcGCThreads=2\fR
2659  

2660 .fi
2661 .if n \{\
2662 .RE
2663 .\}
2664 .RE
2665 .PP
2666 \-XX:+DisableExplicitGC
2667 .RS 4
2668 Enables the option that disables processing of calls to
2669 \fBSystem\&.gc()\fR\&. This option is disabled by default, meaning that calls to
2670 \fBSystem\&.gc()\fR
2671 are processed\&. If processing of calls to
2672 \fBSystem\&.gc()\fR
2673 is disabled, the JVM still performs GC when necessary\&.
2674 .RE
2675 .PP
2676 \-XX:+ExplicitGCInvokesConcurrent
2677 .RS 4
2678 Enables invoking of concurrent GC by using the
2679 \fBSystem\&.gc()\fR
2680 request\&. This option is disabled by default and can be enabled only together with the
2681 \fB\-XX:+UseConcMarkSweepGC\fR
2682 option\&.
2683 .RE







2684 .PP
2685 \-XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses
2686 .RS 4
2687 Enables invoking of concurrent GC by using the
2688 \fBSystem\&.gc()\fR
2689 request and unloading of classes during the concurrent GC cycle\&. This option is disabled by default and can be enabled only together with the
2690 \fB\-XX:+UseConcMarkSweepGC\fR
2691 option\&.
2692 .RE
2693 .PP
2694 \-XX:G1HeapRegionSize=\fIsize\fR
2695 .RS 4
2696 Sets the size of the regions into which the Java heap is subdivided when using the garbage\-first (G1) collector\&. The value can be between 1 MB and 32 MB\&. The default region size is determined ergonomically based on the heap size\&.
2697 .sp
2698 The following example shows how to set the size of the subdivisions to 16 MB:
2699 .sp
2700 .if n \{\

2701 .RS 4
2702 .\}
2703 .nf
2704 \fB\-XX:G1HeapRegionSize=16m\fR
2705  
2706 .fi
2707 .if n \{\
2708 .RE
2709 .\}
2710 .RE
2711 .PP
2712 \-XX:+G1PrintHeapRegions
2713 .RS 4
2714 Enables the printing of information about which regions are allocated and which are reclaimed by the G1 collector\&. By default, this option is disabled\&.
2715 .RE
2716 .PP
2717 \-XX:G1ReservePercent=\fIpercent\fR
2718 .RS 4
2719 Sets the percentage of the heap (0 to 50) that is reserved as a false ceiling to reduce the possibility of promotion failure for the G1 collector\&. By default, this option is set to 10%\&.
2720 .sp
2721 The following example shows how to set the reserved heap to 20%:
2722 .sp
2723 .if n \{\
2724 .RS 4
2725 .\}
2726 .nf
2727 \fB\-XX:G1ReservePercent=20\fR
2728  
2729 .fi
2730 .if n \{\
2731 .RE
2732 .\}
2733 .RE
2734 .PP
2735 \-XX:InitialHeapSize=\fIsize\fR
2736 .RS 4
2737 Sets the initial size (in bytes) of the memory allocation pool\&. This value must be either 0, or a multiple of 1024 and greater than 1 MB\&. Append the letter
2738 \fBk\fR
2739 or
2740 \fBK\fR
2741 to indicate kilobytes,
2742 \fBm\fR
2743 or
2744 \fBM\fR
2745 to indicate megabytes,
2746 \fBg\fR
2747 or
2748 \fBG\fR
2749 to indicate gigabytes\&. The default value is chosen at runtime based on system configuration\&. See the section "Ergonomics" in
2750 \fIJava SE HotSpot Virtual Machine Garbage Collection Tuning Guide\fR
2751 at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gctuning/index\&.html\&.
2752 .sp
2753 The following examples show how to set the size of allocated memory to 6 MB using various units:
2754 .sp
2755 .if n \{\
2756 .RS 4
2757 .\}
2758 .nf
2759 \fB\-XX:InitialHeapSize=6291456\fR
2760 \fB\-XX:InitialHeapSize=6144k\fR
2761 \fB\-XX:InitialHeapSize=6m\fR
2762  
2763 .fi
2764 .if n \{\
2765 .RE
2766 .\}
2767 If you set this option to 0, then the initial size will be set as the sum of the sizes allocated for the old generation and the young generation\&. The size of the heap for the young generation can be set using the
2768 \fB\-XX:NewSize\fR
2769 option\&.
2770 .RE
2771 .PP
2772 \-XX:InitialSurvivorRatio=\fIratio\fR
2773 .RS 4
2774 Sets the initial survivor space ratio used by the throughput garbage collector (which is enabled by the
2775 \fB\-XX:+UseParallelGC\fR
2776 and/or \-\fBXX:+UseParallelOldGC\fR
2777 options)\&. Adaptive sizing is enabled by default with the throughput garbage collector by using the
2778 \fB\-XX:+UseParallelGC\fR
2779 and
2780 \fB\-XX:+UseParallelOldGC\fR
2781 options, and survivor space is resized according to the application behavior, starting with the initial value\&. If adaptive sizing is disabled (using the
2782 \fB\-XX:\-UseAdaptiveSizePolicy\fR
2783 option), then the
2784 \fB\-XX:SurvivorRatio\fR
2785 option should be used to set the size of the survivor space for the entire execution of the application\&.
2786 .sp
2787 The following formula can be used to calculate the initial size of survivor space (S) based on the size of the young generation (Y), and the initial survivor space ratio (R):
2788 .sp
2789 .if n \{\
2790 .RS 4
2791 .\}
2792 .nf
2793 \fBS=Y/(R+2)\fR
2794  
2795 .fi
2796 .if n \{\
2797 .RE
2798 .\}
2799 The 2 in the equation denotes two survivor spaces\&. The larger the value specified as the initial survivor space ratio, the smaller the initial survivor space size\&.
2800 .sp
2801 By default, the initial survivor space ratio is set to 8\&. If the default value for the young generation space size is used (2 MB), the initial size of the survivor space will be 0\&.2 MB\&.
2802 .sp
2803 The following example shows how to set the initial survivor space ratio to 4:
2804 .sp
2805 .if n \{\
2806 .RS 4
2807 .\}
2808 .nf
2809 \fB\-XX:InitialSurvivorRatio=4\fR
2810  
2811 .fi
2812 .if n \{\
2813 .RE
2814 .\}
2815 .RE
2816 .PP
2817 \-XX:InitiatingHeapOccupancyPercent=\fIpercent\fR
2818 .RS 4
2819 Sets the percentage of the heap occupancy (0 to 100) at which to start a concurrent GC cycle\&. It is used by garbage collectors that trigger a concurrent GC cycle based on the occupancy of the entire heap, not just one of the generations (for example, the G1 garbage collector)\&.
2820 .sp
2821 By default, the initiating value is set to 45%\&. A value of 0 implies nonstop GC cycles\&. The following example shows how to set the initiating heap occupancy to 75%:
2822 .sp
2823 .if n \{\
2824 .RS 4
2825 .\}
2826 .nf
2827 \fB\-XX:InitiatingHeapOccupancyPercent=75\fR
2828  
2829 .fi
2830 .if n \{\
2831 .RE
2832 .\}
2833 .RE
2834 .PP
2835 \-XX:MaxGCPauseMillis=\fItime\fR
2836 .RS 4
2837 Sets a target for the maximum GC pause time (in milliseconds)\&. This is a soft goal, and the JVM will make its best effort to achieve it\&. By default, there is no maximum pause time value\&.
2838 .sp
2839 The following example shows how to set the maximum target pause time to 500 ms:
2840 .sp
2841 .if n \{\
2842 .RS 4
2843 .\}
2844 .nf
2845 \fB\-XX:MaxGCPauseMillis=500\fR
2846  
2847 .fi
2848 .if n \{\
2849 .RE
2850 .\}
2851 .RE
2852 .PP
2853 \-XX:MaxHeapSize=\fIsize\fR
2854 .RS 4
2855 Sets the maximum size (in byes) of the memory allocation pool\&. This value must be a multiple of 1024 and greater than 2 MB\&. Append the letter
2856 \fBk\fR
2857 or
2858 \fBK\fR
2859 to indicate kilobytes,
2860 \fBm\fR
2861 or
2862 \fBM\fR
2863 to indicate megabytes,
2864 \fBg\fR
2865 or
2866 \fBG\fR
2867 to indicate gigabytes\&. The default value is chosen at runtime based on system configuration\&. For server deployments,
2868 \fB\-XX:InitialHeapSize\fR
2869 and
2870 \fB\-XX:MaxHeapSize\fR
2871 are often set to the same value\&. See the section "Ergonomics" in
2872 \fIJava SE HotSpot Virtual Machine Garbage Collection Tuning Guide\fR
2873 at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gctuning/index\&.html\&.
2874 .sp
2875 The following examples show how to set the maximum allowed size of allocated memory to 80 MB using various units:
2876 .sp
2877 .if n \{\
2878 .RS 4
2879 .\}
2880 .nf
2881 \fB\-XX:MaxHeapSize=83886080\fR
2882 \fB\-XX:MaxHeapSize=81920k\fR
2883 \fB\-XX:MaxHeapSize=80m\fR
2884  
2885 .fi
2886 .if n \{\
2887 .RE
2888 .\}
2889 On Oracle Solaris 7 and Oracle Solaris 8 SPARC platforms, the upper limit for this value is approximately 4,000 MB minus overhead amounts\&. On Oracle Solaris 2\&.6 and x86 platforms, the upper limit is approximately 2,000 MB minus overhead amounts\&. On Linux platforms, the upper limit is approximately 2,000 MB minus overhead amounts\&.
2890 .sp
2891 The
2892 \fB\-XX:MaxHeapSize\fR
2893 option is equivalent to
2894 \fB\-Xmx\fR\&.
2895 .RE
2896 .PP
2897 \-XX:MaxHeapFreeRatio=\fIpercent\fR
2898 .RS 4
2899 Sets the maximum allowed percentage of free heap space (0 to 100) after a GC event\&. If free heap space expands above this value, then the heap will be shrunk\&. By default, this value is set to 70%\&.
2900 .sp
2901 The following example shows how to set the maximum free heap ratio to 75%:
2902 .sp
2903 .if n \{\
2904 .RS 4
2905 .\}
2906 .nf
2907 \fB\-XX:MaxHeapFreeRatio=75\fR
2908  
2909 .fi
2910 .if n \{\
2911 .RE
2912 .\}
2913 .RE
2914 .PP
2915 \-XX:MaxMetaspaceSize=\fIsize\fR
2916 .RS 4
2917 Sets the maximum amount of native memory that can be allocated for class metadata\&. By default, the size is not limited\&. The amount of metadata for an application depends on the application itself, other running applications, and the amount of memory available on the system\&.
2918 .sp
2919 The following example shows how to set the maximum class metadata size to 256 MB:
2920 .sp
2921 .if n \{\
2922 .RS 4
2923 .\}
2924 .nf
2925 \fB\-XX:MaxMetaspaceSize=256m\fR
2926  

2927 .fi
2928 .if n \{\
2929 .RE
2930 .\}
2931 .RE

2932 .PP
2933 \-XX:MaxNewSize=\fIsize\fR







2934 .RS 4
2935 Sets the maximum size (in bytes) of the heap for the young generation (nursery)\&. The default value is set ergonomically\&.
2936 .RE
2937 .PP
2938 \-XX:MaxTenuringThreshold=\fIthreshold\fR
2939 .RS 4
2940 Sets the maximum tenuring threshold for use in adaptive GC sizing\&. The largest value is 15\&. The default value is 15 for the parallel (throughput) collector, and 6 for the CMS collector\&.
2941 .sp
2942 The following example shows how to set the maximum tenuring threshold to 10:
2943 .sp
2944 .if n \{\
2945 .RS 4
2946 .\}
2947 .nf
2948 \fB\-XX:MaxTenuringThreshold=10\fR
2949  
2950 .fi
2951 .if n \{\
2952 .RE
2953 .\}
2954 .RE
2955 .PP
2956 \-XX:MetaspaceSize=\fIsize\fR
2957 .RS 4
2958 Sets the size of the allocated class metadata space that will trigger a garbage collection the first time it is exceeded\&. This threshold for a garbage collection is increased or decreased depending on the amount of metadata used\&. The default size depends on the platform\&.
2959 .RE
2960 .PP
2961 \-XX:MinHeapFreeRatio=\fIpercent\fR
2962 .RS 4
2963 Sets the minimum allowed percentage of free heap space (0 to 100) after a GC event\&. If free heap space falls below this value, then the heap will be expanded\&. By default, this value is set to 40%\&.
2964 .sp
2965 The following example shows how to set the minimum free heap ratio to 25%:
2966 .sp
2967 .if n \{\
2968 .RS 4
2969 .\}
2970 .nf
2971 \fB\-XX:MinHeapFreeRatio=25\fR
2972  
2973 .fi
2974 .if n \{\
2975 .RE
2976 .\}
2977 .RE
2978 .PP
2979 \-XX:NewRatio=\fIratio\fR
2980 .RS 4
2981 Sets the ratio between young and old generation sizes\&. By default, this option is set to 2\&. The following example shows how to set the young/old ratio to 1:
2982 .sp
2983 .if n \{\
2984 .RS 4
2985 .\}
2986 .nf
2987 \fB\-XX:NewRatio=1\fR
2988  
2989 .fi
2990 .if n \{\
2991 .RE
2992 .\}
2993 .RE




2994 .PP
2995 \-XX:NewSize=\fIsize\fR
2996 .RS 4
2997 Sets the initial size (in bytes) of the heap for the young generation (nursery)\&. Append the letter
2998 \fBk\fR
2999 or
3000 \fBK\fR
3001 to indicate kilobytes,
3002 \fBm\fR
3003 or
3004 \fBM\fR
3005 to indicate megabytes,
3006 \fBg\fR
3007 or
3008 \fBG\fR
3009 to indicate gigabytes\&.
3010 .sp
3011 The young generation region of the heap is used for new objects\&. GC is performed in this region more often than in other regions\&. If the size for the young generation is too low, then a large number of minor GCs will be performed\&. If the size is too high, then only full GCs will be performed, which can take a long time to complete\&. Oracle recommends that you keep the size for the young generation between a half and a quarter of the overall heap size\&.
3012 .sp
3013 The following examples show how to set the initial size of young generation to 256 MB using various units:
3014 .sp
3015 .if n \{\
3016 .RS 4
3017 .\}
3018 .nf
3019 \fB\-XX:NewSize=256m\fR
3020 \fB\-XX:NewSize=262144k\fR
3021 \fB\-XX:NewSize=268435456\fR
3022  





3023 .fi
3024 .if n \{\
3025 .RE
3026 .\}
3027 The
3028 \fB\-XX:NewSize\fR
3029 option is equivalent to
3030 \fB\-Xmn\fR\&.
3031 .RE
3032 .PP
3033 \-XX:ParallelGCThreads=\fIthreads\fR
3034 .RS 4
3035 Sets the number of threads used for parallel garbage collection in the young and old generations\&. The default value depends on the number of CPUs available to the JVM\&.
3036 .sp
3037 For example, to set the number of threads for parallel GC to 2, specify the following option:
3038 .sp
3039 .if n \{\
3040 .RS 4
3041 .\}
3042 .nf
3043 \fB\-XX:ParallelGCThreads=2\fR
3044  









3045 .fi
3046 .if n \{\
3047 .RE
3048 .\}
3049 .RE
3050 .PP
3051 \-XX:+ParallelRefProcEnabled
3052 .RS 4
3053 Enables parallel reference processing\&. By default, this option is disabled\&.
3054 .RE
3055 .PP
3056 \-XX:+PrintAdaptiveSizePolicy
3057 .RS 4
3058 Enables printing of information about adaptive generation sizing\&. By default, this option is disabled\&.
3059 .RE
3060 .PP
3061 \-XX:+PrintGC
3062 .RS 4
3063 Enables printing of messages at every GC\&. By default, this option is disabled\&.
3064 .RE
3065 .PP
3066 \-XX:+PrintGCApplicationConcurrentTime
3067 .RS 4
3068 Enables printing of how much time elapsed since the last pause (for example, a GC pause)\&. By default, this option is disabled\&.
3069 .RE
3070 .PP
3071 \-XX:+PrintGCApplicationStoppedTime
3072 .RS 4
3073 Enables printing of how much time the pause (for example, a GC pause) lasted\&. By default, this option is disabled\&.
3074 .RE
3075 .PP
3076 \-XX:+PrintGCDateStamps
3077 .RS 4
3078 Enables printing of a date stamp at every GC\&. By default, this option is disabled\&.
3079 .RE
3080 .PP
3081 \-XX:+PrintGCDetails
3082 .RS 4
3083 Enables printing of detailed messages at every GC\&. By default, this option is disabled\&.
3084 .RE

3085 .PP
3086 \-XX:+PrintGCTaskTimeStamps
3087 .RS 4
3088 Enables printing of time stamps for every individual GC worker thread task\&. By default, this option is disabled\&.
3089 .RE
3090 .PP
3091 \-XX:+PrintGCTimeStamps
3092 .RS 4
3093 Enables printing of time stamps at every GC\&. By default, this option is disabled\&.
3094 .RE
3095 .PP
3096 \-XX:+PrintStringDeduplicationStatistics
3097 .RS 4
3098 Prints detailed deduplication statistics\&. By default, this option is disabled\&. See the
3099 \fB\-XX:+UseStringDeduplication\fR
3100 option\&.
3101 .RE
3102 .PP
3103 \-XX:+PrintTenuringDistribution
3104 .RS 4
3105 Enables printing of tenuring age information\&. The following is an example of the output:
3106 .sp
3107 .if n \{\
3108 .RS 4
3109 .\}
3110 .nf
3111 \fBDesired survivor size 48286924 bytes, new threshold 10 (max 10)\fR
3112 \fB\- age 1: 28992024 bytes, 28992024 total\fR
3113 \fB\- age 2: 1366864 bytes, 30358888 total\fR
3114 \fB\- age 3: 1425912 bytes, 31784800 total\fR
3115 \fB\&.\&.\&.\fR
3116  
3117 .fi
3118 .if n \{\
3119 .RE
3120 .\}
3121 Age 1 objects are the youngest survivors (they were created after the previous scavenge, survived the latest scavenge, and moved from eden to survivor space)\&. Age 2 objects have survived two scavenges (during the second scavenge they were copied from one survivor space to the next)\&. And so on\&.
3122 .sp
3123 In the preceding example, 28 992 024 bytes survived one scavenge and were copied from eden to survivor space, 1 366 864 bytes are occupied by age 2 objects, etc\&. The third value in each row is the cumulative size of objects of age n or less\&.
3124 .sp
3125 By default, this option is disabled\&.
3126 .RE
3127 .PP
3128 \-XX:+ScavengeBeforeFullGC
3129 .RS 4
3130 Enables GC of the young generation before each full GC\&. This option is enabled by default\&. Oracle recommends that you
3131 \fIdo not\fR
3132 disable it, because scavenging the young generation before a full GC can reduce the number of objects reachable from the old generation space into the young generation space\&. To disable GC of the young generation before each full GC, specify
3133 \fB\-XX:\-ScavengeBeforeFullGC\fR\&.
3134 .RE
3135 .PP
3136 \-XX:SoftRefLRUPolicyMSPerMB=\fItime\fR





3137 .RS 4
3138 Sets the amount of time (in milliseconds) a softly reachable object is kept active on the heap after the last time it was referenced\&. The default value is one second of lifetime per free megabyte in the heap\&. The
3139 \fB\-XX:SoftRefLRUPolicyMSPerMB\fR
3140 option accepts integer values representing milliseconds per one megabyte of the current heap size (for Java HotSpot Client VM) or the maximum possible heap size (for Java HotSpot Server VM)\&. This difference means that the Client VM tends to flush soft references rather than grow the heap, whereas the Server VM tends to grow the heap rather than flush soft references\&. In the latter case, the value of the
3141 \fB\-Xmx\fR
3142 option has a significant effect on how quickly soft references are garbage collected\&.
3143 .sp
3144 The following example shows how to set the value to 2\&.5 seconds:
3145 .sp
3146 .if n \{\
3147 .RS 4
3148 .\}
3149 .nf
3150 \fB\-XX:SoftRefLRUPolicyMSPerMB=2500\fR
3151  
3152 .fi
3153 .if n \{\
3154 .RE
3155 .\}
3156 .RE
3157 .PP
3158 \-XX:StringDeduplicationAgeThreshold=\fIthreshold\fR
3159 .RS 4
3160 \fBString\fR
3161 objects reaching the specified age are considered candidates for deduplication\&. An object\*(Aqs age is a measure of how many times it has survived garbage collection\&. This is sometimes referred to as tenuring; see the
3162 \fB\-XX:+PrintTenuringDistribution\fR
3163 option\&. Note that
3164 \fBString\fR
3165 objects that are promoted to an old heap region before this age has been reached are always considered candidates for deduplication\&. The default value for this option is
3166 \fB3\fR\&. See the
3167 \fB\-XX:+UseStringDeduplication\fR
3168 option\&.
3169 .RE

3170 .PP
3171 \-XX:SurvivorRatio=\fIratio\fR
3172 .RS 4
3173 Sets the ratio between eden space size and survivor space size\&. By default, this option is set to 8\&. The following example shows how to set the eden/survivor space ratio to 4:
3174 .sp
3175 .if n \{\
3176 .RS 4
3177 .\}
3178 .nf
3179 \fB\-XX:SurvivorRatio=4\fR
3180  
3181 .fi
3182 .if n \{\
3183 .RE
3184 .\}
3185 .RE
3186 .PP
3187 \-XX:TargetSurvivorRatio=\fIpercent\fR

3188 .RS 4
3189 Sets the desired percentage of survivor space (0 to 100) used after young garbage collection\&. By default, this option is set to 50%\&.
3190 .sp
3191 The following example shows how to set the target survivor space ratio to 30%:
3192 .sp
3193 .if n \{\
3194 .RS 4
3195 .\}
3196 .nf
3197 \fB\-XX:TargetSurvivorRatio=30\fR
3198  
3199 .fi
3200 .if n \{\
3201 .RE
3202 .\}
3203 .RE
3204 .PP
3205 \-XX:TLABSize=\fIsize\fR
3206 .RS 4
3207 Sets the initial size (in bytes) of a thread\-local allocation buffer (TLAB)\&. Append the letter
3208 \fBk\fR
3209 or
3210 \fBK\fR
3211 to indicate kilobytes,
3212 \fBm\fR
3213 or
3214 \fBM\fR
3215 to indicate megabytes,
3216 \fBg\fR
3217 or
3218 \fBG\fR
3219 to indicate gigabytes\&. If this option is set to 0, then the JVM chooses the initial size automatically\&.
3220 .sp
3221 The following example shows how to set the initial TLAB size to 512 KB:
3222 .sp
3223 .if n \{\
3224 .RS 4
3225 .\}
3226 .nf
3227 \fB\-XX:TLABSize=512k\fR
3228  
3229 .fi
3230 .if n \{\
3231 .RE
3232 .\}
3233 .RE
3234 .PP
3235 \-XX:+UseAdaptiveSizePolicy
3236 .RS 4
3237 Enables the use of adaptive generation sizing\&. This option is enabled by default\&. To disable adaptive generation sizing, specify
3238 \fB\-XX:\-UseAdaptiveSizePolicy\fR
3239 and set the size of the memory allocation pool explicitly (see the
3240 \fB\-XX:SurvivorRatio\fR
3241 option)\&.
3242 .RE
3243 .PP
3244 \-XX:+UseCMSInitiatingOccupancyOnly
3245 .RS 4
3246 Enables the use of the occupancy value as the only criterion for initiating the CMS collector\&. By default, this option is disabled and other criteria may be used\&.
3247 .RE
3248 .PP
3249 \-XX:+UseConcMarkSweepGC
3250 .RS 4
3251 Enables the use of the CMS garbage collector for the old generation\&. Oracle recommends that you use the CMS garbage collector when application latency requirements cannot be met by the throughput (\fB\-XX:+UseParallelGC\fR) garbage collector\&. The G1 garbage collector (\fB\-XX:+UseG1GC\fR) is another alternative\&.
3252 .sp
3253 By default, this option is disabled and the collector is chosen automatically based on the configuration of the machine and type of the JVM\&. When this option is enabled, the
3254 \fB\-XX:+UseParNewGC\fR
3255 option is automatically set and you should not disable it, because the following combination of options has been deprecated in JDK 8:
3256 \fB\-XX:+UseConcMarkSweepGC \-XX:\-UseParNewGC\fR\&.
3257 .RE
3258 .PP
3259 \-XX:+UseG1GC
3260 .RS 4
3261 Enables the use of the garbage\-first (G1) garbage collector\&. It is a server\-style garbage collector, targeted for multiprocessor machines with a large amount of RAM\&. It meets GC pause time goals with high probability, while maintaining good throughput\&. The G1 collector is recommended for applications requiring large heaps (sizes of around 6 GB or larger) with limited GC latency requirements (stable and predictable pause time below 0\&.5 seconds)\&.
3262 .sp
3263 By default, this option is disabled and the collector is chosen automatically based on the configuration of the machine and type of the JVM\&.
3264 .RE
3265 .PP
3266 \-XX:+UseGCOverheadLimit

3267 .RS 4
3268 Enables the use of a policy that limits the proportion of time spent by the JVM on GC before an
3269 \fBOutOfMemoryError\fR
3270 exception is thrown\&. This option is enabled, by default and the parallel GC will throw an
3271 \fBOutOfMemoryError\fR
3272 if more than 98% of the total time is spent on garbage collection and less than 2% of the heap is recovered\&. When the heap is small, this feature can be used to prevent applications from running for long periods of time with little or no progress\&. To disable this option, specify
3273 \fB\-XX:\-UseGCOverheadLimit\fR\&.
3274 .RE
3275 .PP
3276 \-XX:+UseNUMA
3277 .RS 4
3278 Enables performance optimization of an application on a machine with nonuniform memory architecture (NUMA) by increasing the application\*(Aqs use of lower latency memory\&. By default, this option is disabled and no optimization for NUMA is made\&. The option is only available when the parallel garbage collector is used (\fB\-XX:+UseParallelGC\fR)\&.
3279 .RE
3280 .PP
3281 \-XX:+UseParallelGC
3282 .RS 4
3283 Enables the use of the parallel scavenge garbage collector (also known as the throughput collector) to improve the performance of your application by leveraging multiple processors\&.
3284 .sp
3285 By default, this option is disabled and the collector is chosen automatically based on the configuration of the machine and type of the JVM\&. If it is enabled, then the
3286 \fB\-XX:+UseParallelOldGC\fR
3287 option is automatically enabled, unless you explicitly disable it\&.
3288 .RE
3289 .PP
3290 \-XX:+UseParallelOldGC

3291 .RS 4
3292 Enables the use of the parallel garbage collector for full GCs\&. By default, this option is disabled\&. Enabling it automatically enables the
3293 \fB\-XX:+UseParallelGC\fR
3294 option\&.
3295 .RE
3296 .PP
3297 \-XX:+UseParNewGC
3298 .RS 4
3299 Enables the use of parallel threads for collection in the young generation\&. By default, this option is disabled\&. It is automatically enabled when you set the
3300 \fB\-XX:+UseConcMarkSweepGC\fR
3301 option\&. Using the
3302 \fB\-XX:+UseParNewGC\fR
3303 option without the
3304 \fB\-XX:+UseConcMarkSweepGC\fR
3305 option was deprecated in JDK 8\&.
3306 .RE

3307 .PP
3308 \-XX:+UseSerialGC
3309 .RS 4
3310 Enables the use of the serial garbage collector\&. This is generally the best choice for small and simple applications that do not require any special functionality from garbage collection\&. By default, this option is disabled and the collector is chosen automatically based on the configuration of the machine and type of the JVM\&.
3311 .RE
3312 .PP
3313 \-XX:+UseSHM
3314 .RS 4
3315 On Linux, enables the JVM to use shared memory to setup large pages\&.
3316 .sp
3317 For more information, see "Large Pages"\&.
3318 .RE

3319 .PP
3320 \-XX:+UseStringDeduplication
3321 .RS 4
3322 Enables string deduplication\&. By default, this option is disabled\&. To use this option, you must enable the garbage\-first (G1) garbage collector\&. See the
3323 \fB\-XX:+UseG1GC\fR
3324 option\&.
3325 .sp
3326 \fIString deduplication\fR
3327 reduces the memory footprint of
3328 \fBString\fR
3329 objects on the Java heap by taking advantage of the fact that many
3330 \fBString\fR
3331 objects are identical\&. Instead of each
3332 \fBString\fR
3333 object pointing to its own character array, identical
3334 \fBString\fR
3335 objects can point to and share the same character array\&.
3336 .RE
3337 .PP
3338 \-XX:+UseTLAB
3339 .RS 4
3340 Enables the use of thread\-local allocation blocks (TLABs) in the young generation space\&. This option is enabled by default\&. To disable the use of TLABs, specify
3341 \fB\-XX:\-UseTLAB\fR\&.
3342 .RE
3343 .SS "Deprecated and Removed Options"
3344 .PP
3345 These options were included in the previous release, but have since been considered unnecessary\&.











3346 .PP
3347 \-Xincgc
3348 .RS 4
3349 Enables incremental garbage collection\&. This option was deprecated in JDK 8 with no replacement\&.
3350 .RE



3351 .PP
3352 \-Xrun\fIlibname\fR
3353 .RS 4
3354 Loads the specified debugging/profiling library\&. This option was superseded by the
3355 \fB\-agentlib\fR
3356 option\&.
3357 .RE
3358 .PP
3359 \-XX:CMSIncrementalDutyCycle=\fIpercent\fR
3360 .RS 4
3361 Sets the percentage of time (0 to 100) between minor collections that the concurrent collector is allowed to run\&. This option was deprecated in JDK 8 with no replacement, following the deprecation of the
3362 \fB\-XX:+CMSIncrementalMode\fR
3363 option\&.
3364 .RE
3365 .PP
3366 \-XX:CMSIncrementalDutyCycleMin=\fIpercent\fR
3367 .RS 4
3368 Sets the percentage of time (0 to 100) between minor collections that is the lower bound for the duty cycle when
3369 \fB\-XX:+CMSIncrementalPacing\fR
3370 is enabled\&. This option was deprecated in JDK 8 with no replacement, following the deprecation of the
3371 \fB\-XX:+CMSIncrementalMode\fR
3372 option\&.
3373 .RE

3374 .PP
3375 \-XX:+CMSIncrementalMode
3376 .RS 4
3377 Enables the incremental mode for the CMS collector\&. This option was deprecated in JDK 8 with no replacement, along with other options that start with
3378 \fBCMSIncremental\fR\&.
3379 .RE

3380 .PP
3381 \-XX:CMSIncrementalOffset=\fIpercent\fR
3382 .RS 4
3383 Sets the percentage of time (0 to 100) by which the incremental mode duty cycle is shifted to the right within the period between minor collections\&. This option was deprecated in JDK 8 with no replacement, following the deprecation of the
3384 \fB\-XX:+CMSIncrementalMode\fR
3385 option\&.
3386 .RE



3387 .PP
3388 \-XX:+CMSIncrementalPacing
3389 .RS 4
3390 Enables automatic adjustment of the incremental mode duty cycle based on statistics collected while the JVM is running\&. This option was deprecated in JDK 8 with no replacement, following the deprecation of the
3391 \fB\-XX:+CMSIncrementalMode\fR
3392 option\&.
3393 .RE
3394 .PP
3395 \-XX:CMSIncrementalSafetyFactor=\fIpercent\fR
3396 .RS 4
3397 Sets the percentage of time (0 to 100) used to add conservatism when computing the duty cycle\&. This option was deprecated in JDK 8 with no replacement, following the deprecation of the
3398 \fB\-XX:+CMSIncrementalMode\fR
3399 option\&.
3400 .RE
3401 .PP
3402 \-XX:CMSInitiatingPermOccupancyFraction=\fIpercent\fR
3403 .RS 4
3404 Sets the percentage of the permanent generation occupancy (0 to 100) at which to start a GC\&. This option was deprecated in JDK 8 with no replacement\&.
3405 .RE
3406 .PP
3407 \-XX:MaxPermSize=\fIsize\fR
3408 .RS 4
3409 Sets the maximum permanent generation space size (in bytes)\&. This option was deprecated in JDK 8, and superseded by the
3410 \fB\-XX:MaxMetaspaceSize\fR
3411 option\&.
3412 .RE


3413 .PP
3414 \-XX:PermSize=\fIsize\fR
3415 .RS 4
3416 Sets the space (in bytes) allocated to the permanent generation that triggers a garbage collection if it is exceeded\&. This option was deprecated un JDK 8, and superseded by the
3417 \fB\-XX:MetaspaceSize\fR
3418 option\&.
3419 .RE
3420 .PP
3421 \-XX:+UseSplitVerifier
3422 .RS 4
3423 Enables splitting of the verification process\&. By default, this option was enabled in the previous releases, and verification was split into two phases: type referencing (performed by the compiler) and type checking (performed by the JVM runtime)\&. This option was deprecated in JDK 8, and verification is now split by default without a way to disable it\&.
3424 .RE
3425 .PP
3426 \-XX:+UseStringCache
3427 .RS 4
3428 Enables caching of commonly allocated strings\&. This option was removed from JDK 8 with no replacement\&.
3429 .RE
3430 .SH "PERFORMANCE TUNING EXAMPLES"
3431 .PP
3432 The following examples show how to use experimental tuning flags to either optimize throughput or to provide lower response time\&.
3433 .PP
3434 \fBExample 1 \fRTuning for Higher Throughput
3435 .RS 4
3436 .sp
3437 .if n \{\
3438 .RS 4
3439 .\}
3440 .nf
3441 \fBjava \-d64 \-server \-XX:+UseLargePages \-Xmn10g  \-Xms26g \-Xmx26g\fR
3442  
3443 .fi
3444 .if n \{\
3445 .RE
3446 .\}
3447 .RE
3448 .PP
3449 \fBExample 2 \fRTuning for Lower Response Time
3450 .RS 4
3451 .sp
3452 .if n \{\
3453 .RS 4
3454 .\}
3455 .nf
3456 \fBjava \-d64 \-XX:+UseG1GC \-Xms26g Xmx26g \-XX:MaxGCPauseMillis=500 \-XX:+PrintGCTimeStamp\fR
3457  
3458 .fi
3459 .if n \{\
3460 .RE
3461 .\}
3462 .RE
3463 .SH "LARGE PAGES"

3464 .PP
3465 Also known as huge pages, large pages are memory pages that are significantly larger than the standard memory page size (which varies depending on the processor and operating system)\&. Large pages optimize processor Translation\-Lookaside Buffers\&.
3466 .PP
3467 A Translation\-Lookaside Buffer (TLB) is a page translation cache that holds the most\-recently used virtual\-to\-physical address translations\&. TLB is a scarce system resource\&. A TLB miss can be costly as the processor must then read from the hierarchical page table, which may require multiple memory accesses\&. By using a larger memory page size, a single TLB entry can represent a larger memory range\&. There will be less pressure on TLB, and memory\-intensive applications may have better performance\&.
3468 .PP
3469 However, large pages page memory can negatively affect system performance\&. For example, when a large mount of memory is pinned by an application, it may create a shortage of regular memory and cause excessive paging in other applications and slow down the entire system\&. Also, a system that has been up for a long time could produce excessive fragmentation, which could make it impossible to reserve enough large page memory\&. When this happens, either the OS or JVM reverts to using regular pages\&.
3470 .SS "Large Pages Support"
3471 .PP
3472 Solaris and Linux support large pages\&.
3473 .sp
3474 .it 1 an-trap
3475 .nr an-no-space-flag 1
3476 .nr an-break-flag 1
3477 .br
3478 .ps +1
3479 \fBSolaris\fR
3480 .RS 4
3481 .PP
3482 Solaris 9 and later include Multiple Page Size Support (MPSS); no additional configuration is necessary\&. See http://www\&.oracle\&.com/technetwork/server\-storage/solaris10/overview/solaris9\-features\-scalability\-135663\&.html\&.
3483 .RE
3484 .sp
3485 .it 1 an-trap
3486 .nr an-no-space-flag 1
3487 .nr an-break-flag 1
3488 .br
3489 .ps +1
3490 \fBLinux\fR
3491 .RS 4
3492 .PP
3493 The 2\&.6 kernel supports large pages\&. Some vendors have backported the code to their 2\&.4\-based releases\&. To check if your system can support large page memory, try the following:
3494 .sp
3495 .if n \{\
3496 .RS 4
3497 .\}
3498 .nf
3499 \fB# cat /proc/meminfo | grep Huge\fR
3500 \fBHugePages_Total: 0\fR
3501 \fBHugePages_Free: 0\fR
3502 \fBHugepagesize: 2048 kB\fR
3503  
3504 .fi
3505 .if n \{\
3506 .RE
3507 .\}
3508 .PP
3509 If the output shows the three "Huge" variables, then your system can support large page memory but it needs to be configured\&. If the command prints nothing, then your system does not support large pages\&. To configure the system to use large page memory, login as
3510 \fBroot\fR, and then follow these steps:
3511 .sp
3512 .RS 4
3513 .ie n \{\
3514 \h'-04' 1.\h'+01'\c
3515 .\}
3516 .el \{\
3517 .sp -1
3518 .IP "  1." 4.2
3519 .\}
3520 If you are using the option
3521 \fB\-XX:+UseSHM\fR
3522 (instead of
3523 \fB\-XX:+UseHugeTLBFS\fR), then increase the
3524 \fBSHMMAX\fR
3525 value\&. It must be larger than the Java heap size\&. On a system with 4 GB of physical RAM (or less), the following will make all the memory sharable:
3526 .sp
3527 .if n \{\
3528 .RS 4
3529 .\}
3530 .nf
3531 \fB# echo 4294967295 > /proc/sys/kernel/shmmax\fR
3532  
3533 .fi
3534 .if n \{\
3535 .RE
3536 .\}
3537 .RE
3538 .sp
3539 .RS 4
3540 .ie n \{\
3541 \h'-04' 2.\h'+01'\c
3542 .\}
3543 .el \{\
3544 .sp -1
3545 .IP "  2." 4.2
3546 .\}
3547 If you are using the option
3548 \fB\-XX:+UseSHM\fR
3549 or
3550 \fB\-XX:+UseHugeTLBFS\fR, then specify the number of large pages\&. In the following example, 3 GB of a 4 GB system are reserved for large pages (assuming a large page size of 2048kB, then 3 GB = 3 * 1024 MB = 3072 MB = 3072 * 1024 kB = 3145728 kB and 3145728 kB / 2048 kB = 1536):
3551 .sp
3552 .if n \{\
3553 .RS 4
3554 .\}
3555 .nf
3556 \fB# echo 1536 > /proc/sys/vm/nr_hugepages\fR
3557  
3558 .fi
3559 .if n \{\
3560 .RE
3561 .\}
3562 .RE
3563 .if n \{\
3564 .sp
3565 .\}
3566 .RS 4
3567 .it 1 an-trap
3568 .nr an-no-space-flag 1
3569 .nr an-break-flag 1
3570 .br
3571 .ps +1
3572 \fBNote\fR
3573 .ps -1
3574 .br
3575 .TS
3576 allbox tab(:);
3577 l.
3578 T{
3579 .sp
3580 .RS 4
3581 .ie n \{\
3582 \h'-04'\(bu\h'+03'\c
3583 .\}
3584 .el \{\
3585 .sp -1
3586 .IP \(bu 2.3
3587 .\}
3588 Note that the values contained in
3589 \fB/proc\fR
3590 will reset after you reboot your system, so may want to set them in an initialization script (for example,
3591 \fBrc\&.local\fR
3592 or
3593 \fBsysctl\&.conf\fR)\&.
3594 .RE
3595 .sp
3596 .RS 4
3597 .ie n \{\
3598 \h'-04'\(bu\h'+03'\c
3599 .\}
3600 .el \{\
3601 .sp -1
3602 .IP \(bu 2.3
3603 .\}
3604 If you configure (or resize) the OS kernel parameters
3605 \fB/proc/sys/kernel/shmmax\fR
3606 or
3607 \fB/proc/sys/vm/nr_hugepages\fR, Java processes may allocate large pages for areas in addition to the Java heap\&. These steps can allocate large pages for the following areas:
3608 .sp
3609 .RS 4
3610 .ie n \{\
3611 \h'-04'\(bu\h'+03'\c
3612 .\}
3613 .el \{\
3614 .sp -1
3615 .IP \(bu 2.3
3616 .\}
3617 Java heap
3618 .RE
3619 .sp
3620 .RS 4
3621 .ie n \{\
3622 \h'-04'\(bu\h'+03'\c
3623 .\}
3624 .el \{\
3625 .sp -1
3626 .IP \(bu 2.3
3627 .\}
3628 Code cache
3629 .RE
3630 .sp
3631 .RS 4
3632 .ie n \{\
3633 \h'-04'\(bu\h'+03'\c
3634 .\}
3635 .el \{\
3636 .sp -1
3637 .IP \(bu 2.3
3638 .\}
3639 The marking bitmap data structure for the parallel GC
3640 .RE
3641 .sp
3642 Consequently, if you configure the
3643 \fBnr_hugepages\fR
3644 parameter to the size of the Java heap, then the JVM can fail in allocating the code cache areas on large pages because these areas are quite large in size\&.
3645 .RE
3646 T}
3647 .TE
3648 .sp 1
3649 .sp .5v
3650 .RE
3651 .RE
3652 .SH "EXIT STATUS"
3653 .PP
3654 The following exit values are typically returned by the launcher when the launcher is called with the wrong arguments, serious errors, or exceptions thrown by the JVM\&. However, a Java application may choose to return any value by using the API call
3655 \fBSystem\&.exit(exitValue)\fR\&. The values are:
3656 .sp
3657 .RS 4
3658 .ie n \{\
3659 \h'-04'\(bu\h'+03'\c
3660 .\}
3661 .el \{\
3662 .sp -1
3663 .IP \(bu 2.3
3664 .\}
3665 \fB0\fR: Successful completion
3666 .RE
3667 .sp
3668 .RS 4
3669 .ie n \{\
3670 \h'-04'\(bu\h'+03'\c
3671 .\}
3672 .el \{\
3673 .sp -1
3674 .IP \(bu 2.3
3675 .\}
3676 \fB>0\fR: An error occurred
3677 .RE
3678 .SH "SEE ALSO"
3679 .sp
3680 .RS 4
3681 .ie n \{\
3682 \h'-04'\(bu\h'+03'\c
3683 .\}
3684 .el \{\
3685 .sp -1
3686 .IP \(bu 2.3
3687 .\}
3688 javac(1)
3689 .RE
3690 .sp
3691 .RS 4
3692 .ie n \{\
3693 \h'-04'\(bu\h'+03'\c
3694 .\}
3695 .el \{\
3696 .sp -1
3697 .IP \(bu 2.3
3698 .\}
3699 jdb(1)
3700 .RE
3701 .sp
3702 .RS 4
3703 .ie n \{\
3704 \h'-04'\(bu\h'+03'\c
3705 .\}
3706 .el \{\
3707 .sp -1
3708 .IP \(bu 2.3
3709 .\}
3710 jar(1)
3711 .RE
3712 .sp
3713 .RS 4
3714 .ie n \{\
3715 \h'-04'\(bu\h'+03'\c
3716 .\}
3717 .el \{\
3718 .sp -1
3719 .IP \(bu 2.3
3720 .\}
3721 jstat(1)
3722 .RE
3723 .br
3724 'pl 8.5i
3725 'bp
   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






























































< prev index next >