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