annotate src/linux/doc/man/java.1 @ 13469:8a709c82d16c

Added tag jdk-9+102 for changeset 6eb3c8132e48
author lana
date Thu, 21 Jan 2016 09:46:03 -0800
parents 66c98bd811f1
children
rev   line source
rgallard@8813 1 '\" t
mfang@12442 2 .\" Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
mfang@12442 3 .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
mfang@12442 4 .\"
mfang@12442 5 .\" This code is free software; you can redistribute it and/or modify it
mfang@12442 6 .\" under the terms of the GNU General Public License version 2 only, as
mfang@12442 7 .\" published by the Free Software Foundation.
mfang@12442 8 .\"
mfang@12442 9 .\" This code is distributed in the hope that it will be useful, but WITHOUT
mfang@12442 10 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
mfang@12442 11 .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
mfang@12442 12 .\" version 2 for more details (a copy is included in the LICENSE file that
mfang@12442 13 .\" accompanied this code).
mfang@12442 14 .\"
mfang@12442 15 .\" You should have received a copy of the GNU General Public License version
mfang@12442 16 .\" 2 along with this work; if not, write to the Free Software Foundation,
mfang@12442 17 .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
mfang@12442 18 .\"
mfang@12442 19 .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
mfang@12442 20 .\" or visit www.oracle.com if you need additional information or have any
mfang@12442 21 .\" questions.
mfang@12442 22 .\"
mfang@12442 23 .\" Title: java
mfang@12442 24 .\" Language: English
mfang@12442 25 .\" Date: 03 March 2015
mfang@12442 26 .\" SectDesc: Basic Tools
mfang@12442 27 .\" Software: JDK 8
mfang@12442 28 .\" Arch: generic
mfang@12442 29 .\" Part Number: E38207-04
mfang@12442 30 .\" Doc ID: JSSON
rgallard@8813 31 .\"
rgallard@8813 32 .if n .pl 99999
mfang@12442 33 .TH "java" "1" "03 March 2015" "JDK 8" "Basic Tools"
mfang@12442 34 .\" -----------------------------------------------------------------
mfang@12442 35 .\" * Define some portability stuff
mfang@12442 36 .\" -----------------------------------------------------------------
mfang@12442 37 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mfang@12442 38 .\" http://bugs.debian.org/507673
mfang@12442 39 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
mfang@12442 40 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mfang@12442 41 .ie \n(.g .ds Aq \(aq
mfang@12442 42 .el .ds Aq '
mfang@12442 43 .\" -----------------------------------------------------------------
mfang@12442 44 .\" * set default formatting
mfang@12442 45 .\" -----------------------------------------------------------------
mfang@12442 46 .\" disable hyphenation
mfang@12442 47 .nh
mfang@12442 48 .\" disable justification (adjust text to left margin only)
mfang@12442 49 .ad l
mfang@12442 50 .\" -----------------------------------------------------------------
mfang@12442 51 .\" * MAIN CONTENT STARTS HERE *
mfang@12442 52 .\" -----------------------------------------------------------------
mfang@12442 53 .SH "NAME"
rgallard@8813 54 java \- Launches a Java application\&.
mfang@12442 55 .SH "SYNOPSIS"
mfang@12442 56 .sp
mfang@12442 57 .if n \{\
mfang@12442 58 .RS 4
mfang@12442 59 .\}
mfang@12442 60 .nf
rgallard@8813 61 \fBjava\fR [\fIoptions\fR] \fIclassname\fR [\fIargs\fR]
mfang@12442 62 .fi
mfang@12442 63 .if n \{\
mfang@12442 64 .RE
mfang@12442 65 .\}
mfang@12442 66 .sp
mfang@12442 67 .if n \{\
mfang@12442 68 .RS 4
mfang@12442 69 .\}
mfang@12442 70 .nf
rgallard@8813 71 \fBjava\fR [\fIoptions\fR] \fB\-jar\fR \fIfilename\fR [\fIargs\fR]
mfang@12442 72 .fi
mfang@12442 73 .if n \{\
mfang@12442 74 .RE
mfang@12442 75 .\}
mfang@12442 76 .PP
rgallard@8813 77 \fIoptions\fR
mfang@12442 78 .RS 4
mfang@12442 79 Command\-line options separated by spaces\&. See Options\&.
mfang@12442 80 .RE
mfang@12442 81 .PP
rgallard@8813 82 \fIclassname\fR
mfang@12442 83 .RS 4
rgallard@8813 84 The name of the class to be launched\&.
mfang@12442 85 .RE
mfang@12442 86 .PP
rgallard@8813 87 \fIfilename\fR
mfang@12442 88 .RS 4
mfang@12442 89 The name of the Java Archive (JAR) file to be called\&. Used only with the
mfang@12442 90 \fB\-jar\fR
mfang@12442 91 option\&.
mfang@12442 92 .RE
mfang@12442 93 .PP
rgallard@8813 94 \fIargs\fR
mfang@12442 95 .RS 4
mfang@12442 96 The arguments passed to the
mfang@12442 97 \fBmain()\fR
mfang@12442 98 method separated by spaces\&.
mfang@12442 99 .RE
mfang@12442 100 .SH "DESCRIPTION"
rgallard@8813 101 .PP
mfang@12442 102 The
mfang@12442 103 \fBjava\fR
mfang@12442 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
mfang@12442 105 \fBmain()\fR
mfang@12442 106 method\&. The method must be declared
mfang@12442 107 \fIpublic\fR
mfang@12442 108 and
mfang@12442 109 \fIstatic\fR, it must not return any value, and it must accept a
mfang@12442 110 \fBString\fR
mfang@12442 111 array as a parameter\&. The method declaration has the following form:
mfang@12442 112 .sp
mfang@12442 113 .if n \{\
mfang@12442 114 .RS 4
mfang@12442 115 .\}
mfang@12442 116 .nf
mfang@12442 117 \fBpublic static void main(String[] args)\fR
mfang@12442 118
mfang@12442 119 .fi
mfang@12442 120 .if n \{\
mfang@12442 121 .RE
mfang@12442 122 .\}
mfang@12442 123 .PP
mfang@12442 124 The
mfang@12442 125 \fBjava\fR
mfang@12442 126 command can be used to launch a JavaFX application by loading a class that either has a
mfang@12442 127 \fBmain()\fR
mfang@12442 128 method or that extends
mfang@12442 129 \fBjavafx\&.application\&.Application\fR\&. In the latter case, the launcher constructs an instance of the
mfang@12442 130 \fBApplication\fR
mfang@12442 131 class, calls its
mfang@12442 132 \fBinit()\fR
mfang@12442 133 method, and then calls the
mfang@12442 134 \fBstart(javafx\&.stage\&.Stage)\fR
mfang@12442 135 method\&.
mfang@12442 136 .PP
mfang@12442 137 By default, the first argument that is not an option of the
mfang@12442 138 \fBjava\fR
mfang@12442 139 command is the fully qualified name of the class to be called\&. If the
mfang@12442 140 \fB\-jar\fR
mfang@12442 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
mfang@12442 142 \fBMain\-Class\fR
mfang@12442 143 manifest header in its source code\&.
rgallard@8813 144 .PP
rgallard@8813 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\&.
rgallard@8813 146 .PP
mfang@12442 147 Arguments after the class file name or the JAR file name are passed to the
mfang@12442 148 \fBmain()\fR
mfang@12442 149 method\&.
mfang@12442 150 .SH "OPTIONS"
mfang@12442 151 .PP
mfang@12442 152 The
mfang@12442 153 \fBjava\fR
mfang@12442 154 command supports a wide range of options that can be divided into the following categories:
mfang@12442 155 .sp
mfang@12442 156 .RS 4
mfang@12442 157 .ie n \{\
mfang@12442 158 \h'-04'\(bu\h'+03'\c
mfang@12442 159 .\}
mfang@12442 160 .el \{\
mfang@12442 161 .sp -1
mfang@12442 162 .IP \(bu 2.3
mfang@12442 163 .\}
rgallard@8813 164 Standard Options
mfang@12442 165 .RE
mfang@12442 166 .sp
mfang@12442 167 .RS 4
mfang@12442 168 .ie n \{\
mfang@12442 169 \h'-04'\(bu\h'+03'\c
mfang@12442 170 .\}
mfang@12442 171 .el \{\
mfang@12442 172 .sp -1
mfang@12442 173 .IP \(bu 2.3
mfang@12442 174 .\}
mfang@12442 175 Non\-Standard Options
mfang@12442 176 .RE
mfang@12442 177 .sp
mfang@12442 178 .RS 4
mfang@12442 179 .ie n \{\
mfang@12442 180 \h'-04'\(bu\h'+03'\c
mfang@12442 181 .\}
mfang@12442 182 .el \{\
mfang@12442 183 .sp -1
mfang@12442 184 .IP \(bu 2.3
mfang@12442 185 .\}
rgallard@8813 186 Advanced Runtime Options
mfang@12442 187 .RE
mfang@12442 188 .sp
mfang@12442 189 .RS 4
mfang@12442 190 .ie n \{\
mfang@12442 191 \h'-04'\(bu\h'+03'\c
mfang@12442 192 .\}
mfang@12442 193 .el \{\
mfang@12442 194 .sp -1
mfang@12442 195 .IP \(bu 2.3
mfang@12442 196 .\}
rgallard@8813 197 Advanced JIT Compiler Options
mfang@12442 198 .RE
mfang@12442 199 .sp
mfang@12442 200 .RS 4
mfang@12442 201 .ie n \{\
mfang@12442 202 \h'-04'\(bu\h'+03'\c
mfang@12442 203 .\}
mfang@12442 204 .el \{\
mfang@12442 205 .sp -1
mfang@12442 206 .IP \(bu 2.3
mfang@12442 207 .\}
rgallard@8813 208 Advanced Serviceability Options
mfang@12442 209 .RE
mfang@12442 210 .sp
mfang@12442 211 .RS 4
mfang@12442 212 .ie n \{\
mfang@12442 213 \h'-04'\(bu\h'+03'\c
mfang@12442 214 .\}
mfang@12442 215 .el \{\
mfang@12442 216 .sp -1
mfang@12442 217 .IP \(bu 2.3
mfang@12442 218 .\}
rgallard@8813 219 Advanced Garbage Collection Options
mfang@12442 220 .RE
rgallard@8813 221 .PP
rgallard@8813 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\&.
rgallard@8813 223 .PP
mfang@12442 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
mfang@12442 225 \fB\-X\fR\&.
rgallard@8813 226 .PP
mfang@12442 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
mfang@12442 228 \fB\-XX\fR\&.
rgallard@8813 229 .PP
rgallard@8813 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\&.
rgallard@8813 231 .PP
mfang@12442 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
mfang@12442 233 \fB\-XX\fR
mfang@12442 234 options are enabled using the plus sign (\fB\-XX:+\fR\fIOptionName\fR) and disabled using the minus sign (\fB\-XX:\-\fR\fIOptionName\fR)\&.
rgallard@8813 235 .PP
mfang@12442 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
mfang@12442 237 \fBk\fR
mfang@12442 238 or
mfang@12442 239 \fBK\fR
mfang@12442 240 for kilobytes (KB),
mfang@12442 241 \fBm\fR
mfang@12442 242 or
mfang@12442 243 \fBM\fR
mfang@12442 244 for megabytes (MB),
mfang@12442 245 \fBg\fR
mfang@12442 246 or
mfang@12442 247 \fBG\fR
mfang@12442 248 for gigabytes (GB)\&. For example, to set the size to 8 GB, you can specify either
mfang@12442 249 \fB8g\fR,
mfang@12442 250 \fB8192m\fR,
mfang@12442 251 \fB8388608k\fR, or
mfang@12442 252 \fB8589934592\fR
mfang@12442 253 as the argument\&. If you are expected to specify the percentage, use a number from 0 to 1 (for example, specify
mfang@12442 254 \fB0\&.25\fR
mfang@12442 255 for 25%)\&.
mfang@12442 256 .SS "Standard Options"
mfang@12442 257 .PP
rgallard@8813 258 These are the most commonly used options that are supported by all implementations of the JVM\&.
mfang@12442 259 .PP
mfang@12442 260 \-agentlib:\fIlibname\fR[=\fIoptions\fR]
mfang@12442 261 .RS 4
mfang@12442 262 Loads the specified native agent library\&. After the library name, a comma\-separated list of options specific to the library can be used\&.
mfang@12442 263 .sp
mfang@12442 264 If the option
mfang@12442 265 \fB\-agentlib:foo\fR
mfang@12442 266 is specified, then the JVM attempts to load the library named
mfang@12442 267 \fBlibfoo\&.so\fR
mfang@12442 268 in the location specified by the
mfang@12442 269 \fBLD_LIBRARY_PATH\fR
mfang@12442 270 system variable (on OS X this variable is
mfang@12442 271 \fBDYLD_LIBRARY_PATH\fR)\&.
mfang@12442 272 .sp
mfang@12442 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:
mfang@12442 274 .sp
mfang@12442 275 .if n \{\
mfang@12442 276 .RS 4
mfang@12442 277 .\}
mfang@12442 278 .nf
mfang@12442 279 \fB\-agentlib:hprof=cpu=samples,interval=20,depth=3\fR
mfang@12442 280
mfang@12442 281 .fi
mfang@12442 282 .if n \{\
mfang@12442 283 .RE
mfang@12442 284 .\}
mfang@12442 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:
mfang@12442 286 .sp
mfang@12442 287 .if n \{\
mfang@12442 288 .RS 4
mfang@12442 289 .\}
mfang@12442 290 .nf
mfang@12442 291 \fB\-agentlib:jdwp=transport=dt_socket,server=y,address=8000\fR
mfang@12442 292
mfang@12442 293 .fi
mfang@12442 294 .if n \{\
mfang@12442 295 .RE
mfang@12442 296 .\}
mfang@12442 297 For more information about the native agent libraries, refer to the following:
mfang@12442 298 .sp
mfang@12442 299 .RS 4
mfang@12442 300 .ie n \{\
mfang@12442 301 \h'-04'\(bu\h'+03'\c
mfang@12442 302 .\}
mfang@12442 303 .el \{\
mfang@12442 304 .sp -1
mfang@12442 305 .IP \(bu 2.3
mfang@12442 306 .\}
mfang@12442 307 The
mfang@12442 308 \fBjava\&.lang\&.instrument\fR
mfang@12442 309 package description at http://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package\-summary\&.html
mfang@12442 310 .RE
mfang@12442 311 .sp
mfang@12442 312 .RS 4
mfang@12442 313 .ie n \{\
mfang@12442 314 \h'-04'\(bu\h'+03'\c
mfang@12442 315 .\}
mfang@12442 316 .el \{\
mfang@12442 317 .sp -1
mfang@12442 318 .IP \(bu 2.3
mfang@12442 319 .\}
mfang@12442 320 Agent Command Line Options in the JVM Tools Interface guide at http://docs\&.oracle\&.com/javase/8/docs/platform/jvmti/jvmti\&.html#starting
mfang@12442 321 .RE
mfang@12442 322 .RE
mfang@12442 323 .PP
mfang@12442 324 \-agentpath:\fIpathname\fR[=\fIoptions\fR]
mfang@12442 325 .RS 4
mfang@12442 326 Loads the native agent library specified by the absolute path name\&. This option is equivalent to
mfang@12442 327 \fB\-agentlib\fR
mfang@12442 328 but uses the full path and file name of the library\&.
mfang@12442 329 .RE
mfang@12442 330 .PP
mfang@12442 331 \-client
mfang@12442 332 .RS 4
mfang@12442 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\&.
mfang@12442 334 .sp
mfang@12442 335 For default JVM selection, see Server\-Class Machine Detection at
mfang@12442 336 http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/server\-class\&.html
mfang@12442 337 .RE
mfang@12442 338 .PP
mfang@12442 339 \-D\fIproperty\fR=\fIvalue\fR
mfang@12442 340 .RS 4
mfang@12442 341 Sets a system property value\&. The
mfang@12442 342 \fIproperty\fR
mfang@12442 343 variable is a string with no spaces that represents the name of the property\&. The
mfang@12442 344 \fIvalue\fR
mfang@12442 345 variable is a string that represents the value of the property\&. If
mfang@12442 346 \fIvalue\fR
mfang@12442 347 is a string with spaces, then enclose it in quotation marks (for example
mfang@12442 348 \fB\-Dfoo="foo bar"\fR)\&.
mfang@12442 349 .RE
mfang@12442 350 .PP
mfang@12442 351 \-d32
mfang@12442 352 .RS 4
mfang@12442 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\&.
mfang@12442 354 .RE
mfang@12442 355 .PP
mfang@12442 356 \-d64
mfang@12442 357 .RS 4
mfang@12442 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\&.
mfang@12442 359 .sp
mfang@12442 360 Currently only the Java HotSpot Server VM supports 64\-bit operation, and the
mfang@12442 361 \fB\-server\fR
mfang@12442 362 option is implicit with the use of
mfang@12442 363 \fB\-d64\fR\&. The
mfang@12442 364 \fB\-client\fR
mfang@12442 365 option is ignored with the use of
mfang@12442 366 \fB\-d64\fR\&. This is subject to change in a future release\&.
mfang@12442 367 .RE
mfang@12442 368 .PP
mfang@12442 369 \-disableassertions[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
rgallard@8813 370 .br
mfang@12442 371 \-da[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
mfang@12442 372 .RS 4
mfang@12442 373 Disables assertions\&. By default, assertions are disabled in all packages and classes\&.
mfang@12442 374 .sp
mfang@12442 375 With no arguments,
mfang@12442 376 \fB\-disableassertions\fR
mfang@12442 377 (\fB\-da\fR) disables assertions in all packages and classes\&. With the
mfang@12442 378 \fIpackagename\fR
mfang@12442 379 argument ending in
mfang@12442 380 \fB\&.\&.\&.\fR, the switch disables assertions in the specified package and any subpackages\&. If the argument is simply
mfang@12442 381 \fB\&.\&.\&.\fR, then the switch disables assertions in the unnamed package in the current working directory\&. With the
mfang@12442 382 \fIclassname\fR
mfang@12442 383 argument, the switch disables assertions in the specified class\&.
mfang@12442 384 .sp
mfang@12442 385 The
mfang@12442 386 \fB\-disableassertions\fR
mfang@12442 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
mfang@12442 388 \fB\-disablesystemassertions\fR
mfang@12442 389 option enables you to disable assertions in all system classes\&.
mfang@12442 390 .sp
mfang@12442 391 To explicitly enable assertions in specific packages or classes, use the
mfang@12442 392 \fB\-enableassertions\fR
mfang@12442 393 (\fB\-ea\fR) option\&. Both options can be used at the same time\&. For example, to run the
mfang@12442 394 \fBMyClass\fR
mfang@12442 395 application with assertions enabled in package
mfang@12442 396 \fBcom\&.wombat\&.fruitbat\fR
mfang@12442 397 (and any subpackages) but disabled in class
mfang@12442 398 \fBcom\&.wombat\&.fruitbat\&.Brickbat\fR, use the following command:
mfang@12442 399 .sp
mfang@12442 400 .if n \{\
mfang@12442 401 .RS 4
mfang@12442 402 .\}
mfang@12442 403 .nf
mfang@12442 404 \fBjava \-ea:com\&.wombat\&.fruitbat\&.\&.\&. \-da:com\&.wombat\&.fruitbat\&.Brickbat MyClass\fR
mfang@12442 405
mfang@12442 406 .fi
mfang@12442 407 .if n \{\
mfang@12442 408 .RE
mfang@12442 409 .\}
mfang@12442 410 .RE
mfang@12442 411 .PP
mfang@12442 412 \-disablesystemassertions
mfang@12442 413 .br
mfang@12442 414 \-dsa
mfang@12442 415 .RS 4
mfang@12442 416 Disables assertions in all system classes\&.
mfang@12442 417 .RE
mfang@12442 418 .PP
mfang@12442 419 \-enableassertions[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
mfang@12442 420 .br
mfang@12442 421 \-ea[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
mfang@12442 422 .RS 4
mfang@12442 423 Enables assertions\&. By default, assertions are disabled in all packages and classes\&.
mfang@12442 424 .sp
mfang@12442 425 With no arguments,
mfang@12442 426 \fB\-enableassertions\fR
mfang@12442 427 (\fB\-ea\fR) enables assertions in all packages and classes\&. With the
mfang@12442 428 \fIpackagename\fR
mfang@12442 429 argument ending in
mfang@12442 430 \fB\&.\&.\&.\fR, the switch enables assertions in the specified package and any subpackages\&. If the argument is simply
mfang@12442 431 \fB\&.\&.\&.\fR, then the switch enables assertions in the unnamed package in the current working directory\&. With the
mfang@12442 432 \fIclassname\fR
mfang@12442 433 argument, the switch enables assertions in the specified class\&.
mfang@12442 434 .sp
mfang@12442 435 The
mfang@12442 436 \fB\-enableassertions\fR
mfang@12442 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
mfang@12442 438 \fB\-enablesystemassertions\fR
mfang@12442 439 option provides a separate switch to enable assertions in all system classes\&.
mfang@12442 440 .sp
mfang@12442 441 To explicitly disable assertions in specific packages or classes, use the
mfang@12442 442 \fB\-disableassertions\fR
mfang@12442 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
mfang@12442 444 \fBMyClass\fR
mfang@12442 445 application with assertions enabled only in package
mfang@12442 446 \fBcom\&.wombat\&.fruitbat\fR
mfang@12442 447 (and any subpackages) but disabled in class
mfang@12442 448 \fBcom\&.wombat\&.fruitbat\&.Brickbat\fR, use the following command:
mfang@12442 449 .sp
mfang@12442 450 .if n \{\
mfang@12442 451 .RS 4
mfang@12442 452 .\}
mfang@12442 453 .nf
mfang@12442 454 \fBjava \-ea:com\&.wombat\&.fruitbat\&.\&.\&. \-da:com\&.wombat\&.fruitbat\&.Brickbat MyClass\fR
mfang@12442 455
mfang@12442 456 .fi
mfang@12442 457 .if n \{\
mfang@12442 458 .RE
mfang@12442 459 .\}
mfang@12442 460 .RE
mfang@12442 461 .PP
mfang@12442 462 \-enablesystemassertions
mfang@12442 463 .br
mfang@12442 464 \-esa
mfang@12442 465 .RS 4
mfang@12442 466 Enables assertions in all system classes\&.
mfang@12442 467 .RE
mfang@12442 468 .PP
mfang@12442 469 \-help
mfang@12442 470 .br
mfang@12442 471 \-?
mfang@12442 472 .RS 4
mfang@12442 473 Displays usage information for the
mfang@12442 474 \fBjava\fR
mfang@12442 475 command without actually running the JVM\&.
mfang@12442 476 .RE
mfang@12442 477 .PP
mfang@12442 478 \-jar \fIfilename\fR
mfang@12442 479 .RS 4
mfang@12442 480 Executes a program encapsulated in a JAR file\&. The
mfang@12442 481 \fIfilename\fR
mfang@12442 482 argument is the name of a JAR file with a manifest that contains a line in the form
mfang@12442 483 \fBMain\-Class:\fR\fIclassname\fR
mfang@12442 484 that defines the class with the
mfang@12442 485 \fBpublic static void main(String[] args)\fR
mfang@12442 486 method that serves as your application\*(Aqs starting point\&.
mfang@12442 487 .sp
mfang@12442 488 When you use the
mfang@12442 489 \fB\-jar\fR
mfang@12442 490 option, the specified JAR file is the source of all user classes, and other class path settings are ignored\&.
mfang@12442 491 .sp
mfang@12442 492 For more information about JAR files, see the following resources:
mfang@12442 493 .sp
mfang@12442 494 .RS 4
mfang@12442 495 .ie n \{\
mfang@12442 496 \h'-04'\(bu\h'+03'\c
mfang@12442 497 .\}
mfang@12442 498 .el \{\
mfang@12442 499 .sp -1
mfang@12442 500 .IP \(bu 2.3
mfang@12442 501 .\}
mfang@12442 502 jar(1)
mfang@12442 503 .RE
mfang@12442 504 .sp
mfang@12442 505 .RS 4
mfang@12442 506 .ie n \{\
mfang@12442 507 \h'-04'\(bu\h'+03'\c
mfang@12442 508 .\}
mfang@12442 509 .el \{\
mfang@12442 510 .sp -1
mfang@12442 511 .IP \(bu 2.3
mfang@12442 512 .\}
mfang@12442 513 The Java Archive (JAR) Files guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jar/index\&.html
mfang@12442 514 .RE
mfang@12442 515 .sp
mfang@12442 516 .RS 4
mfang@12442 517 .ie n \{\
mfang@12442 518 \h'-04'\(bu\h'+03'\c
mfang@12442 519 .\}
mfang@12442 520 .el \{\
mfang@12442 521 .sp -1
mfang@12442 522 .IP \(bu 2.3
mfang@12442 523 .\}
mfang@12442 524 Lesson: Packaging Programs in JAR Files at
rgallard@8813 525
mfang@12442 526 http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.html
mfang@12442 527 .RE
mfang@12442 528 .RE
mfang@12442 529 .PP
mfang@12442 530 \-javaagent:\fIjarpath\fR[=\fIoptions\fR]
mfang@12442 531 .RS 4
mfang@12442 532 Loads the specified Java programming language agent\&. For more information about instrumenting Java applications, see the
mfang@12442 533 \fBjava\&.lang\&.instrument\fR
mfang@12442 534 package description in the Java API documentation at http://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package\-summary\&.html
mfang@12442 535 .RE
mfang@12442 536 .PP
mfang@12442 537 \-jre\-restrict\-search
mfang@12442 538 .RS 4
mfang@12442 539 Includes user\-private JREs in the version search\&.
mfang@12442 540 .RE
mfang@12442 541 .PP
mfang@12442 542 \-no\-jre\-restrict\-search
mfang@12442 543 .RS 4
mfang@12442 544 Excludes user\-private JREs from the version search\&.
mfang@12442 545 .RE
mfang@12442 546 .PP
mfang@12442 547 \-server
mfang@12442 548 .RS 4
mfang@12442 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\&.
mfang@12442 550 .sp
mfang@12442 551 For default JVM selection, see Server\-Class Machine Detection at
mfang@12442 552 http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/server\-class\&.html
mfang@12442 553 .RE
mfang@12442 554 .PP
mfang@12442 555 \-showversion
mfang@12442 556 .RS 4
mfang@12442 557 Displays version information and continues execution of the application\&. This option is equivalent to the
mfang@12442 558 \fB\-version\fR
mfang@12442 559 option except that the latter instructs the JVM to exit after displaying version information\&.
mfang@12442 560 .RE
mfang@12442 561 .PP
mfang@12442 562 \-splash:\fIimgname\fR
mfang@12442 563 .RS 4
mfang@12442 564 Shows the splash screen with the image specified by
mfang@12442 565 \fIimgname\fR\&. For example, to show the
mfang@12442 566 \fBsplash\&.gif\fR
mfang@12442 567 file from the
mfang@12442 568 \fBimages\fR
mfang@12442 569 directory when starting your application, use the following option:
mfang@12442 570 .sp
mfang@12442 571 .if n \{\
mfang@12442 572 .RS 4
mfang@12442 573 .\}
duke@0 574 .nf
mfang@12442 575 \fB\-splash:images/splash\&.gif\fR
mfang@12442 576
duke@0 577 .fi
mfang@12442 578 .if n \{\
mfang@12442 579 .RE
mfang@12442 580 .\}
mfang@12442 581 .RE
mfang@12442 582 .PP
mfang@12442 583 \-verbose:class
mfang@12442 584 .RS 4
mfang@12442 585 Displays information about each loaded class\&.
mfang@12442 586 .RE
mfang@12442 587 .PP
mfang@12442 588 \-verbose:gc
mfang@12442 589 .RS 4
mfang@12442 590 Displays information about each garbage collection (GC) event\&.
mfang@12442 591 .RE
mfang@12442 592 .PP
mfang@12442 593 \-verbose:jni
mfang@12442 594 .RS 4
mfang@12442 595 Displays information about the use of native methods and other Java Native Interface (JNI) activity\&.
mfang@12442 596 .RE
mfang@12442 597 .PP
mfang@12442 598 \-version
mfang@12442 599 .RS 4
mfang@12442 600 Displays version information and then exits\&. This option is equivalent to the
mfang@12442 601 \fB\-showversion\fR
mfang@12442 602 option except that the latter does not instruct the JVM to exit after displaying version information\&.
mfang@12442 603 .RE
mfang@12442 604 .PP
mfang@12442 605 \-version:\fIrelease\fR
mfang@12442 606 .RS 4
mfang@12442 607 Specifies the release version to be used for running the application\&. If the version of the
mfang@12442 608 \fBjava\fR
mfang@12442 609 command called does not meet this specification and an appropriate implementation is found on the system, then the appropriate implementation will be used\&.
mfang@12442 610 .sp
mfang@12442 611 The
mfang@12442 612 \fIrelease\fR
mfang@12442 613 argument specifies either the exact version string, or a list of version strings and ranges separated by spaces\&. A
mfang@12442 614 \fIversion string\fR
mfang@12442 615 is the developer designation of the version number in the following form:
mfang@12442 616 \fB1\&.\fR\fIx\fR\fB\&.0_\fR\fIu\fR
mfang@12442 617 (where
mfang@12442 618 \fIx\fR
mfang@12442 619 is the major version number, and
mfang@12442 620 \fIu\fR
mfang@12442 621 is the update version number)\&. A
mfang@12442 622 \fIversion range\fR
mfang@12442 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
mfang@12442 624 \fIOR\fR
mfang@12442 625 combination, or an ampersand (\fB&\fR) for a logical
mfang@12442 626 \fIAND\fR
mfang@12442 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:
mfang@12442 628 .sp
mfang@12442 629 .if n \{\
mfang@12442 630 .RS 4
mfang@12442 631 .\}
rgallard@8813 632 .nf
mfang@12442 633 \fB\-version:"1\&.6\&.0_13 1\&.6* & 1\&.6\&.0_10+"\fR
mfang@12442 634
rgallard@8813 635 .fi
mfang@12442 636 .if n \{\
mfang@12442 637 .RE
mfang@12442 638 .\}
mfang@12442 639 Quotation marks are necessary only if there are spaces in the
mfang@12442 640 \fIrelease\fR
mfang@12442 641 parameter\&.
mfang@12442 642 .sp
rgallard@8813 643 For JAR files, the preference is to specify version requirements in the JAR file manifest rather than on the command line\&.
mfang@12442 644 .RE
mfang@12442 645 .SS "Non\-Standard Options"
mfang@12442 646 .PP
rgallard@8813 647 These options are general purpose options that are specific to the Java HotSpot Virtual Machine\&.
mfang@12442 648 .PP
mfang@12442 649 \-X
mfang@12442 650 .RS 4
mfang@12442 651 Displays help for all available
mfang@12442 652 \fB\-X\fR
mfang@12442 653 options\&.
mfang@12442 654 .RE
mfang@12442 655 .PP
mfang@12442 656 \-Xbatch
mfang@12442 657 .RS 4
mfang@12442 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
mfang@12442 659 \fB\-Xbatch\fR
mfang@12442 660 flag disables background compilation so that compilation of all methods proceeds as a foreground task until completed\&.
mfang@12442 661 .sp
mfang@12442 662 This option is equivalent to
mfang@12442 663 \fB\-XX:\-BackgroundCompilation\fR\&.
mfang@12442 664 .RE
mfang@12442 665 .PP
mfang@12442 666 \-Xbootclasspath:\fIpath\fR
mfang@12442 667 .RS 4
rgallard@8813 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\&.
mfang@12442 669 .sp
mfang@12442 670 Do not deploy applications that use this option to override a class in
mfang@12442 671 \fBrt\&.jar\fR, because this violates the JRE binary code license\&.
mfang@12442 672 .RE
mfang@12442 673 .PP
mfang@12442 674 \-Xbootclasspath/a:\fIpath\fR
mfang@12442 675 .RS 4
rgallard@8813 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\&.
mfang@12442 677 .sp
mfang@12442 678 Do not deploy applications that use this option to override a class in
mfang@12442 679 \fBrt\&.jar\fR, because this violates the JRE binary code license\&.
mfang@12442 680 .RE
mfang@12442 681 .PP
mfang@12442 682 \-Xbootclasspath/p:\fIpath\fR
mfang@12442 683 .RS 4
rgallard@8813 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\&.
mfang@12442 685 .sp
mfang@12442 686 Do not deploy applications that use this option to override a class in
mfang@12442 687 \fBrt\&.jar\fR, because this violates the JRE binary code license\&.
mfang@12442 688 .RE
mfang@12442 689 .PP
mfang@12442 690 \-Xcheck:jni
mfang@12442 691 .RS 4
rgallard@8813 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\&.
mfang@12442 693 .RE
mfang@12442 694 .PP
mfang@12442 695 \-Xcomp
mfang@12442 696 .RS 4
mfang@12442 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
mfang@12442 698 \fB\-Xcomp\fR
mfang@12442 699 option disables interpreted method invocations to increase compilation performance at the expense of efficiency\&.
mfang@12442 700 .sp
mfang@12442 701 You can also change the number of interpreted method invocations before compilation using the
mfang@12442 702 \fB\-XX:CompileThreshold\fR
mfang@12442 703 option\&.
mfang@12442 704 .RE
mfang@12442 705 .PP
mfang@12442 706 \-Xdebug
mfang@12442 707 .RS 4
rgallard@8813 708 Does nothing\&. Provided for backward compatibility\&.
mfang@12442 709 .RE
mfang@12442 710 .PP
mfang@12442 711 \-Xdiag
mfang@12442 712 .RS 4
rgallard@8813 713 Shows additional diagnostic messages\&.
mfang@12442 714 .RE
mfang@12442 715 .PP
mfang@12442 716 \-Xfuture
mfang@12442 717 .RS 4
mfang@12442 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\&.
mfang@12442 719 .RE
mfang@12442 720 .PP
mfang@12442 721 \-Xint
mfang@12442 722 .RS 4
mfang@12442 723 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\&.
mfang@12442 724 .RE
mfang@12442 725 .PP
mfang@12442 726 \-Xinternalversion
mfang@12442 727 .RS 4
mfang@12442 728 Displays more detailed JVM version information than the
mfang@12442 729 \fB\-version\fR
mfang@12442 730 option, and then exits\&.
mfang@12442 731 .RE
mfang@12442 732 .PP
mfang@12442 733 \-Xloggc:\fIfilename\fR
mfang@12442 734 .RS 4
mfang@12442 735 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
mfang@12442 736 \fB\-verbose:gc\fR
mfang@12442 737 with the time elapsed since the first GC event preceding each logged event\&. The
mfang@12442 738 \fB\-Xloggc\fR
mfang@12442 739 option overrides
mfang@12442 740 \fB\-verbose:gc\fR
mfang@12442 741 if both are given with the same
mfang@12442 742 \fBjava\fR
mfang@12442 743 command\&.
mfang@12442 744 .sp
rgallard@8813 745 Example:
mfang@12442 746 .sp
mfang@12442 747 .if n \{\
mfang@12442 748 .RS 4
mfang@12442 749 .\}
mfang@12442 750 .nf
mfang@12442 751 \fB\-Xloggc:garbage\-collection\&.log\fR
mfang@12442 752
mfang@12442 753 .fi
mfang@12442 754 .if n \{\
mfang@12442 755 .RE
mfang@12442 756 .\}
mfang@12442 757 .RE
mfang@12442 758 .PP
mfang@12442 759 \-Xmaxjitcodesize=\fIsize\fR
mfang@12442 760 .RS 4
mfang@12442 761 Specifies the maximum code cache size (in bytes) for JIT\-compiled code\&. Append the letter
mfang@12442 762 \fBk\fR
mfang@12442 763 or
mfang@12442 764 \fBK\fR
mfang@12442 765 to indicate kilobytes,
mfang@12442 766 \fBm\fR
mfang@12442 767 or
mfang@12442 768 \fBM\fR
mfang@12442 769 to indicate megabytes,
mfang@12442 770 \fBg\fR
mfang@12442 771 or
mfang@12442 772 \fBG\fR
mfang@12442 773 to indicate gigabytes\&. The default maximum code cache size is 240 MB; if you disable tiered compilation with the option
mfang@12442 774 \fB\-XX:\-TieredCompilation\fR, then the default size is 48 MB:
mfang@12442 775 .sp
mfang@12442 776 .if n \{\
mfang@12442 777 .RS 4
mfang@12442 778 .\}
mfang@12442 779 .nf
mfang@12442 780 \fB\-Xmaxjitcodesize=240m\fR
mfang@12442 781
mfang@12442 782 .fi
mfang@12442 783 .if n \{\
mfang@12442 784 .RE
mfang@12442 785 .\}
mfang@12442 786 This option is equivalent to
mfang@12442 787 \fB\-XX:ReservedCodeCacheSize\fR\&.
mfang@12442 788 .RE
mfang@12442 789 .PP
mfang@12442 790 \-Xmixed
mfang@12442 791 .RS 4
rgallard@8813 792 Executes all bytecode by the interpreter except for hot methods, which are compiled to native code\&.
mfang@12442 793 .RE
mfang@12442 794 .PP
mfang@12442 795 \-Xmn\fIsize\fR
mfang@12442 796 .RS 4
mfang@12442 797 Sets the initial and maximum size (in bytes) of the heap for the young generation (nursery)\&. Append the letter
mfang@12442 798 \fBk\fR
mfang@12442 799 or
mfang@12442 800 \fBK\fR
mfang@12442 801 to indicate kilobytes,
mfang@12442 802 \fBm\fR
mfang@12442 803 or
mfang@12442 804 \fBM\fR
mfang@12442 805 to indicate megabytes,
mfang@12442 806 \fBg\fR
mfang@12442 807 or
mfang@12442 808 \fBG\fR
mfang@12442 809 to indicate gigabytes\&.
mfang@12442 810 .sp
rgallard@8813 811 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\&.
mfang@12442 812 .sp
rgallard@8813 813 The following examples show how to set the initial and maximum size of young generation to 256 MB using various units:
mfang@12442 814 .sp
mfang@12442 815 .if n \{\
mfang@12442 816 .RS 4
mfang@12442 817 .\}
mfang@12442 818 .nf
mfang@12442 819 \fB\-Xmn256m\fR
mfang@12442 820 \fB\-Xmn262144k\fR
mfang@12442 821 \fB\-Xmn268435456\fR
mfang@12442 822
mfang@12442 823 .fi
mfang@12442 824 .if n \{\
mfang@12442 825 .RE
mfang@12442 826 .\}
mfang@12442 827 Instead of the
mfang@12442 828 \fB\-Xmn\fR
mfang@12442 829 option to set both the initial and maximum size of the heap for the young generation, you can use
mfang@12442 830 \fB\-XX:NewSize\fR
mfang@12442 831 to set the initial size and
mfang@12442 832 \fB\-XX:MaxNewSize\fR
mfang@12442 833 to set the maximum size\&.
mfang@12442 834 .RE
mfang@12442 835 .PP
mfang@12442 836 \-Xms\fIsize\fR
mfang@12442 837 .RS 4
mfang@12442 838 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
mfang@12442 839 \fBk\fR
mfang@12442 840 or
mfang@12442 841 \fBK\fR
mfang@12442 842 to indicate kilobytes,
mfang@12442 843 \fBm\fR
mfang@12442 844 or
mfang@12442 845 \fBM\fR
mfang@12442 846 to indicate megabytes,
mfang@12442 847 \fBg\fR
mfang@12442 848 or
mfang@12442 849 \fBG\fR
mfang@12442 850 to indicate gigabytes\&.
mfang@12442 851 .sp
rgallard@8813 852 The following examples show how to set the size of allocated memory to 6 MB using various units:
mfang@12442 853 .sp
mfang@12442 854 .if n \{\
mfang@12442 855 .RS 4
mfang@12442 856 .\}
mfang@12442 857 .nf
mfang@12442 858 \fB\-Xms6291456\fR
mfang@12442 859 \fB\-Xms6144k\fR
mfang@12442 860 \fB\-Xms6m\fR
mfang@12442 861
mfang@12442 862 .fi
mfang@12442 863 .if n \{\
mfang@12442 864 .RE
mfang@12442 865 .\}
mfang@12442 866 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
mfang@12442 867 \fB\-Xmn\fR
mfang@12442 868 option or the
mfang@12442 869 \fB\-XX:NewSize\fR
mfang@12442 870 option\&.
mfang@12442 871 .RE
mfang@12442 872 .PP
mfang@12442 873 \-Xmx\fIsize\fR
mfang@12442 874 .RS 4
mfang@12442 875 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
mfang@12442 876 \fBk\fR
mfang@12442 877 or
mfang@12442 878 \fBK\fR
mfang@12442 879 to indicate kilobytes,
mfang@12442 880 \fBm\fR
mfang@12442 881 or
mfang@12442 882 \fBM\fR
mfang@12442 883 to indicate megabytes,
mfang@12442 884 \fBg\fR
mfang@12442 885 or
mfang@12442 886 \fBG\fR
mfang@12442 887 to indicate gigabytes\&. The default value is chosen at runtime based on system configuration\&. For server deployments,
mfang@12442 888 \fB\-Xms\fR
mfang@12442 889 and
mfang@12442 890 \fB\-Xmx\fR
mfang@12442 891 are often set to the same value\&. See the section "Ergonomics" in
mfang@12442 892 \fIJava SE HotSpot Virtual Machine Garbage Collection Tuning Guide\fR
mfang@12442 893 at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gctuning/index\&.html\&.
mfang@12442 894 .sp
rgallard@8813 895 The following examples show how to set the maximum allowed size of allocated memory to 80 MB using various units:
mfang@12442 896 .sp
mfang@12442 897 .if n \{\
mfang@12442 898 .RS 4
mfang@12442 899 .\}
mfang@12442 900 .nf
mfang@12442 901 \fB\-Xmx83886080\fR
mfang@12442 902 \fB\-Xmx81920k\fR
mfang@12442 903 \fB\-Xmx80m\fR
mfang@12442 904
mfang@12442 905 .fi
mfang@12442 906 .if n \{\
mfang@12442 907 .RE
mfang@12442 908 .\}
mfang@12442 909 The
mfang@12442 910 \fB\-Xmx\fR
mfang@12442 911 option is equivalent to
mfang@12442 912 \fB\-XX:MaxHeapSize\fR\&.
mfang@12442 913 .RE
mfang@12442 914 .PP
mfang@12442 915 \-Xnoclassgc
mfang@12442 916 .RS 4
rgallard@8813 917 Disables garbage collection (GC) of classes\&. This can save some GC time, which shortens interruptions during the application run\&.
mfang@12442 918 .sp
mfang@12442 919 When you specify
mfang@12442 920 \fB\-Xnoclassgc\fR
mfang@12442 921 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\&.
mfang@12442 922 .RE
mfang@12442 923 .PP
mfang@12442 924 \-Xprof
mfang@12442 925 .RS 4
rgallard@8813 926 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\&.
mfang@12442 927 .RE
mfang@12442 928 .PP
mfang@12442 929 \-Xrs
mfang@12442 930 .RS 4
rgallard@8813 931 Reduces the use of operating system signals by the JVM\&.
mfang@12442 932 .sp
rgallard@8813 933 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\&.
mfang@12442 934 .sp
mfang@12442 935 The JVM catches signals to implement shutdown hooks for unexpected termination\&. The JVM uses
mfang@12442 936 \fBSIGHUP\fR,
mfang@12442 937 \fBSIGINT\fR, and
mfang@12442 938 \fBSIGTERM\fR
mfang@12442 939 to initiate the running of shutdown hooks\&.
mfang@12442 940 .sp
mfang@12442 941 The JVM uses a similar mechanism to implement the feature of dumping thread stacks for debugging purposes\&. The JVM uses
mfang@12442 942 \fBSIGQUIT\fR
mfang@12442 943 to perform thread dumps\&.
mfang@12442 944 .sp
mfang@12442 945 Applications embedding the JVM frequently need to trap signals such as
mfang@12442 946 \fBSIGINT\fR
mfang@12442 947 or
mfang@12442 948 \fBSIGTERM\fR, which can lead to interference with the JVM signal handlers\&. The
mfang@12442 949 \fB\-Xrs\fR
mfang@12442 950 option is available to address this issue\&. When
mfang@12442 951 \fB\-Xrs\fR
mfang@12442 952 is used, the signal masks for
mfang@12442 953 \fBSIGINT\fR,
mfang@12442 954 \fBSIGTERM\fR,
mfang@12442 955 \fBSIGHUP\fR, and
mfang@12442 956 \fBSIGQUIT\fR
mfang@12442 957 are not changed by the JVM, and signal handlers for these signals are not installed\&.
mfang@12442 958 .sp
mfang@12442 959 There are two consequences of specifying
mfang@12442 960 \fB\-Xrs\fR:
mfang@12442 961 .sp
mfang@12442 962 .RS 4
mfang@12442 963 .ie n \{\
mfang@12442 964 \h'-04'\(bu\h'+03'\c
mfang@12442 965 .\}
mfang@12442 966 .el \{\
mfang@12442 967 .sp -1
mfang@12442 968 .IP \(bu 2.3
mfang@12442 969 .\}
mfang@12442 970 \fBSIGQUIT\fR
mfang@12442 971 thread dumps are not available\&.
mfang@12442 972 .RE
mfang@12442 973 .sp
mfang@12442 974 .RS 4
mfang@12442 975 .ie n \{\
mfang@12442 976 \h'-04'\(bu\h'+03'\c
mfang@12442 977 .\}
mfang@12442 978 .el \{\
mfang@12442 979 .sp -1
mfang@12442 980 .IP \(bu 2.3
mfang@12442 981 .\}
mfang@12442 982 User code is responsible for causing shutdown hooks to run, for example, by calling
mfang@12442 983 \fBSystem\&.exit()\fR
mfang@12442 984 when the JVM is to be terminated\&.
mfang@12442 985 .RE
mfang@12442 986 .RE
mfang@12442 987 .PP
mfang@12442 988 \-Xshare:\fImode\fR
mfang@12442 989 .RS 4
mfang@12442 990 Sets the class data sharing (CDS) mode\&. Possible
mfang@12442 991 \fImode\fR
mfang@12442 992 arguments for this option include the following:
mfang@12442 993 .PP
rgallard@8813 994 auto
mfang@12442 995 .RS 4
mfang@12442 996 Use CDS if possible\&. This is the default value for Java HotSpot 32\-Bit Client VM\&.
mfang@12442 997 .RE
mfang@12442 998 .PP
rgallard@8813 999 on
mfang@12442 1000 .RS 4
mfang@12442 1001 Require the use of CDS\&. Print an error message and exit if class data sharing cannot be used\&.
mfang@12442 1002 .RE
mfang@12442 1003 .PP
rgallard@8813 1004 off
mfang@12442 1005 .RS 4
mfang@12442 1006 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\&.
mfang@12442 1007 .RE
mfang@12442 1008 .PP
rgallard@8813 1009 dump
mfang@12442 1010 .RS 4
mfang@12442 1011 Manually generate the CDS archive\&. Specify the application class path as described in "Setting the Class Path "\&.
mfang@12442 1012 .sp
mfang@12442 1013 You should regenerate the CDS archive with each new JDK release\&.
mfang@12442 1014 .RE
mfang@12442 1015 .RE
mfang@12442 1016 .PP
mfang@12442 1017 \-XshowSettings:\fIcategory\fR
mfang@12442 1018 .RS 4
mfang@12442 1019 Shows settings and continues\&. Possible
mfang@12442 1020 \fIcategory\fR
mfang@12442 1021 arguments for this option include the following:
mfang@12442 1022 .PP
rgallard@8813 1023 all
mfang@12442 1024 .RS 4
rgallard@8813 1025 Shows all categories of settings\&. This is the default value\&.
mfang@12442 1026 .RE
mfang@12442 1027 .PP
rgallard@8813 1028 locale
mfang@12442 1029 .RS 4
rgallard@8813 1030 Shows settings related to locale\&.
mfang@12442 1031 .RE
mfang@12442 1032 .PP
rgallard@8813 1033 properties
mfang@12442 1034 .RS 4
rgallard@8813 1035 Shows settings related to system properties\&.
mfang@12442 1036 .RE
mfang@12442 1037 .PP
rgallard@8813 1038 vm
mfang@12442 1039 .RS 4
rgallard@8813 1040 Shows the settings of the JVM\&.
mfang@12442 1041 .RE
mfang@12442 1042 .RE
mfang@12442 1043 .PP
mfang@12442 1044 \-Xss\fIsize\fR
mfang@12442 1045 .RS 4
mfang@12442 1046 Sets the thread stack size (in bytes)\&. Append the letter
mfang@12442 1047 \fBk\fR
mfang@12442 1048 or
mfang@12442 1049 \fBK\fR
mfang@12442 1050 to indicate KB,
mfang@12442 1051 \fBm\fR
mfang@12442 1052 or
mfang@12442 1053 \fBM\fR
mfang@12442 1054 to indicate MB,
mfang@12442 1055 \fBg\fR
mfang@12442 1056 or
mfang@12442 1057 \fBG\fR
mfang@12442 1058 to indicate GB\&. The default value depends on the platform:
mfang@12442 1059 .sp
mfang@12442 1060 .RS 4
mfang@12442 1061 .ie n \{\
mfang@12442 1062 \h'-04'\(bu\h'+03'\c
mfang@12442 1063 .\}
mfang@12442 1064 .el \{\
mfang@12442 1065 .sp -1
mfang@12442 1066 .IP \(bu 2.3
mfang@12442 1067 .\}
mfang@12442 1068 Linux/ARM (32\-bit): 320 KB
mfang@12442 1069 .RE
mfang@12442 1070 .sp
mfang@12442 1071 .RS 4
mfang@12442 1072 .ie n \{\
mfang@12442 1073 \h'-04'\(bu\h'+03'\c
mfang@12442 1074 .\}
mfang@12442 1075 .el \{\
mfang@12442 1076 .sp -1
mfang@12442 1077 .IP \(bu 2.3
mfang@12442 1078 .\}
mfang@12442 1079 Linux/i386 (32\-bit): 320 KB
mfang@12442 1080 .RE
mfang@12442 1081 .sp
mfang@12442 1082 .RS 4
mfang@12442 1083 .ie n \{\
mfang@12442 1084 \h'-04'\(bu\h'+03'\c
mfang@12442 1085 .\}
mfang@12442 1086 .el \{\
mfang@12442 1087 .sp -1
mfang@12442 1088 .IP \(bu 2.3
mfang@12442 1089 .\}
mfang@12442 1090 Linux/x64 (64\-bit): 1024 KB
mfang@12442 1091 .RE
mfang@12442 1092 .sp
mfang@12442 1093 .RS 4
mfang@12442 1094 .ie n \{\
mfang@12442 1095 \h'-04'\(bu\h'+03'\c
mfang@12442 1096 .\}
mfang@12442 1097 .el \{\
mfang@12442 1098 .sp -1
mfang@12442 1099 .IP \(bu 2.3
mfang@12442 1100 .\}
mfang@12442 1101 OS X (64\-bit): 1024 KB
mfang@12442 1102 .RE
mfang@12442 1103 .sp
mfang@12442 1104 .RS 4
mfang@12442 1105 .ie n \{\
mfang@12442 1106 \h'-04'\(bu\h'+03'\c
mfang@12442 1107 .\}
mfang@12442 1108 .el \{\
mfang@12442 1109 .sp -1
mfang@12442 1110 .IP \(bu 2.3
mfang@12442 1111 .\}
mfang@12442 1112 Oracle Solaris/i386 (32\-bit): 320 KB
mfang@12442 1113 .RE
mfang@12442 1114 .sp
mfang@12442 1115 .RS 4
mfang@12442 1116 .ie n \{\
mfang@12442 1117 \h'-04'\(bu\h'+03'\c
mfang@12442 1118 .\}
mfang@12442 1119 .el \{\
mfang@12442 1120 .sp -1
mfang@12442 1121 .IP \(bu 2.3
mfang@12442 1122 .\}
mfang@12442 1123 Oracle Solaris/x64 (64\-bit): 1024 KB
mfang@12442 1124 .RE
mfang@12442 1125 .sp
rgallard@8813 1126 The following examples set the thread stack size to 1024 KB in different units:
mfang@12442 1127 .sp
mfang@12442 1128 .if n \{\
mfang@12442 1129 .RS 4
mfang@12442 1130 .\}
mfang@12442 1131 .nf
mfang@12442 1132 \fB\-Xss1m\fR
mfang@12442 1133 \fB\-Xss1024k\fR
mfang@12442 1134 \fB\-Xss1048576\fR
mfang@12442 1135
mfang@12442 1136 .fi
mfang@12442 1137 .if n \{\
mfang@12442 1138 .RE
mfang@12442 1139 .\}
mfang@12442 1140 This option is equivalent to
mfang@12442 1141 \fB\-XX:ThreadStackSize\fR\&.
mfang@12442 1142 .RE
mfang@12442 1143 .PP
mfang@12442 1144 \-Xusealtsigs
mfang@12442 1145 .RS 4
mfang@12442 1146 Use alternative signals instead of
mfang@12442 1147 \fBSIGUSR1\fR
mfang@12442 1148 and
mfang@12442 1149 \fBSIGUSR2\fR
mfang@12442 1150 for JVM internal signals\&. This option is equivalent to
mfang@12442 1151 \fB\-XX:+UseAltSigs\fR\&.
mfang@12442 1152 .RE
mfang@12442 1153 .PP
mfang@12442 1154 \-Xverify:\fImode\fR
mfang@12442 1155 .RS 4
mfang@12442 1156 Sets the mode of the bytecode verifier\&. Bytecode verification helps to troubleshoot some problems, but it also adds overhead to the running application\&. Possible
mfang@12442 1157 \fImode\fR
mfang@12442 1158 arguments for this option include the following:
mfang@12442 1159 .PP
rgallard@8813 1160 none
mfang@12442 1161 .RS 4
rgallard@8813 1162 Do not verify the bytecode\&. This reduces startup time and also reduces the protection provided by Java\&.
mfang@12442 1163 .RE
mfang@12442 1164 .PP
rgallard@8813 1165 remote
mfang@12442 1166 .RS 4
mfang@12442 1167 Verify those classes that are not loaded by the bootstrap class loader\&. This is the default behavior if you do not specify the
mfang@12442 1168 \fB\-Xverify\fR
mfang@12442 1169 option\&.
mfang@12442 1170 .RE
mfang@12442 1171 .PP
rgallard@8813 1172 all
mfang@12442 1173 .RS 4
rgallard@8813 1174 Verify all classes\&.
mfang@12442 1175 .RE
mfang@12442 1176 .RE
mfang@12442 1177 .SS "Advanced Runtime Options"
mfang@12442 1178 .PP
rgallard@8813 1179 These options control the runtime behavior of the Java HotSpot VM\&.
mfang@12442 1180 .PP
mfang@12442 1181 \-XX:+CheckEndorsedAndExtDirs
mfang@12442 1182 .RS 4
mfang@12442 1183 Enables the option to prevent the
mfang@12442 1184 \fBjava\fR
mfang@12442 1185 command from running a Java application if it uses the endorsed\-standards override mechanism or the extension mechanism\&. This option checks if an application is using one of these mechanisms by checking the following:
mfang@12442 1186 .sp
mfang@12442 1187 .RS 4
mfang@12442 1188 .ie n \{\
mfang@12442 1189 \h'-04'\(bu\h'+03'\c
mfang@12442 1190 .\}
mfang@12442 1191 .el \{\
mfang@12442 1192 .sp -1
mfang@12442 1193 .IP \(bu 2.3
mfang@12442 1194 .\}
mfang@12442 1195 The
mfang@12442 1196 \fBjava\&.ext\&.dirs\fR
mfang@12442 1197 or
mfang@12442 1198 \fBjava\&.endorsed\&.dirs\fR
mfang@12442 1199 system property is set\&.
mfang@12442 1200 .RE
mfang@12442 1201 .sp
mfang@12442 1202 .RS 4
mfang@12442 1203 .ie n \{\
mfang@12442 1204 \h'-04'\(bu\h'+03'\c
mfang@12442 1205 .\}
mfang@12442 1206 .el \{\
mfang@12442 1207 .sp -1
mfang@12442 1208 .IP \(bu 2.3
mfang@12442 1209 .\}
mfang@12442 1210 The
mfang@12442 1211 \fBlib/endorsed\fR
mfang@12442 1212 directory exists and is not empty\&.
mfang@12442 1213 .RE
mfang@12442 1214 .sp
mfang@12442 1215 .RS 4
mfang@12442 1216 .ie n \{\
mfang@12442 1217 \h'-04'\(bu\h'+03'\c
mfang@12442 1218 .\}
mfang@12442 1219 .el \{\
mfang@12442 1220 .sp -1
mfang@12442 1221 .IP \(bu 2.3
mfang@12442 1222 .\}
mfang@12442 1223 The
mfang@12442 1224 \fBlib/ext\fR
mfang@12442 1225 directory contains any JAR files other than those of the JDK\&.
mfang@12442 1226 .RE
mfang@12442 1227 .sp
mfang@12442 1228 .RS 4
mfang@12442 1229 .ie n \{\
mfang@12442 1230 \h'-04'\(bu\h'+03'\c
mfang@12442 1231 .\}
mfang@12442 1232 .el \{\
mfang@12442 1233 .sp -1
mfang@12442 1234 .IP \(bu 2.3
mfang@12442 1235 .\}
mfang@12442 1236 The system\-wide platform\-specific extension directory contains any JAR files\&.
mfang@12442 1237 .RE
mfang@12442 1238 .RE
mfang@12442 1239 .PP
mfang@12442 1240 \-XX:+DisableAttachMechanism
mfang@12442 1241 .RS 4
mfang@12442 1242 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
mfang@12442 1243 \fBjcmd\fR,
mfang@12442 1244 \fBjstack\fR,
mfang@12442 1245 \fBjmap\fR, and
mfang@12442 1246 \fBjinfo\fR\&.
mfang@12442 1247 .RE
mfang@12442 1248 .PP
mfang@12442 1249 \-XX:ErrorFile=\fIfilename\fR
mfang@12442 1250 .RS 4
mfang@12442 1251 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
mfang@12442 1252 \fBhs_err_pid\fR\fIpid\fR\fB\&.log\fR
mfang@12442 1253 where
mfang@12442 1254 \fIpid\fR
mfang@12442 1255 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
mfang@12442 1256 \fB%p\fR):
mfang@12442 1257 .sp
mfang@12442 1258 .if n \{\
mfang@12442 1259 .RS 4
mfang@12442 1260 .\}
mfang@12442 1261 .nf
mfang@12442 1262 \fB\-XX:ErrorFile=\&./hs_err_pid%p\&.log\fR
mfang@12442 1263
mfang@12442 1264 .fi
mfang@12442 1265 .if n \{\
mfang@12442 1266 .RE
mfang@12442 1267 .\}
mfang@12442 1268 The following example shows how to set the error log to
mfang@12442 1269 \fB/var/log/java/java_error\&.log\fR:
mfang@12442 1270 .sp
mfang@12442 1271 .if n \{\
mfang@12442 1272 .RS 4
mfang@12442 1273 .\}
mfang@12442 1274 .nf
mfang@12442 1275 \fB\-XX:ErrorFile=/var/log/java/java_error\&.log\fR
mfang@12442 1276
mfang@12442 1277 .fi
mfang@12442 1278 .if n \{\
mfang@12442 1279 .RE
mfang@12442 1280 .\}
mfang@12442 1281 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
mfang@12442 1282 \fB/tmp\fR\&.
mfang@12442 1283 .RE
mfang@12442 1284 .PP
mfang@12442 1285 \-XX:+FailOverToOldVerifier
mfang@12442 1286 .RS 4
mfang@12442 1287 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\&.
mfang@12442 1288 .RE
mfang@12442 1289 .PP
mfang@12442 1290 \-XX:LargePageSizeInBytes=\fIsize\fR
mfang@12442 1291 .RS 4
mfang@12442 1292 On Solaris, sets the maximum size (in bytes) for large pages used for Java heap\&. The
mfang@12442 1293 \fIsize\fR
mfang@12442 1294 argument must be a power of 2 (2, 4, 8, 16, \&.\&.\&.)\&. Append the letter
mfang@12442 1295 \fBk\fR
mfang@12442 1296 or
mfang@12442 1297 \fBK\fR
mfang@12442 1298 to indicate kilobytes,
mfang@12442 1299 \fBm\fR
mfang@12442 1300 or
mfang@12442 1301 \fBM\fR
mfang@12442 1302 to indicate megabytes,
mfang@12442 1303 \fBg\fR
mfang@12442 1304 or
mfang@12442 1305 \fBG\fR
mfang@12442 1306 to indicate gigabytes\&. By default, the size is set to 0, meaning that the JVM chooses the size for large pages automatically\&.
mfang@12442 1307 .sp
rgallard@8813 1308 The following example illustrates how to set the large page size to 4 megabytes (MB):
mfang@12442 1309 .sp
mfang@12442 1310 .if n \{\
mfang@12442 1311 .RS 4
mfang@12442 1312 .\}
mfang@12442 1313 .nf
mfang@12442 1314 \fB\-XX:LargePageSizeInBytes=4m\fR
mfang@12442 1315
mfang@12442 1316 .fi
mfang@12442 1317 .if n \{\
mfang@12442 1318 .RE
mfang@12442 1319 .\}
mfang@12442 1320 .RE
mfang@12442 1321 .PP
mfang@12442 1322 \-XX:MaxDirectMemorySize=\fIsize\fR
mfang@12442 1323 .RS 4
mfang@12442 1324 Sets the maximum total size (in bytes) of the New I/O (the
mfang@12442 1325 \fBjava\&.nio\fR
mfang@12442 1326 package) direct\-buffer allocations\&. Append the letter
mfang@12442 1327 \fBk\fR
mfang@12442 1328 or
mfang@12442 1329 \fBK\fR
mfang@12442 1330 to indicate kilobytes,
mfang@12442 1331 \fBm\fR
mfang@12442 1332 or
mfang@12442 1333 \fBM\fR
mfang@12442 1334 to indicate megabytes,
mfang@12442 1335 \fBg\fR
mfang@12442 1336 or
mfang@12442 1337 \fBG\fR
mfang@12442 1338 to indicate gigabytes\&. By default, the size is set to 0, meaning that the JVM chooses the size for NIO direct\-buffer allocations automatically\&.
mfang@12442 1339 .sp
rgallard@8813 1340 The following examples illustrate how to set the NIO size to 1024 KB in different units:
mfang@12442 1341 .sp
mfang@12442 1342 .if n \{\
mfang@12442 1343 .RS 4
mfang@12442 1344 .\}
mfang@12442 1345 .nf
mfang@12442 1346 \fB\-XX:MaxDirectMemorySize=1m\fR
mfang@12442 1347 \fB\-XX:MaxDirectMemorySize=1024k\fR
mfang@12442 1348 \fB\-XX:MaxDirectMemorySize=1048576\fR
mfang@12442 1349
mfang@12442 1350 .fi
mfang@12442 1351 .if n \{\
mfang@12442 1352 .RE
mfang@12442 1353 .\}
mfang@12442 1354 .RE
mfang@12442 1355 .PP
mfang@12442 1356 \-XX:NativeMemoryTracking=\fImode\fR
mfang@12442 1357 .RS 4
mfang@12442 1358 Specifies the mode for tracking JVM native memory usage\&. Possible
mfang@12442 1359 \fImode\fR
mfang@12442 1360 arguments for this option include the following:
mfang@12442 1361 .PP
rgallard@8813 1362 off
mfang@12442 1363 .RS 4
mfang@12442 1364 Do not track JVM native memory usage\&. This is the default behavior if you do not specify the
mfang@12442 1365 \fB\-XX:NativeMemoryTracking\fR
mfang@12442 1366 option\&.
mfang@12442 1367 .RE
mfang@12442 1368 .PP
rgallard@8813 1369 summary
mfang@12442 1370 .RS 4
rgallard@8813 1371 Only track memory usage by JVM subsystems, such as Java heap, class, code, and thread\&.
mfang@12442 1372 .RE
mfang@12442 1373 .PP
rgallard@8813 1374 detail
mfang@12442 1375 .RS 4
mfang@12442 1376 In addition to tracking memory usage by JVM subsystems, track memory usage by individual
mfang@12442 1377 \fBCallSite\fR, individual virtual memory region and its committed regions\&.
mfang@12442 1378 .RE
mfang@12442 1379 .RE
mfang@12442 1380 .PP
mfang@12442 1381 \-XX:ObjectAlignmentInBytes=\fIalignment\fR
mfang@12442 1382 .RS 4
mfang@12442 1383 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\&.
mfang@12442 1384 .sp
mfang@12442 1385 The heap size limit in bytes is calculated as:
mfang@12442 1386 .sp
mfang@12442 1387 \fB4GB * ObjectAlignmentInBytes\fR
mfang@12442 1388 .sp
mfang@12442 1389 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\&.
mfang@12442 1390 .RE
mfang@12442 1391 .PP
mfang@12442 1392 \-XX:OnError=\fIstring\fR
mfang@12442 1393 .RS 4
mfang@12442 1394 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\&.
mfang@12442 1395 .sp
mfang@12442 1396 The following example shows how the
mfang@12442 1397 \fB\-XX:OnError\fR
mfang@12442 1398 option can be used to run the
mfang@12442 1399 \fBgcore\fR
mfang@12442 1400 command to create the core image, and the debugger is started to attach to the process in case of an irrecoverable error (the
mfang@12442 1401 \fB%p\fR
mfang@12442 1402 designates the current process):
mfang@12442 1403 .sp
mfang@12442 1404 .if n \{\
mfang@12442 1405 .RS 4
mfang@12442 1406 .\}
mfang@12442 1407 .nf
mfang@12442 1408 \fB\-XX:OnError="gcore %p;dbx \- %p"\fR
mfang@12442 1409
mfang@12442 1410 .fi
mfang@12442 1411 .if n \{\
mfang@12442 1412 .RE
mfang@12442 1413 .\}
mfang@12442 1414 .RE
mfang@12442 1415 .PP
mfang@12442 1416 \-XX:OnOutOfMemoryError=\fIstring\fR
mfang@12442 1417 .RS 4
mfang@12442 1418 Sets a custom command or a series of semicolon\-separated commands to run when an
mfang@12442 1419 \fBOutOfMemoryError\fR
mfang@12442 1420 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
mfang@12442 1421 \fB\-XX:OnError\fR
mfang@12442 1422 option\&.
mfang@12442 1423 .RE
mfang@12442 1424 .PP
mfang@12442 1425 \-XX:+PerfDataSaveToFile
mfang@12442 1426 .RS 4
mfang@12442 1427 If enabled, saves
mfang@12442 1428 jstat(1) binary data when the Java application exits\&. This binary data is saved in a file named
mfang@12442 1429 \fBhsperfdata_\fR\fI<pid>\fR, where
mfang@12442 1430 \fI<pid>\fR
mfang@12442 1431 is the process identifier of the Java application you ran\&. Use
mfang@12442 1432 \fBjstat\fR
mfang@12442 1433 to display the performance data contained in this file as follows:
mfang@12442 1434 .sp
mfang@12442 1435 .if n \{\
mfang@12442 1436 .RS 4
mfang@12442 1437 .\}
mfang@12442 1438 .nf
mfang@12442 1439 \fBjstat \-class file:///\fR\fB\fI<path>\fR\fR\fB/hsperfdata_\fR\fB\fI<pid>\fR\fR
mfang@12442 1440 \fBjstat \-gc file:///\fR\fB\fI<path>\fR\fR\fB/hsperfdata_\fR\fB\fI<pid>\fR\fR
mfang@12442 1441 .fi
mfang@12442 1442 .if n \{\
mfang@12442 1443 .RE
mfang@12442 1444 .\}
mfang@12442 1445 .RE
mfang@12442 1446 .PP
mfang@12442 1447 \-XX:+PrintCommandLineFlags
mfang@12442 1448 .RS 4
rgallard@8813 1449 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\&.
mfang@12442 1450 .RE
mfang@12442 1451 .PP
mfang@12442 1452 \-XX:+PrintNMTStatistics
mfang@12442 1453 .RS 4
mfang@12442 1454 Enables printing of collected native memory tracking data at JVM exit when native memory tracking is enabled (see
mfang@12442 1455 \fB\-XX:NativeMemoryTracking\fR)\&. By default, this option is disabled and native memory tracking data is not printed\&.
mfang@12442 1456 .RE
mfang@12442 1457 .PP
mfang@12442 1458 \-XX:+RelaxAccessControlCheck
mfang@12442 1459 .RS 4
mfang@12442 1460 Decreases the amount of access control checks in the verifier\&. 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\&.
mfang@12442 1461 .RE
mfang@12442 1462 .PP
mfang@12442 1463 \-XX:+ShowMessageBoxOnError
mfang@12442 1464 .RS 4
rgallard@8813 1465 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\&.
mfang@12442 1466 .RE
mfang@12442 1467 .PP
mfang@12442 1468 \-XX:ThreadStackSize=\fIsize\fR
mfang@12442 1469 .RS 4
mfang@12442 1470 Sets the thread stack size (in bytes)\&. Append the letter
mfang@12442 1471 \fBk\fR
mfang@12442 1472 or
mfang@12442 1473 \fBK\fR
mfang@12442 1474 to indicate kilobytes,
mfang@12442 1475 \fBm\fR
mfang@12442 1476 or
mfang@12442 1477 \fBM\fR
mfang@12442 1478 to indicate megabytes,
mfang@12442 1479 \fBg\fR
mfang@12442 1480 or
mfang@12442 1481 \fBG\fR
mfang@12442 1482 to indicate gigabytes\&. The default value depends on the platform:
mfang@12442 1483 .sp
mfang@12442 1484 .RS 4
mfang@12442 1485 .ie n \{\
mfang@12442 1486 \h'-04'\(bu\h'+03'\c
mfang@12442 1487 .\}
mfang@12442 1488 .el \{\
mfang@12442 1489 .sp -1
mfang@12442 1490 .IP \(bu 2.3
mfang@12442 1491 .\}
mfang@12442 1492 Linux/ARM (32\-bit): 320 KB
mfang@12442 1493 .RE
mfang@12442 1494 .sp
mfang@12442 1495 .RS 4
mfang@12442 1496 .ie n \{\
mfang@12442 1497 \h'-04'\(bu\h'+03'\c
mfang@12442 1498 .\}
mfang@12442 1499 .el \{\
mfang@12442 1500 .sp -1
mfang@12442 1501 .IP \(bu 2.3
mfang@12442 1502 .\}
mfang@12442 1503 Linux/i386 (32\-bit): 320 KB
mfang@12442 1504 .RE
mfang@12442 1505 .sp
mfang@12442 1506 .RS 4
mfang@12442 1507 .ie n \{\
mfang@12442 1508 \h'-04'\(bu\h'+03'\c
mfang@12442 1509 .\}
mfang@12442 1510 .el \{\
mfang@12442 1511 .sp -1
mfang@12442 1512 .IP \(bu 2.3
mfang@12442 1513 .\}
mfang@12442 1514 Linux/x64 (64\-bit): 1024 KB
mfang@12442 1515 .RE
mfang@12442 1516 .sp
mfang@12442 1517 .RS 4
mfang@12442 1518 .ie n \{\
mfang@12442 1519 \h'-04'\(bu\h'+03'\c
mfang@12442 1520 .\}
mfang@12442 1521 .el \{\
mfang@12442 1522 .sp -1
mfang@12442 1523 .IP \(bu 2.3
mfang@12442 1524 .\}
mfang@12442 1525 OS X (64\-bit): 1024 KB
mfang@12442 1526 .RE
mfang@12442 1527 .sp
mfang@12442 1528 .RS 4
mfang@12442 1529 .ie n \{\
mfang@12442 1530 \h'-04'\(bu\h'+03'\c
mfang@12442 1531 .\}
mfang@12442 1532 .el \{\
mfang@12442 1533 .sp -1
mfang@12442 1534 .IP \(bu 2.3
mfang@12442 1535 .\}
mfang@12442 1536 Oracle Solaris/i386 (32\-bit): 320 KB
mfang@12442 1537 .RE
mfang@12442 1538 .sp
mfang@12442 1539 .RS 4
mfang@12442 1540 .ie n \{\
mfang@12442 1541 \h'-04'\(bu\h'+03'\c
mfang@12442 1542 .\}
mfang@12442 1543 .el \{\
mfang@12442 1544 .sp -1
mfang@12442 1545 .IP \(bu 2.3
mfang@12442 1546 .\}
mfang@12442 1547 Oracle Solaris/x64 (64\-bit): 1024 KB
mfang@12442 1548 .RE
mfang@12442 1549 .sp
rgallard@8813 1550 The following examples show how to set the thread stack size to 1024 KB in different units:
mfang@12442 1551 .sp
mfang@12442 1552 .if n \{\
mfang@12442 1553 .RS 4
mfang@12442 1554 .\}
mfang@12442 1555 .nf
mfang@12442 1556 \fB\-XX:ThreadStackSize=1m\fR
mfang@12442 1557 \fB\-XX:ThreadStackSize=1024k\fR
mfang@12442 1558 \fB\-XX:ThreadStackSize=1048576\fR
mfang@12442 1559
mfang@12442 1560 .fi
mfang@12442 1561 .if n \{\
mfang@12442 1562 .RE
mfang@12442 1563 .\}
mfang@12442 1564 This option is equivalent to
mfang@12442 1565 \fB\-Xss\fR\&.
mfang@12442 1566 .RE
mfang@12442 1567 .PP
mfang@12442 1568 \-XX:+TraceClassLoading
mfang@12442 1569 .RS 4
rgallard@8813 1570 Enables tracing of classes as they are loaded\&. By default, this option is disabled and classes are not traced\&.
mfang@12442 1571 .RE
mfang@12442 1572 .PP
mfang@12442 1573 \-XX:+TraceClassLoadingPreorder
mfang@12442 1574 .RS 4
rgallard@8813 1575 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\&.
mfang@12442 1576 .RE
mfang@12442 1577 .PP
mfang@12442 1578 \-XX:+TraceClassResolution
mfang@12442 1579 .RS 4
rgallard@8813 1580 Enables tracing of constant pool resolutions\&. By default, this option is disabled and constant pool resolutions are not traced\&.
mfang@12442 1581 .RE
mfang@12442 1582 .PP
mfang@12442 1583 \-XX:+TraceClassUnloading
mfang@12442 1584 .RS 4
rgallard@8813 1585 Enables tracing of classes as they are unloaded\&. By default, this option is disabled and classes are not traced\&.
mfang@12442 1586 .RE
mfang@12442 1587 .PP
mfang@12442 1588 \-XX:+TraceLoaderConstraints
mfang@12442 1589 .RS 4
mfang@12442 1590 Enables tracing of the loader constraints recording\&. By default, this option is disabled and loader constraints recording is not traced\&.
mfang@12442 1591 .RE
mfang@12442 1592 .PP
mfang@12442 1593 \-XX:+UseAltSigs
mfang@12442 1594 .RS 4
mfang@12442 1595 Enables the use of alternative signals instead of
mfang@12442 1596 \fBSIGUSR1\fR
mfang@12442 1597 and
mfang@12442 1598 \fBSIGUSR2\fR
mfang@12442 1599 for JVM internal signals\&. By default, this option is disabled and alternative signals are not used\&. This option is equivalent to
mfang@12442 1600 \fB\-Xusealtsigs\fR\&.
mfang@12442 1601 .RE
mfang@12442 1602 .PP
mfang@12442 1603 \-XX:\-UseBiasedLocking
mfang@12442 1604 .RS 4
mfang@12442 1605 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
mfang@12442 1606 .sp
mfang@12442 1607 By default, this option is enabled\&.
mfang@12442 1608 .RE
mfang@12442 1609 .PP
mfang@12442 1610 \-XX:\-UseCompressedOops
mfang@12442 1611 .RS 4
mfang@12442 1612 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\&.
mfang@12442 1613 .sp
mfang@12442 1614 It is also possible to use compressed pointers when Java heap sizes are greater than 32GB\&. See the
mfang@12442 1615 \fB\-XX:ObjectAlignmentInBytes\fR
mfang@12442 1616 option\&.
mfang@12442 1617 .RE
mfang@12442 1618 .PP
mfang@12442 1619 \-XX:+UseHugeTLBFS
mfang@12442 1620 .RS 4
mfang@12442 1621 This option for Linux is the equivalent of specifying
mfang@12442 1622 \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
mfang@12442 1623 \fB\-XX:UseTransparentHugePages\fR
mfang@12442 1624 if you want this behavior\&.
mfang@12442 1625 .sp
mfang@12442 1626 For more information, see "Large Pages"\&.
mfang@12442 1627 .RE
mfang@12442 1628 .PP
mfang@12442 1629 \-XX:+UseLargePages
mfang@12442 1630 .RS 4
mfang@12442 1631 Enables the use of large page memory\&. By default, this option is disabled and large page memory is not used\&.
mfang@12442 1632 .sp
mfang@12442 1633 For more information, see "Large Pages"\&.
mfang@12442 1634 .RE
mfang@12442 1635 .PP
mfang@12442 1636 \-XX:+UseMembar
mfang@12442 1637 .RS 4
mfang@12442 1638 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\&.)
mfang@12442 1639 .RE
mfang@12442 1640 .PP
mfang@12442 1641 \-XX:+UsePerfData
mfang@12442 1642 .RS 4
mfang@12442 1643 Enables the
mfang@12442 1644 \fBperfdata\fR
mfang@12442 1645 feature\&. This option is enabled by default to allow JVM monitoring and performance testing\&. Disabling it suppresses the creation of the
mfang@12442 1646 \fBhsperfdata_userid\fR
mfang@12442 1647 directories\&. To disable the
mfang@12442 1648 \fBperfdata\fR
mfang@12442 1649 feature, specify
mfang@12442 1650 \fB\-XX:\-UsePerfData\fR\&.
mfang@12442 1651 .RE
mfang@12442 1652 .PP
mfang@12442 1653 \-XX:+UseTransparentHugePages
mfang@12442 1654 .RS 4
mfang@12442 1655 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\&.
mfang@12442 1656 .sp
mfang@12442 1657 For more information, see "Large Pages"\&.
mfang@12442 1658 .RE
mfang@12442 1659 .PP
mfang@12442 1660 \-XX:+AllowUserSignalHandlers
mfang@12442 1661 .RS 4
rgallard@8813 1662 Enables installation of signal handlers by the application\&. By default, this option is disabled and the application is not allowed to install signal handlers\&.
mfang@12442 1663 .RE
mfang@12442 1664 .SS "Advanced JIT Compiler Options"
mfang@12442 1665 .PP
mfang@12442 1666 These options control the dynamic just\-in\-time (JIT) compilation performed by the Java HotSpot VM\&.
mfang@12442 1667 .PP
mfang@12442 1668 \-XX:+AggressiveOpts
mfang@12442 1669 .RS 4
rgallard@8813 1670 Enables the use of aggressive performance optimization features, which are expected to become default in upcoming releases\&. By default, this option is disabled and experimental performance features are not used\&.
mfang@12442 1671 .RE
mfang@12442 1672 .PP
mfang@12442 1673 \-XX:AllocateInstancePrefetchLines=\fIlines\fR
mfang@12442 1674 .RS 4
rgallard@8813 1675 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:
mfang@12442 1676 .sp
mfang@12442 1677 .if n \{\
mfang@12442 1678 .RS 4
mfang@12442 1679 .\}
mfang@12442 1680 .nf
mfang@12442 1681 \fB\-XX:AllocateInstancePrefetchLines=1\fR
mfang@12442 1682
mfang@12442 1683 .fi
mfang@12442 1684 .if n \{\
mfang@12442 1685 .RE
mfang@12442 1686 .\}
mfang@12442 1687 Only the Java HotSpot Server VM supports this option\&.
mfang@12442 1688 .RE
mfang@12442 1689 .PP
mfang@12442 1690 \-XX:AllocatePrefetchDistance=\fIsize\fR
mfang@12442 1691 .RS 4
mfang@12442 1692 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\&.
mfang@12442 1693 .sp
mfang@12442 1694 Negative values denote that prefetch distance is chosen based on the platform\&. Positive values are bytes to prefetch\&. Append the letter
mfang@12442 1695 \fBk\fR
mfang@12442 1696 or
mfang@12442 1697 \fBK\fR
mfang@12442 1698 to indicate kilobytes,
mfang@12442 1699 \fBm\fR
mfang@12442 1700 or
mfang@12442 1701 \fBM\fR
mfang@12442 1702 to indicate megabytes,
mfang@12442 1703 \fBg\fR
mfang@12442 1704 or
mfang@12442 1705 \fBG\fR
mfang@12442 1706 to indicate gigabytes\&. The default value is set to \-1\&.
mfang@12442 1707 .sp
mfang@12442 1708 The following example shows how to set the prefetch distance to 1024 bytes:
mfang@12442 1709 .sp
mfang@12442 1710 .if n \{\
mfang@12442 1711 .RS 4
mfang@12442 1712 .\}
mfang@12442 1713 .nf
mfang@12442 1714 \fB\-XX:AllocatePrefetchDistance=1024\fR
mfang@12442 1715
mfang@12442 1716 .fi
mfang@12442 1717 .if n \{\
mfang@12442 1718 .RE
mfang@12442 1719 .\}
mfang@12442 1720 Only the Java HotSpot Server VM supports this option\&.
mfang@12442 1721 .RE
mfang@12442 1722 .PP
mfang@12442 1723 \-XX:AllocatePrefetchInstr=\fIinstruction\fR
mfang@12442 1724 .RS 4
mfang@12442 1725 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:
mfang@12442 1726 .sp
mfang@12442 1727 .if n \{\
mfang@12442 1728 .RS 4
mfang@12442 1729 .\}
mfang@12442 1730 .nf
mfang@12442 1731 \fB\-XX:AllocatePrefetchInstr=0\fR
mfang@12442 1732
mfang@12442 1733 .fi
mfang@12442 1734 .if n \{\
mfang@12442 1735 .RE
mfang@12442 1736 .\}
mfang@12442 1737 Only the Java HotSpot Server VM supports this option\&.
mfang@12442 1738 .RE
mfang@12442 1739 .PP
mfang@12442 1740 \-XX:AllocatePrefetchLines=\fIlines\fR
mfang@12442 1741 .RS 4
mfang@12442 1742 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\&.
mfang@12442 1743 .sp
mfang@12442 1744 The following example shows how to set the number of loaded cache lines to 5:
mfang@12442 1745 .sp
mfang@12442 1746 .if n \{\
mfang@12442 1747 .RS 4
mfang@12442 1748 .\}
mfang@12442 1749 .nf
mfang@12442 1750 \fB\-XX:AllocatePrefetchLines=5\fR
mfang@12442 1751
mfang@12442 1752 .fi
mfang@12442 1753 .if n \{\
mfang@12442 1754 .RE
mfang@12442 1755 .\}
mfang@12442 1756 Only the Java HotSpot Server VM supports this option\&.
mfang@12442 1757 .RE
mfang@12442 1758 .PP
mfang@12442 1759 \-XX:AllocatePrefetchStepSize=\fIsize\fR
mfang@12442 1760 .RS 4
mfang@12442 1761 Sets the step size (in bytes) for sequential prefetch instructions\&. Append the letter
mfang@12442 1762 \fBk\fR
mfang@12442 1763 or
mfang@12442 1764 \fBK\fR
mfang@12442 1765 to indicate kilobytes,
mfang@12442 1766 \fBm\fR
mfang@12442 1767 or
mfang@12442 1768 \fBM\fR
mfang@12442 1769 to indicate megabytes,
mfang@12442 1770 \fBg\fR
mfang@12442 1771 or
mfang@12442 1772 \fBG\fR
mfang@12442 1773 to indicate gigabytes\&. By default, the step size is set to 16 bytes:
mfang@12442 1774 .sp
mfang@12442 1775 .if n \{\
mfang@12442 1776 .RS 4
mfang@12442 1777 .\}
mfang@12442 1778 .nf
mfang@12442 1779 \fB\-XX:AllocatePrefetchStepSize=16\fR
mfang@12442 1780
mfang@12442 1781 .fi
mfang@12442 1782 .if n \{\
mfang@12442 1783 .RE
mfang@12442 1784 .\}
mfang@12442 1785 Only the Java HotSpot Server VM supports this option\&.
mfang@12442 1786 .RE
mfang@12442 1787 .PP
mfang@12442 1788 \-XX:AllocatePrefetchStyle=\fIstyle\fR
mfang@12442 1789 .RS 4
mfang@12442 1790 Sets the generated code style for prefetch instructions\&. The
mfang@12442 1791 \fIstyle\fR
mfang@12442 1792 argument is an integer from 0 to 3:
mfang@12442 1793 .PP
mfang@12442 1794 0
mfang@12442 1795 .RS 4
mfang@12442 1796 Do not generate prefetch instructions\&.
mfang@12442 1797 .RE
mfang@12442 1798 .PP
mfang@12442 1799 1
mfang@12442 1800 .RS 4
mfang@12442 1801 Execute prefetch instructions after each allocation\&. This is the default parameter\&.
mfang@12442 1802 .RE
mfang@12442 1803 .PP
mfang@12442 1804 2
mfang@12442 1805 .RS 4
mfang@12442 1806 Use the thread\-local allocation block (TLAB) watermark pointer to determine when prefetch instructions are executed\&.
mfang@12442 1807 .RE
mfang@12442 1808 .PP
mfang@12442 1809 3
mfang@12442 1810 .RS 4
mfang@12442 1811 Use BIS instruction on SPARC for allocation prefetch\&.
mfang@12442 1812 .RE
mfang@12442 1813 .sp
mfang@12442 1814 Only the Java HotSpot Server VM supports this option\&.
mfang@12442 1815 .RE
mfang@12442 1816 .PP
mfang@12442 1817 \-XX:+BackgroundCompilation
mfang@12442 1818 .RS 4
mfang@12442 1819 Enables background compilation\&. This option is enabled by default\&. To disable background compilation, specify
mfang@12442 1820 \fB\-XX:\-BackgroundCompilation\fR
mfang@12442 1821 (this is equivalent to specifying
mfang@12442 1822 \fB\-Xbatch\fR)\&.
mfang@12442 1823 .RE
mfang@12442 1824 .PP
mfang@12442 1825 \-XX:CICompilerCount=\fIthreads\fR
mfang@12442 1826 .RS 4
rgallard@8813 1827 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:
mfang@12442 1828 .sp
mfang@12442 1829 .if n \{\
mfang@12442 1830 .RS 4
mfang@12442 1831 .\}
duke@0 1832 .nf
mfang@12442 1833 \fB\-XX:CICompilerCount=2\fR
mfang@12442 1834
duke@0 1835 .fi
mfang@12442 1836 .if n \{\
mfang@12442 1837 .RE
mfang@12442 1838 .\}
mfang@12442 1839 .RE
mfang@12442 1840 .PP
mfang@12442 1841 \-XX:CodeCacheMinimumFreeSpace=\fIsize\fR
mfang@12442 1842 .RS 4
mfang@12442 1843 Sets the minimum free space (in bytes) required for compilation\&. Append the letter
mfang@12442 1844 \fBk\fR
mfang@12442 1845 or
mfang@12442 1846 \fBK\fR
mfang@12442 1847 to indicate kilobytes,
mfang@12442 1848 \fBm\fR
mfang@12442 1849 or
mfang@12442 1850 \fBM\fR
mfang@12442 1851 to indicate megabytes,
mfang@12442 1852 \fBg\fR
mfang@12442 1853 or
mfang@12442 1854 \fBG\fR
mfang@12442 1855 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:
mfang@12442 1856 .sp
mfang@12442 1857 .if n \{\
mfang@12442 1858 .RS 4
mfang@12442 1859 .\}
mfang@12442 1860 .nf
mfang@12442 1861 \fB\-XX:CodeCacheMinimumFreeSpace=1024m\fR
mfang@12442 1862
mfang@12442 1863 .fi
mfang@12442 1864 .if n \{\
mfang@12442 1865 .RE
mfang@12442 1866 .\}
mfang@12442 1867 .RE
mfang@12442 1868 .PP
mfang@12442 1869 \-XX:CompileCommand=\fIcommand\fR,\fImethod\fR[,\fIoption\fR]
mfang@12442 1870 .RS 4
mfang@12442 1871 Specifies a command to perform on a method\&. For example, to exclude the
mfang@12442 1872 \fBindexOf()\fR
mfang@12442 1873 method of the
mfang@12442 1874 \fBString\fR
mfang@12442 1875 class from being compiled, use the following:
mfang@12442 1876 .sp
mfang@12442 1877 .if n \{\
mfang@12442 1878 .RS 4
mfang@12442 1879 .\}
mfang@12442 1880 .nf
mfang@12442 1881 \fB\-XX:CompileCommand=exclude,java/lang/String\&.indexOf\fR
mfang@12442 1882
mfang@12442 1883 .fi
mfang@12442 1884 .if n \{\
mfang@12442 1885 .RE
mfang@12442 1886 .\}
mfang@12442 1887 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
mfang@12442 1888 \fB\-XX:+PrintCompilation\fR
mfang@12442 1889 and
mfang@12442 1890 \fB\-XX:+LogCompilation\fR
mfang@12442 1891 options:
mfang@12442 1892 .sp
mfang@12442 1893 .if n \{\
mfang@12442 1894 .RS 4
mfang@12442 1895 .\}
mfang@12442 1896 .nf
mfang@12442 1897 \fB\-XX:CompileCommand=exclude,java\&.lang\&.String::indexOf\fR
mfang@12442 1898
mfang@12442 1899 .fi
mfang@12442 1900 .if n \{\
mfang@12442 1901 .RE
mfang@12442 1902 .\}
mfang@12442 1903 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
mfang@12442 1904 \fBindexOf(String)\fR
mfang@12442 1905 method of the
mfang@12442 1906 \fBString\fR
mfang@12442 1907 class from being compiled, use the following:
mfang@12442 1908 .sp
mfang@12442 1909 .if n \{\
mfang@12442 1910 .RS 4
mfang@12442 1911 .\}
mfang@12442 1912 .nf
mfang@12442 1913 \fB\-XX:CompileCommand="exclude,java/lang/String\&.indexOf,(Ljava/lang/String;)I"\fR
mfang@12442 1914
mfang@12442 1915 .fi
mfang@12442 1916 .if n \{\
mfang@12442 1917 .RE
mfang@12442 1918 .\}
mfang@12442 1919 You can also use the asterisk (*) as a wildcard for class and method names\&. For example, to exclude all
mfang@12442 1920 \fBindexOf()\fR
mfang@12442 1921 methods in all classes from being compiled, use the following:
mfang@12442 1922 .sp
mfang@12442 1923 .if n \{\
mfang@12442 1924 .RS 4
mfang@12442 1925 .\}
mfang@12442 1926 .nf
mfang@12442 1927 \fB\-XX:CompileCommand=exclude,*\&.indexOf\fR
mfang@12442 1928
mfang@12442 1929 .fi
mfang@12442 1930 .if n \{\
mfang@12442 1931 .RE
mfang@12442 1932 .\}
mfang@12442 1933 The commas and periods are aliases for spaces, making it easier to pass compiler commands through a shell\&. You can pass arguments to
mfang@12442 1934 \fB\-XX:CompileCommand\fR
mfang@12442 1935 using spaces as separators by enclosing the argument in quotation marks:
mfang@12442 1936 .sp
mfang@12442 1937 .if n \{\
mfang@12442 1938 .RS 4
mfang@12442 1939 .\}
mfang@12442 1940 .nf
mfang@12442 1941 \fB\-XX:CompileCommand="exclude java/lang/String indexOf"\fR
mfang@12442 1942
mfang@12442 1943 .fi
mfang@12442 1944 .if n \{\
mfang@12442 1945 .RE
mfang@12442 1946 .\}
mfang@12442 1947 Note that after parsing the commands passed on the command line using the
mfang@12442 1948 \fB\-XX:CompileCommand\fR
mfang@12442 1949 options, the JIT compiler then reads commands from the
mfang@12442 1950 \fB\&.hotspot_compiler\fR
mfang@12442 1951 file\&. You can add commands to this file or specify a different file using the
mfang@12442 1952 \fB\-XX:CompileCommandFile\fR
mfang@12442 1953 option\&.
mfang@12442 1954 .sp
mfang@12442 1955 To add several commands, either specify the
mfang@12442 1956 \fB\-XX:CompileCommand\fR
mfang@12442 1957 option multiple times, or separate each argument with the newline separator (\fB\en\fR)\&. The following commands are available:
mfang@12442 1958 .PP
rgallard@8813 1959 break
mfang@12442 1960 .RS 4
rgallard@8813 1961 Set a breakpoint when debugging the JVM to stop at the beginning of compilation of the specified method\&.
mfang@12442 1962 .RE
mfang@12442 1963 .PP
rgallard@8813 1964 compileonly
mfang@12442 1965 .RS 4
mfang@12442 1966 Exclude all methods from compilation except for the specified method\&. As an alternative, you can use the
mfang@12442 1967 \fB\-XX:CompileOnly\fR
mfang@12442 1968 option, which allows to specify several methods\&.
mfang@12442 1969 .RE
mfang@12442 1970 .PP
rgallard@8813 1971 dontinline
mfang@12442 1972 .RS 4
rgallard@8813 1973 Prevent inlining of the specified method\&.
mfang@12442 1974 .RE
mfang@12442 1975 .PP
rgallard@8813 1976 exclude
mfang@12442 1977 .RS 4
rgallard@8813 1978 Exclude the specified method from compilation\&.
mfang@12442 1979 .RE
mfang@12442 1980 .PP
rgallard@8813 1981 help
mfang@12442 1982 .RS 4
mfang@12442 1983 Print a help message for the
mfang@12442 1984 \fB\-XX:CompileCommand\fR
mfang@12442 1985 option\&.
mfang@12442 1986 .RE
mfang@12442 1987 .PP
rgallard@8813 1988 inline
mfang@12442 1989 .RS 4
rgallard@8813 1990 Attempt to inline the specified method\&.
mfang@12442 1991 .RE
mfang@12442 1992 .PP
rgallard@8813 1993 log
mfang@12442 1994 .RS 4
mfang@12442 1995 Exclude compilation logging (with the
mfang@12442 1996 \fB\-XX:+LogCompilation\fR
mfang@12442 1997 option) for all methods except for the specified method\&. By default, logging is performed for all compiled methods\&.
mfang@12442 1998 .RE
mfang@12442 1999 .PP
mfang@12442 2000 option
mfang@12442 2001 .RS 4
mfang@12442 2002 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
mfang@12442 2003 \fBBlockLayoutByFrequency\fR
mfang@12442 2004 option for the
mfang@12442 2005 \fBappend()\fR
mfang@12442 2006 method of the
mfang@12442 2007 \fBStringBuffer\fR
mfang@12442 2008 class, use the following:
mfang@12442 2009 .sp
mfang@12442 2010 .if n \{\
mfang@12442 2011 .RS 4
mfang@12442 2012 .\}
mfang@12442 2013 .nf
mfang@12442 2014 \fB\-XX:CompileCommand=option,java/lang/StringBuffer\&.append,BlockLayoutByFrequency\fR
mfang@12442 2015
mfang@12442 2016 .fi
mfang@12442 2017 .if n \{\
mfang@12442 2018 .RE
mfang@12442 2019 .\}
mfang@12442 2020 You can specify multiple compilation options, separated by commas or spaces\&.
mfang@12442 2021 .RE
mfang@12442 2022 .PP
rgallard@8813 2023 print
mfang@12442 2024 .RS 4
rgallard@8813 2025 Print generated assembler code after compilation of the specified method\&.
mfang@12442 2026 .RE
mfang@12442 2027 .PP
rgallard@8813 2028 quiet
mfang@12442 2029 .RS 4
mfang@12442 2030 Do not print the compile commands\&. By default, the commands that you specify with the \-\fBXX:CompileCommand\fR
mfang@12442 2031 option are printed; for example, if you exclude from compilation the
mfang@12442 2032 \fBindexOf()\fR
mfang@12442 2033 method of the
mfang@12442 2034 \fBString\fR
mfang@12442 2035 class, then the following will be printed to standard output:
mfang@12442 2036 .sp
mfang@12442 2037 .if n \{\
mfang@12442 2038 .RS 4
mfang@12442 2039 .\}
mfang@12442 2040 .nf
mfang@12442 2041 \fBCompilerOracle: exclude java/lang/String\&.indexOf\fR
mfang@12442 2042
mfang@12442 2043 .fi
mfang@12442 2044 .if n \{\
mfang@12442 2045 .RE
mfang@12442 2046 .\}
mfang@12442 2047 You can suppress this by specifying the
mfang@12442 2048 \fB\-XX:CompileCommand=quiet\fR
mfang@12442 2049 option before other
mfang@12442 2050 \fB\-XX:CompileCommand\fR
mfang@12442 2051 options\&.
mfang@12442 2052 .RE
mfang@12442 2053 .RE
mfang@12442 2054 .PP
mfang@12442 2055 \-XX:CompileCommandFile=\fIfilename\fR
mfang@12442 2056 .RS 4
mfang@12442 2057 Sets the file from which JIT compiler commands are read\&. By default, the
mfang@12442 2058 \fB\&.hotspot_compiler\fR
mfang@12442 2059 file is used to store commands performed by the JIT compiler\&.
mfang@12442 2060 .sp
mfang@12442 2061 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
mfang@12442 2062 \fBtoString()\fR
mfang@12442 2063 method of the
mfang@12442 2064 \fBString\fR
mfang@12442 2065 class:
mfang@12442 2066 .sp
mfang@12442 2067 .if n \{\
mfang@12442 2068 .RS 4
mfang@12442 2069 .\}
mfang@12442 2070 .nf
mfang@12442 2071 \fBprint java/lang/String toString\fR
mfang@12442 2072
mfang@12442 2073 .fi
mfang@12442 2074 .if n \{\
mfang@12442 2075 .RE
mfang@12442 2076 .\}
mfang@12442 2077 For more information about specifying the commands for the JIT compiler to perform on methods, see the
mfang@12442 2078 \fB\-XX:CompileCommand\fR
mfang@12442 2079 option\&.
mfang@12442 2080 .RE
mfang@12442 2081 .PP
mfang@12442 2082 \-XX:CompileOnly=\fImethods\fR
mfang@12442 2083 .RS 4
mfang@12442 2084 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
mfang@12442 2085 \fBlength()\fR
mfang@12442 2086 method of the
mfang@12442 2087 \fBString\fR
mfang@12442 2088 class and the
mfang@12442 2089 \fBsize()\fR
mfang@12442 2090 method of the
mfang@12442 2091 \fBList\fR
mfang@12442 2092 class, use the following:
mfang@12442 2093 .sp
mfang@12442 2094 .if n \{\
mfang@12442 2095 .RS 4
mfang@12442 2096 .\}
mfang@12442 2097 .nf
mfang@12442 2098 \fB\-XX:CompileOnly=java/lang/String\&.length,java/util/List\&.size\fR
mfang@12442 2099
mfang@12442 2100 .fi
mfang@12442 2101 .if n \{\
mfang@12442 2102 .RE
mfang@12442 2103 .\}
mfang@12442 2104 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
mfang@12442 2105 \fB\-XX:+PrintCompilation\fR
mfang@12442 2106 and
mfang@12442 2107 \fB\-XX:+LogCompilation\fR
mfang@12442 2108 options:
mfang@12442 2109 .sp
mfang@12442 2110 .if n \{\
mfang@12442 2111 .RS 4
mfang@12442 2112 .\}
mfang@12442 2113 .nf
mfang@12442 2114 \fB\-XX:CompileOnly=java\&.lang\&.String::length,java\&.util\&.List::size\fR
mfang@12442 2115
mfang@12442 2116 .fi
mfang@12442 2117 .if n \{\
mfang@12442 2118 .RE
mfang@12442 2119 .\}
mfang@12442 2120 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:
mfang@12442 2121 .sp
mfang@12442 2122 .if n \{\
mfang@12442 2123 .RS 4
mfang@12442 2124 .\}
mfang@12442 2125 .nf
mfang@12442 2126 \fB\-XX:CompileOnly=java/lang/String\fR
mfang@12442 2127 \fB\-XX:CompileOnly=java/lang\fR
mfang@12442 2128 \fB\-XX:CompileOnly=\&.length\fR
mfang@12442 2129
mfang@12442 2130 .fi
mfang@12442 2131 .if n \{\
mfang@12442 2132 .RE
mfang@12442 2133 .\}
mfang@12442 2134 .RE
mfang@12442 2135 .PP
mfang@12442 2136 \-XX:CompileThreshold=\fIinvocations\fR
mfang@12442 2137 .RS 4
mfang@12442 2138 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
mfang@12442 2139 \fB\-XX:+TieredCompilation\fR\&. The following example shows how to set the number of interpreted method invocations to 5,000:
mfang@12442 2140 .sp
mfang@12442 2141 .if n \{\
mfang@12442 2142 .RS 4
mfang@12442 2143 .\}
mfang@12442 2144 .nf
mfang@12442 2145 \fB\-XX:CompileThreshold=5000\fR
mfang@12442 2146
mfang@12442 2147 .fi
mfang@12442 2148 .if n \{\
mfang@12442 2149 .RE
mfang@12442 2150 .\}
mfang@12442 2151 You can completely disable interpretation of Java methods before compilation by specifying the
mfang@12442 2152 \fB\-Xcomp\fR
mfang@12442 2153 option\&.
mfang@12442 2154 .RE
mfang@12442 2155 .PP
mfang@12442 2156 \-XX:+DoEscapeAnalysis
mfang@12442 2157 .RS 4
mfang@12442 2158 Enables the use of escape analysis\&. This option is enabled by default\&. To disable the use of escape analysis, specify
mfang@12442 2159 \fB\-XX:\-DoEscapeAnalysis\fR\&. Only the Java HotSpot Server VM supports this option\&.
mfang@12442 2160 .RE
mfang@12442 2161 .PP
mfang@12442 2162 \-XX:InitialCodeCacheSize=\fIsize\fR
mfang@12442 2163 .RS 4
mfang@12442 2164 Sets the initial code cache size (in bytes)\&. Append the letter
mfang@12442 2165 \fBk\fR
mfang@12442 2166 or
mfang@12442 2167 \fBK\fR
mfang@12442 2168 to indicate kilobytes,
mfang@12442 2169 \fBm\fR
mfang@12442 2170 or
mfang@12442 2171 \fBM\fR
mfang@12442 2172 to indicate megabytes,
mfang@12442 2173 \fBg\fR
mfang@12442 2174 or
mfang@12442 2175 \fBG\fR
mfang@12442 2176 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:
mfang@12442 2177 .sp
mfang@12442 2178 .if n \{\
mfang@12442 2179 .RS 4
mfang@12442 2180 .\}
mfang@12442 2181 .nf
mfang@12442 2182 \fB\-XX:InitialCodeCacheSize=32k\fR
mfang@12442 2183
mfang@12442 2184 .fi
mfang@12442 2185 .if n \{\
mfang@12442 2186 .RE
mfang@12442 2187 .\}
mfang@12442 2188 .RE
mfang@12442 2189 .PP
mfang@12442 2190 \-XX:+Inline
mfang@12442 2191 .RS 4
mfang@12442 2192 Enables method inlining\&. This option is enabled by default to increase performance\&. To disable method inlining, specify
mfang@12442 2193 \fB\-XX:\-Inline\fR\&.
mfang@12442 2194 .RE
mfang@12442 2195 .PP
mfang@12442 2196 \-XX:InlineSmallCode=\fIsize\fR
mfang@12442 2197 .RS 4
mfang@12442 2198 Sets the maximum code size (in bytes) for compiled methods that should be inlined\&. Append the letter
mfang@12442 2199 \fBk\fR
mfang@12442 2200 or
mfang@12442 2201 \fBK\fR
mfang@12442 2202 to indicate kilobytes,
mfang@12442 2203 \fBm\fR
mfang@12442 2204 or
mfang@12442 2205 \fBM\fR
mfang@12442 2206 to indicate megabytes,
mfang@12442 2207 \fBg\fR
mfang@12442 2208 or
mfang@12442 2209 \fBG\fR
mfang@12442 2210 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:
mfang@12442 2211 .sp
mfang@12442 2212 .if n \{\
mfang@12442 2213 .RS 4
mfang@12442 2214 .\}
mfang@12442 2215 .nf
mfang@12442 2216 \fB\-XX:InlineSmallCode=1000\fR
mfang@12442 2217
mfang@12442 2218 .fi
mfang@12442 2219 .if n \{\
mfang@12442 2220 .RE
mfang@12442 2221 .\}
mfang@12442 2222 .RE
mfang@12442 2223 .PP
mfang@12442 2224 \-XX:+LogCompilation
mfang@12442 2225 .RS 4
mfang@12442 2226 Enables logging of compilation activity to a file named
mfang@12442 2227 \fBhotspot\&.log\fR
mfang@12442 2228 in the current working directory\&. You can specify a different log file path and name using the
mfang@12442 2229 \fB\-XX:LogFile\fR
mfang@12442 2230 option\&.
mfang@12442 2231 .sp
mfang@12442 2232 By default, this option is disabled and compilation activity is not logged\&. The
mfang@12442 2233 \fB\-XX:+LogCompilation\fR
mfang@12442 2234 option has to be used together with the
mfang@12442 2235 \fB\-XX:UnlockDiagnosticVMOptions\fR
mfang@12442 2236 option that unlocks diagnostic JVM options\&.
mfang@12442 2237 .sp
mfang@12442 2238 You can enable verbose diagnostic output with a message printed to the console every time a method is compiled by using the
mfang@12442 2239 \fB\-XX:+PrintCompilation\fR
mfang@12442 2240 option\&.
mfang@12442 2241 .RE
mfang@12442 2242 .PP
mfang@12442 2243 \-XX:MaxInlineSize=\fIsize\fR
mfang@12442 2244 .RS 4
mfang@12442 2245 Sets the maximum bytecode size (in bytes) of a method to be inlined\&. Append the letter
mfang@12442 2246 \fBk\fR
mfang@12442 2247 or
mfang@12442 2248 \fBK\fR
mfang@12442 2249 to indicate kilobytes,
mfang@12442 2250 \fBm\fR
mfang@12442 2251 or
mfang@12442 2252 \fBM\fR
mfang@12442 2253 to indicate megabytes,
mfang@12442 2254 \fBg\fR
mfang@12442 2255 or
mfang@12442 2256 \fBG\fR
mfang@12442 2257 to indicate gigabytes\&. By default, the maximum bytecode size is set to 35 bytes:
mfang@12442 2258 .sp
mfang@12442 2259 .if n \{\
mfang@12442 2260 .RS 4
mfang@12442 2261 .\}
mfang@12442 2262 .nf
mfang@12442 2263 \fB\-XX:MaxInlineSize=35\fR
mfang@12442 2264
mfang@12442 2265 .fi
mfang@12442 2266 .if n \{\
mfang@12442 2267 .RE
mfang@12442 2268 .\}
mfang@12442 2269 .RE
mfang@12442 2270 .PP
mfang@12442 2271 \-XX:MaxNodeLimit=\fInodes\fR
mfang@12442 2272 .RS 4
rgallard@8813 2273 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:
mfang@12442 2274 .sp
mfang@12442 2275 .if n \{\
mfang@12442 2276 .RS 4
mfang@12442 2277 .\}
mfang@12442 2278 .nf
mfang@12442 2279 \fB\-XX:MaxNodeLimit=65000\fR
mfang@12442 2280
mfang@12442 2281 .fi
mfang@12442 2282 .if n \{\
mfang@12442 2283 .RE
mfang@12442 2284 .\}
mfang@12442 2285 .RE
mfang@12442 2286 .PP
mfang@12442 2287 \-XX:MaxTrivialSize=\fIsize\fR
mfang@12442 2288 .RS 4
mfang@12442 2289 Sets the maximum bytecode size (in bytes) of a trivial method to be inlined\&. Append the letter
mfang@12442 2290 \fBk\fR
mfang@12442 2291 or
mfang@12442 2292 \fBK\fR
mfang@12442 2293 to indicate kilobytes,
mfang@12442 2294 \fBm\fR
mfang@12442 2295 or
mfang@12442 2296 \fBM\fR
mfang@12442 2297 to indicate megabytes,
mfang@12442 2298 \fBg\fR
mfang@12442 2299 or
mfang@12442 2300 \fBG\fR
mfang@12442 2301 to indicate gigabytes\&. By default, the maximum bytecode size of a trivial method is set to 6 bytes:
mfang@12442 2302 .sp
mfang@12442 2303 .if n \{\
mfang@12442 2304 .RS 4
mfang@12442 2305 .\}
mfang@12442 2306 .nf
mfang@12442 2307 \fB\-XX:MaxTrivialSize=6\fR
mfang@12442 2308
mfang@12442 2309 .fi
mfang@12442 2310 .if n \{\
mfang@12442 2311 .RE
mfang@12442 2312 .\}
mfang@12442 2313 .RE
mfang@12442 2314 .PP
mfang@12442 2315 \-XX:+OptimizeStringConcat
mfang@12442 2316 .RS 4
mfang@12442 2317 Enables the optimization of
mfang@12442 2318 \fBString\fR
mfang@12442 2319 concatenation operations\&. This option is enabled by default\&. To disable the optimization of
mfang@12442 2320 \fBString\fR
mfang@12442 2321 concatenation operations, specify
mfang@12442 2322 \fB\-XX:\-OptimizeStringConcat\fR\&. Only the Java HotSpot Server VM supports this option\&.
mfang@12442 2323 .RE
mfang@12442 2324 .PP
mfang@12442 2325 \-XX:+PrintAssembly
mfang@12442 2326 .RS 4
mfang@12442 2327 Enables printing of assembly code for bytecoded and native methods by using the external
mfang@12442 2328 \fBdisassembler\&.so\fR
mfang@12442 2329 library\&. This enables you to see the generated code, which may help you to diagnose performance issues\&.
mfang@12442 2330 .sp
mfang@12442 2331 By default, this option is disabled and assembly code is not printed\&. The
mfang@12442 2332 \fB\-XX:+PrintAssembly\fR
mfang@12442 2333 option has to be used together with the
mfang@12442 2334 \fB\-XX:UnlockDiagnosticVMOptions\fR
mfang@12442 2335 option that unlocks diagnostic JVM options\&.
mfang@12442 2336 .RE
mfang@12442 2337 .PP
mfang@12442 2338 \-XX:+PrintCompilation
mfang@12442 2339 .RS 4
rgallard@8813 2340 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\&.
mfang@12442 2341 .sp
mfang@12442 2342 You can also log compilation activity to a file by using the
mfang@12442 2343 \fB\-XX:+LogCompilation\fR
mfang@12442 2344 option\&.
mfang@12442 2345 .RE
mfang@12442 2346 .PP
mfang@12442 2347 \-XX:+PrintInlining
mfang@12442 2348 .RS 4
rgallard@8813 2349 Enables printing of inlining decisions\&. This enables you to see which methods are getting inlined\&.
mfang@12442 2350 .sp
mfang@12442 2351 By default, this option is disabled and inlining information is not printed\&. The
mfang@12442 2352 \fB\-XX:+PrintInlining\fR
mfang@12442 2353 option has to be used together with the
mfang@12442 2354 \fB\-XX:+UnlockDiagnosticVMOptions\fR
mfang@12442 2355 option that unlocks diagnostic JVM options\&.
mfang@12442 2356 .RE
mfang@12442 2357 .PP
mfang@12442 2358 \-XX:ReservedCodeCacheSize=\fIsize\fR
mfang@12442 2359 .RS 4
mfang@12442 2360 Sets the maximum code cache size (in bytes) for JIT\-compiled code\&. Append the letter
mfang@12442 2361 \fBk\fR
mfang@12442 2362 or
mfang@12442 2363 \fBK\fR
mfang@12442 2364 to indicate kilobytes,
mfang@12442 2365 \fBm\fR
mfang@12442 2366 or
mfang@12442 2367 \fBM\fR
mfang@12442 2368 to indicate megabytes,
mfang@12442 2369 \fBg\fR
mfang@12442 2370 or
mfang@12442 2371 \fBG\fR
mfang@12442 2372 to indicate gigabytes\&. The default maximum code cache size is 240 MB; if you disable tiered compilation with the option
mfang@12442 2373 \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
mfang@12442 2374 \fB\-XX:InitialCodeCacheSize\fR\&. This option is equivalent to
mfang@12442 2375 \fB\-Xmaxjitcodesize\fR\&.
mfang@12442 2376 .RE
mfang@12442 2377 .PP
mfang@12442 2378 \-XX:RTMAbortRatio=\fIabort_ratio\fR
mfang@12442 2379 .RS 4
mfang@12442 2380 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
mfang@12442 2381 \fB\-XX:+UseRTMDeopt\fR
mfang@12442 2382 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\&.
mfang@12442 2383 .RE
mfang@12442 2384 .PP
mfang@12442 2385 \-XX:RTMRetryCount=\fInumber_of_retries\fR
mfang@12442 2386 .RS 4
mfang@12442 2387 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
mfang@12442 2388 \fB\-XX:UseRTMLocking\fR
mfang@12442 2389 option must be enabled\&.
mfang@12442 2390 .RE
mfang@12442 2391 .PP
mfang@12442 2392 \-XX:\-TieredCompilation
mfang@12442 2393 .RS 4
mfang@12442 2394 Disables the use of tiered compilation\&. By default, this option is enabled\&. Only the Java HotSpot Server VM supports this option\&.
mfang@12442 2395 .RE
mfang@12442 2396 .PP
mfang@12442 2397 \-XX:+UseAES
mfang@12442 2398 .RS 4
mfang@12442 2399 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\&.
mfang@12442 2400 .RE
mfang@12442 2401 .PP
mfang@12442 2402 \-XX:+UseAESIntrinsics
mfang@12442 2403 .RS 4
mfang@12442 2404 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
mfang@12442 2405 \fB\-XX:\-UseAES \-XX:\-UseAESIntrinsics\fR\&. For example, to enable hardware AES, use the following flags:
mfang@12442 2406 .sp
mfang@12442 2407 .if n \{\
mfang@12442 2408 .RS 4
mfang@12442 2409 .\}
mfang@12442 2410 .nf
mfang@12442 2411 \fB\-XX:+UseAES \-XX:+UseAESIntrinsics\fR
mfang@12442 2412
mfang@12442 2413 .fi
mfang@12442 2414 .if n \{\
mfang@12442 2415 .RE
mfang@12442 2416 .\}
mfang@12442 2417 To support UseAES and UseAESIntrinsics flags for 32\-bit and 64\-bit use
mfang@12442 2418 \fB\-server\fR
mfang@12442 2419 option to choose Java HotSpot Server VM\&. These flags are not supported on Client VM\&.
mfang@12442 2420 .RE
mfang@12442 2421 .PP
mfang@12442 2422 \-XX:+UseCodeCacheFlushing
mfang@12442 2423 .RS 4
mfang@12442 2424 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
mfang@12442 2425 \fB\-XX:\-UseCodeCacheFlushing\fR\&.
mfang@12442 2426 .RE
mfang@12442 2427 .PP
mfang@12442 2428 \-XX:+UseCondCardMark
mfang@12442 2429 .RS 4
mfang@12442 2430 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\&.
mfang@12442 2431 .RE
mfang@12442 2432 .PP
mfang@12442 2433 \-XX:+UseRTMDeopt
mfang@12442 2434 .RS 4
mfang@12442 2435 Auto\-tunes RTM locking depending on the abort ratio\&. This ratio is specified by
mfang@12442 2436 \fB\-XX:RTMAbortRatio\fR
mfang@12442 2437 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
mfang@12442 2438 \fB\-XX:+UseRTMLocking\fR
mfang@12442 2439 option must be enabled\&.
mfang@12442 2440 .RE
mfang@12442 2441 .PP
mfang@12442 2442 \-XX:+UseRTMLocking
mfang@12442 2443 .RS 4
mfang@12442 2444 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)\&.
mfang@12442 2445 .sp
mfang@12442 2446 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
mfang@12442 2447 \fBXBEGIN\fR,
mfang@12442 2448 \fBXABORT\fR,
mfang@12442 2449 \fBXEND\fR, and
mfang@12442 2450 \fBXTEST\fR\&. The
mfang@12442 2451 \fBXBEGIN\fR
mfang@12442 2452 and
mfang@12442 2453 \fBXEND\fR
mfang@12442 2454 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
mfang@12442 2455 \fBXEND\fR
mfang@12442 2456 instruction\&. The
mfang@12442 2457 \fBXABORT\fR
mfang@12442 2458 instruction can be used to explicitly abort a transaction and the
mfang@12442 2459 \fBXEND\fR
mfang@12442 2460 instruction to check if a set of instructions are being run in a transaction\&.
mfang@12442 2461 .sp
mfang@12442 2462 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\&.
mfang@12442 2463 .sp
mfang@12442 2464 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\&.
mfang@12442 2465 .RE
mfang@12442 2466 .PP
mfang@12442 2467 \-XX:+UseSHA
mfang@12442 2468 .RS 4
mfang@12442 2469 Enables hardware\-based intrinsics for SHA crypto hash functions for SPARC hardware\&.
mfang@12442 2470 \fBUseSHA\fR
mfang@12442 2471 is used in conjunction with the
mfang@12442 2472 \fBUseSHA1Intrinsics\fR,
mfang@12442 2473 \fBUseSHA256Intrinsics\fR, and
mfang@12442 2474 \fBUseSHA512Intrinsics\fR
mfang@12442 2475 options\&.
mfang@12442 2476 .sp
mfang@12442 2477 The
mfang@12442 2478 \fBUseSHA\fR
mfang@12442 2479 and
mfang@12442 2480 \fBUseSHA*Intrinsics\fR
mfang@12442 2481 flags are enabled by default, and are supported only for Java HotSpot Server VM 64\-bit on SPARC T4 and newer\&.
mfang@12442 2482 .sp
mfang@12442 2483 This feature is only applicable when using the
mfang@12442 2484 \fBsun\&.security\&.provider\&.Sun\fR
mfang@12442 2485 provider for SHA operations\&.
mfang@12442 2486 .sp
mfang@12442 2487 To disable all hardware\-based SHA intrinsics, specify
mfang@12442 2488 \fB\-XX:\-UseSHA\fR\&. To disable only a particular SHA intrinsic, use the appropriate corresponding option\&. For example:
mfang@12442 2489 \fB\-XX:\-UseSHA256Intrinsics\fR\&.
mfang@12442 2490 .RE
mfang@12442 2491 .PP
mfang@12442 2492 \-XX:+UseSHA1Intrinsics
mfang@12442 2493 .RS 4
mfang@12442 2494 Enables intrinsics for SHA\-1 crypto hash function\&.
mfang@12442 2495 .RE
mfang@12442 2496 .PP
mfang@12442 2497 \-XX:+UseSHA256Intrinsics
mfang@12442 2498 .RS 4
mfang@12442 2499 Enables intrinsics for SHA\-224 and SHA\-256 crypto hash functions\&.
mfang@12442 2500 .RE
mfang@12442 2501 .PP
mfang@12442 2502 \-XX:+UseSHA512Intrinsics
mfang@12442 2503 .RS 4
mfang@12442 2504 Enables intrinsics for SHA\-384 and SHA\-512 crypto hash functions\&.
mfang@12442 2505 .RE
mfang@12442 2506 .PP
mfang@12442 2507 \-XX:+UseSuperWord
mfang@12442 2508 .RS 4
mfang@12442 2509 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
mfang@12442 2510 \fB\-XX:\-UseSuperWord\fR\&. Only the Java HotSpot Server VM supports this option\&.
mfang@12442 2511 .RE
mfang@12442 2512 .SS "Advanced Serviceability Options"
mfang@12442 2513 .PP
rgallard@8813 2514 These options provide the ability to gather system information and perform extensive debugging\&.
mfang@12442 2515 .PP
mfang@12442 2516 \-XX:+ExtendedDTraceProbes
mfang@12442 2517 .RS 4
mfang@12442 2518 Enables additional
mfang@12442 2519 \fBdtrace\fR
mfang@12442 2520 tool probes that impact the performance\&. By default, this option is disabled and
mfang@12442 2521 \fBdtrace\fR
mfang@12442 2522 performs only standard probes\&.
mfang@12442 2523 .RE
mfang@12442 2524 .PP
mfang@12442 2525 \-XX:+HeapDumpOnOutOfMemory
mfang@12442 2526 .RS 4
mfang@12442 2527 Enables the dumping of the Java heap to a file in the current directory by using the heap profiler (HPROF) when a
mfang@12442 2528 \fBjava\&.lang\&.OutOfMemoryError\fR
mfang@12442 2529 exception is thrown\&. You can explicitly set the heap dump file path and name using the
mfang@12442 2530 \fB\-XX:HeapDumpPath\fR
mfang@12442 2531 option\&. By default, this option is disabled and the heap is not dumped when an
mfang@12442 2532 \fBOutOfMemoryError\fR
mfang@12442 2533 exception is thrown\&.
mfang@12442 2534 .RE
mfang@12442 2535 .PP
mfang@12442 2536 \-XX:HeapDumpPath=\fIpath\fR
mfang@12442 2537 .RS 4
mfang@12442 2538 Sets the path and file name for writing the heap dump provided by the heap profiler (HPROF) when the
mfang@12442 2539 \fB\-XX:+HeapDumpOnOutOfMemoryError\fR
mfang@12442 2540 option is set\&. By default, the file is created in the current working directory, and it is named
mfang@12442 2541 \fBjava_pid\fR\fIpid\fR\fB\&.hprof\fR
mfang@12442 2542 where
mfang@12442 2543 \fIpid\fR
mfang@12442 2544 is the identifier of the process that caused the error\&. The following example shows how to set the default file explicitly (\fB%p\fR
mfang@12442 2545 represents the current process identificator):
mfang@12442 2546 .sp
mfang@12442 2547 .if n \{\
mfang@12442 2548 .RS 4
mfang@12442 2549 .\}
mfang@12442 2550 .nf
mfang@12442 2551 \fB\-XX:HeapDumpPath=\&./java_pid%p\&.hprof\fR
mfang@12442 2552
mfang@12442 2553 .fi
mfang@12442 2554 .if n \{\
mfang@12442 2555 .RE
mfang@12442 2556 .\}
mfang@12442 2557 The following example shows how to set the heap dump file to
mfang@12442 2558 \fB/var/log/java/java_heapdump\&.hprof\fR:
mfang@12442 2559 .sp
mfang@12442 2560 .if n \{\
mfang@12442 2561 .RS 4
mfang@12442 2562 .\}
mfang@12442 2563 .nf
mfang@12442 2564 \fB\-XX:HeapDumpPath=/var/log/java/java_heapdump\&.hprof\fR
mfang@12442 2565
mfang@12442 2566 .fi
mfang@12442 2567 .if n \{\
mfang@12442 2568 .RE
mfang@12442 2569 .\}
mfang@12442 2570 .RE
mfang@12442 2571 .PP
mfang@12442 2572 \-XX:LogFile=\fIpath\fR
mfang@12442 2573 .RS 4
mfang@12442 2574 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
mfang@12442 2575 \fBhotspot\&.log\fR\&.
mfang@12442 2576 .sp
mfang@12442 2577 The following example shows how to set the log file to
mfang@12442 2578 \fB/var/log/java/hotspot\&.log\fR:
mfang@12442 2579 .sp
mfang@12442 2580 .if n \{\
mfang@12442 2581 .RS 4
mfang@12442 2582 .\}
mfang@12442 2583 .nf
mfang@12442 2584 \fB\-XX:LogFile=/var/log/java/hotspot\&.log\fR
mfang@12442 2585
mfang@12442 2586 .fi
mfang@12442 2587 .if n \{\
mfang@12442 2588 .RE
mfang@12442 2589 .\}
mfang@12442 2590 .RE
mfang@12442 2591 .PP
mfang@12442 2592 \-XX:+PrintClassHistogram
mfang@12442 2593 .RS 4
mfang@12442 2594 Enables printing of a class instance histogram after a
mfang@12442 2595 \fBControl+C\fR
mfang@12442 2596 event (\fBSIGTERM\fR)\&. By default, this option is disabled\&.
mfang@12442 2597 .sp
mfang@12442 2598 Setting this option is equivalent to running the
mfang@12442 2599 \fBjmap \-histo\fR
mfang@12442 2600 command, or the
mfang@12442 2601 \fBjcmd \fR\fIpid\fR\fB GC\&.class_histogram\fR
mfang@12442 2602 command, where
mfang@12442 2603 \fIpid\fR
mfang@12442 2604 is the current Java process identifier\&.
mfang@12442 2605 .RE
mfang@12442 2606 .PP
mfang@12442 2607 \-XX:+PrintConcurrentLocks
mfang@12442 2608 .RS 4
mfang@12442 2609 Enables printing of locks after a event\&. By default, this option is disabled\&.
mfang@12442 2610 .sp
mfang@12442 2611 Enables printing of
mfang@12442 2612 \fBjava\&.util\&.concurrent\fR
mfang@12442 2613 locks after a
mfang@12442 2614 \fBControl+C\fR
mfang@12442 2615 event (\fBSIGTERM\fR)\&. By default, this option is disabled\&.
mfang@12442 2616 .sp
mfang@12442 2617 Setting this option is equivalent to running the
mfang@12442 2618 \fBjstack \-l\fR
mfang@12442 2619 command or the
mfang@12442 2620 \fBjcmd \fR\fIpid\fR\fB Thread\&.print \-l\fR
mfang@12442 2621 command, where
mfang@12442 2622 \fIpid\fR
mfang@12442 2623 is the current Java process identifier\&.
mfang@12442 2624 .RE
mfang@12442 2625 .PP
mfang@12442 2626 \-XX:+UnlockDiagnosticVMOptions
mfang@12442 2627 .RS 4
rgallard@8813 2628 Unlocks the options intended for diagnosing the JVM\&. By default, this option is disabled and diagnostic options are not available\&.
mfang@12442 2629 .RE
mfang@12442 2630 .SS "Advanced Garbage Collection Options"
mfang@12442 2631 .PP
rgallard@8813 2632 These options control how garbage collection (GC) is performed by the Java HotSpot VM\&.
mfang@12442 2633 .PP
mfang@12442 2634 \-XX:+AggressiveHeap
mfang@12442 2635 .RS 4
mfang@12442 2636 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\&.
mfang@12442 2637 .RE
mfang@12442 2638 .PP
mfang@12442 2639 \-XX:+AlwaysPreTouch
mfang@12442 2640 .RS 4
mfang@12442 2641 Enables touching of every page on the Java heap during JVM initialization\&. This gets all pages into the memory before entering the
mfang@12442 2642 \fBmain()\fR
mfang@12442 2643 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\&.
mfang@12442 2644 .RE
mfang@12442 2645 .PP
mfang@12442 2646 \-XX:+CMSClassUnloadingEnabled
mfang@12442 2647 .RS 4
mfang@12442 2648 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
mfang@12442 2649 \fB\-XX:\-CMSClassUnloadingEnabled\fR\&.
mfang@12442 2650 .RE
mfang@12442 2651 .PP
mfang@12442 2652 \-XX:CMSExpAvgFactor=\fIpercent\fR
mfang@12442 2653 .RS 4
rgallard@8813 2654 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%:
mfang@12442 2655 .sp
mfang@12442 2656 .if n \{\
mfang@12442 2657 .RS 4
mfang@12442 2658 .\}
mfang@12442 2659 .nf
mfang@12442 2660 \fB\-XX:CMSExpAvgFactor=15\fR
mfang@12442 2661
mfang@12442 2662 .fi
mfang@12442 2663 .if n \{\
mfang@12442 2664 .RE
mfang@12442 2665 .\}
mfang@12442 2666 .RE
mfang@12442 2667 .PP
mfang@12442 2668 \-XX:CMSInitiatingOccupancyFraction=\fIpercent\fR
mfang@12442 2669 .RS 4
mfang@12442 2670 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
mfang@12442 2671 \fB\-XX:CMSTriggerRatio\fR
mfang@12442 2672 is used to define the value of the initiating occupancy fraction\&.
mfang@12442 2673 .sp
rgallard@8813 2674 The following example shows how to set the occupancy fraction to 20%:
mfang@12442 2675 .sp
mfang@12442 2676 .if n \{\
mfang@12442 2677 .RS 4
mfang@12442 2678 .\}
mfang@12442 2679 .nf
mfang@12442 2680 \fB\-XX:CMSInitiatingOccupancyFraction=20\fR
mfang@12442 2681
mfang@12442 2682 .fi
mfang@12442 2683 .if n \{\
mfang@12442 2684 .RE
mfang@12442 2685 .\}
mfang@12442 2686 .RE
mfang@12442 2687 .PP
mfang@12442 2688 \-XX:+CMSScavengeBeforeRemark
mfang@12442 2689 .RS 4
rgallard@8813 2690 Enables scavenging attempts before the CMS remark step\&. By default, this option is disabled\&.
mfang@12442 2691 .RE
mfang@12442 2692 .PP
mfang@12442 2693 \-XX:CMSTriggerRatio=\fIpercent\fR
mfang@12442 2694 .RS 4
mfang@12442 2695 Sets the percentage (0 to 100) of the value specified by
mfang@12442 2696 \fB\-XX:MinHeapFreeRatio\fR
mfang@12442 2697 that is allocated before a CMS collection cycle commences\&. The default value is set to 80%\&.
mfang@12442 2698 .sp
rgallard@8813 2699 The following example shows how to set the occupancy fraction to 75%:
mfang@12442 2700 .sp
mfang@12442 2701 .if n \{\
mfang@12442 2702 .RS 4
mfang@12442 2703 .\}
mfang@12442 2704 .nf
mfang@12442 2705 \fB\-XX:CMSTriggerRatio=75\fR
mfang@12442 2706
mfang@12442 2707 .fi
mfang@12442 2708 .if n \{\
mfang@12442 2709 .RE
mfang@12442 2710 .\}
mfang@12442 2711 .RE
mfang@12442 2712 .PP
mfang@12442 2713 \-XX:ConcGCThreads=\fIthreads\fR
mfang@12442 2714 .RS 4
rgallard@8813 2715 Sets the number of threads used for concurrent GC\&. The default value depends on the number of CPUs available to the JVM\&.
mfang@12442 2716 .sp
rgallard@8813 2717 For example, to set the number of threads for concurrent GC to 2, specify the following option:
mfang@12442 2718 .sp
mfang@12442 2719 .if n \{\
mfang@12442 2720 .RS 4
mfang@12442 2721 .\}
mfang@12442 2722 .nf
mfang@12442 2723 \fB\-XX:ConcGCThreads=2\fR
mfang@12442 2724
mfang@12442 2725 .fi
mfang@12442 2726 .if n \{\
mfang@12442 2727 .RE
mfang@12442 2728 .\}
mfang@12442 2729 .RE
mfang@12442 2730 .PP
mfang@12442 2731 \-XX:+DisableExplicitGC
mfang@12442 2732 .RS 4
mfang@12442 2733 Enables the option that disables processing of calls to
mfang@12442 2734 \fBSystem\&.gc()\fR\&. This option is disabled by default, meaning that calls to
mfang@12442 2735 \fBSystem\&.gc()\fR
mfang@12442 2736 are processed\&. If processing of calls to
mfang@12442 2737 \fBSystem\&.gc()\fR
mfang@12442 2738 is disabled, the JVM still performs GC when necessary\&.
mfang@12442 2739 .RE
mfang@12442 2740 .PP
mfang@12442 2741 \-XX:+ExplicitGCInvokesConcurrent
mfang@12442 2742 .RS 4
mfang@12442 2743 Enables invoking of concurrent GC by using the
mfang@12442 2744 \fBSystem\&.gc()\fR
mfang@12442 2745 request\&. This option is disabled by default and can be enabled only together with the
mfang@12442 2746 \fB\-XX:+UseConcMarkSweepGC\fR
mfang@12442 2747 option\&.
mfang@12442 2748 .RE
mfang@12442 2749 .PP
mfang@12442 2750 \-XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses
mfang@12442 2751 .RS 4
mfang@12442 2752 Enables invoking of concurrent GC by using the
mfang@12442 2753 \fBSystem\&.gc()\fR
mfang@12442 2754 request and unloading of classes during the concurrent GC cycle\&. This option is disabled by default and can be enabled only together with the
mfang@12442 2755 \fB\-XX:+UseConcMarkSweepGC\fR
mfang@12442 2756 option\&.
mfang@12442 2757 .RE
mfang@12442 2758 .PP
mfang@12442 2759 \-XX:G1HeapRegionSize=\fIsize\fR
mfang@12442 2760 .RS 4
mfang@12442 2761 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\&.
mfang@12442 2762 .sp
rgallard@8813 2763 The following example shows how to set the size of the subdivisions to 16 MB:
mfang@12442 2764 .sp
mfang@12442 2765 .if n \{\
mfang@12442 2766 .RS 4
mfang@12442 2767 .\}
mfang@12442 2768 .nf
mfang@12442 2769 \fB\-XX:G1HeapRegionSize=16m\fR
mfang@12442 2770
mfang@12442 2771 .fi
mfang@12442 2772 .if n \{\
mfang@12442 2773 .RE
mfang@12442 2774 .\}
mfang@12442 2775 .RE
mfang@12442 2776 .PP
mfang@12442 2777 \-XX:+G1PrintHeapRegions
mfang@12442 2778 .RS 4
rgallard@8813 2779 Enables the printing of information about which regions are allocated and which are reclaimed by the G1 collector\&. By default, this option is disabled\&.
mfang@12442 2780 .RE
mfang@12442 2781 .PP
mfang@12442 2782 \-XX:G1ReservePercent=\fIpercent\fR
mfang@12442 2783 .RS 4
rgallard@8813 2784 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%\&.
mfang@12442 2785 .sp
rgallard@8813 2786 The following example shows how to set the reserved heap to 20%:
mfang@12442 2787 .sp
mfang@12442 2788 .if n \{\
mfang@12442 2789 .RS 4
mfang@12442 2790 .\}
mfang@12442 2791 .nf
mfang@12442 2792 \fB\-XX:G1ReservePercent=20\fR
mfang@12442 2793
mfang@12442 2794 .fi
mfang@12442 2795 .if n \{\
mfang@12442 2796 .RE
mfang@12442 2797 .\}
mfang@12442 2798 .RE
mfang@12442 2799 .PP
mfang@12442 2800 \-XX:InitialHeapSize=\fIsize\fR
mfang@12442 2801 .RS 4
mfang@12442 2802 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
mfang@12442 2803 \fBk\fR
mfang@12442 2804 or
mfang@12442 2805 \fBK\fR
mfang@12442 2806 to indicate kilobytes,
mfang@12442 2807 \fBm\fR
mfang@12442 2808 or
mfang@12442 2809 \fBM\fR
mfang@12442 2810 to indicate megabytes,
mfang@12442 2811 \fBg\fR
mfang@12442 2812 or
mfang@12442 2813 \fBG\fR
mfang@12442 2814 to indicate gigabytes\&. The default value is chosen at runtime based on system configuration\&. See the section "Ergonomics" in
mfang@12442 2815 \fIJava SE HotSpot Virtual Machine Garbage Collection Tuning Guide\fR
mfang@12442 2816 at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gctuning/index\&.html\&.
mfang@12442 2817 .sp
rgallard@8813 2818 The following examples show how to set the size of allocated memory to 6 MB using various units:
mfang@12442 2819 .sp
mfang@12442 2820 .if n \{\
mfang@12442 2821 .RS 4
mfang@12442 2822 .\}
mfang@12442 2823 .nf
mfang@12442 2824 \fB\-XX:InitialHeapSize=6291456\fR
mfang@12442 2825 \fB\-XX:InitialHeapSize=6144k\fR
mfang@12442 2826 \fB\-XX:InitialHeapSize=6m\fR
mfang@12442 2827
mfang@12442 2828 .fi
mfang@12442 2829 .if n \{\
mfang@12442 2830 .RE
mfang@12442 2831 .\}
mfang@12442 2832 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
mfang@12442 2833 \fB\-XX:NewSize\fR
mfang@12442 2834 option\&.
mfang@12442 2835 .RE
mfang@12442 2836 .PP
mfang@12442 2837 \-XX:InitialSurvivorRatio=\fIratio\fR
mfang@12442 2838 .RS 4
mfang@12442 2839 Sets the initial survivor space ratio used by the throughput garbage collector (which is enabled by the
mfang@12442 2840 \fB\-XX:+UseParallelGC\fR
mfang@12442 2841 and/or \-\fBXX:+UseParallelOldGC\fR
mfang@12442 2842 options)\&. Adaptive sizing is enabled by default with the throughput garbage collector by using the
mfang@12442 2843 \fB\-XX:+UseParallelGC\fR
mfang@12442 2844 and
mfang@12442 2845 \fB\-XX:+UseParallelOldGC\fR
mfang@12442 2846 options, and survivor space is resized according to the application behavior, starting with the initial value\&. If adaptive sizing is disabled (using the
mfang@12442 2847 \fB\-XX:\-UseAdaptiveSizePolicy\fR
mfang@12442 2848 option), then the
mfang@12442 2849 \fB\-XX:SurvivorRatio\fR
mfang@12442 2850 option should be used to set the size of the survivor space for the entire execution of the application\&.
mfang@12442 2851 .sp
rgallard@8813 2852 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):
mfang@12442 2853 .sp
mfang@12442 2854 .if n \{\
mfang@12442 2855 .RS 4
mfang@12442 2856 .\}
mfang@12442 2857 .nf
mfang@12442 2858 \fBS=Y/(R+2)\fR
mfang@12442 2859
mfang@12442 2860 .fi
mfang@12442 2861 .if n \{\
mfang@12442 2862 .RE
mfang@12442 2863 .\}
rgallard@8813 2864 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\&.
mfang@12442 2865 .sp
rgallard@8813 2866 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\&.
mfang@12442 2867 .sp
rgallard@8813 2868 The following example shows how to set the initial survivor space ratio to 4:
mfang@12442 2869 .sp
mfang@12442 2870 .if n \{\
mfang@12442 2871 .RS 4
mfang@12442 2872 .\}
mfang@12442 2873 .nf
mfang@12442 2874 \fB\-XX:InitialSurvivorRatio=4\fR
mfang@12442 2875
mfang@12442 2876 .fi
mfang@12442 2877 .if n \{\
mfang@12442 2878 .RE
mfang@12442 2879 .\}
mfang@12442 2880 .RE
mfang@12442 2881 .PP
mfang@12442 2882 \-XX:InitiatingHeapOccupancyPercent=\fIpercent\fR
mfang@12442 2883 .RS 4
rgallard@8813 2884 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)\&.
mfang@12442 2885 .sp
rgallard@8813 2886 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%:
mfang@12442 2887 .sp
mfang@12442 2888 .if n \{\
mfang@12442 2889 .RS 4
mfang@12442 2890 .\}
mfang@12442 2891 .nf
mfang@12442 2892 \fB\-XX:InitiatingHeapOccupancyPercent=75\fR
mfang@12442 2893
mfang@12442 2894 .fi
mfang@12442 2895 .if n \{\
mfang@12442 2896 .RE
mfang@12442 2897 .\}
mfang@12442 2898 .RE
mfang@12442 2899 .PP
mfang@12442 2900 \-XX:MaxGCPauseMillis=\fItime\fR
mfang@12442 2901 .RS 4
rgallard@8813 2902 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\&.
mfang@12442 2903 .sp
rgallard@8813 2904 The following example shows how to set the maximum target pause time to 500 ms:
mfang@12442 2905 .sp
mfang@12442 2906 .if n \{\
mfang@12442 2907 .RS 4
mfang@12442 2908 .\}
mfang@12442 2909 .nf
mfang@12442 2910 \fB\-XX:MaxGCPauseMillis=500\fR
mfang@12442 2911
mfang@12442 2912 .fi
mfang@12442 2913 .if n \{\
mfang@12442 2914 .RE
mfang@12442 2915 .\}
mfang@12442 2916 .RE
mfang@12442 2917 .PP
mfang@12442 2918 \-XX:MaxHeapSize=\fIsize\fR
mfang@12442 2919 .RS 4
mfang@12442 2920 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
mfang@12442 2921 \fBk\fR
mfang@12442 2922 or
mfang@12442 2923 \fBK\fR
mfang@12442 2924 to indicate kilobytes,
mfang@12442 2925 \fBm\fR
mfang@12442 2926 or
mfang@12442 2927 \fBM\fR
mfang@12442 2928 to indicate megabytes,
mfang@12442 2929 \fBg\fR
mfang@12442 2930 or
mfang@12442 2931 \fBG\fR
mfang@12442 2932 to indicate gigabytes\&. The default value is chosen at runtime based on system configuration\&. For server deployments,
mfang@12442 2933 \fB\-XX:InitialHeapSize\fR
mfang@12442 2934 and
mfang@12442 2935 \fB\-XX:MaxHeapSize\fR
mfang@12442 2936 are often set to the same value\&. See the section "Ergonomics" in
mfang@12442 2937 \fIJava SE HotSpot Virtual Machine Garbage Collection Tuning Guide\fR
mfang@12442 2938 at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gctuning/index\&.html\&.
mfang@12442 2939 .sp
rgallard@8813 2940 The following examples show how to set the maximum allowed size of allocated memory to 80 MB using various units:
mfang@12442 2941 .sp
mfang@12442 2942 .if n \{\
mfang@12442 2943 .RS 4
mfang@12442 2944 .\}
mfang@12442 2945 .nf
mfang@12442 2946 \fB\-XX:MaxHeapSize=83886080\fR
mfang@12442 2947 \fB\-XX:MaxHeapSize=81920k\fR
mfang@12442 2948 \fB\-XX:MaxHeapSize=80m\fR
mfang@12442 2949
mfang@12442 2950 .fi
mfang@12442 2951 .if n \{\
mfang@12442 2952 .RE
mfang@12442 2953 .\}
rgallard@8813 2954 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\&.
mfang@12442 2955 .sp
mfang@12442 2956 The
mfang@12442 2957 \fB\-XX:MaxHeapSize\fR
mfang@12442 2958 option is equivalent to
mfang@12442 2959 \fB\-Xmx\fR\&.
mfang@12442 2960 .RE
mfang@12442 2961 .PP
mfang@12442 2962 \-XX:MaxHeapFreeRatio=\fIpercent\fR
mfang@12442 2963 .RS 4
rgallard@8813 2964 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%\&.
mfang@12442 2965 .sp
rgallard@8813 2966 The following example shows how to set the maximum free heap ratio to 75%:
mfang@12442 2967 .sp
mfang@12442 2968 .if n \{\
mfang@12442 2969 .RS 4
mfang@12442 2970 .\}
mfang@12442 2971 .nf
mfang@12442 2972 \fB\-XX:MaxHeapFreeRatio=75\fR
mfang@12442 2973
mfang@12442 2974 .fi
mfang@12442 2975 .if n \{\
mfang@12442 2976 .RE
mfang@12442 2977 .\}
mfang@12442 2978 .RE
mfang@12442 2979 .PP
mfang@12442 2980 \-XX:MaxMetaspaceSize=\fIsize\fR
mfang@12442 2981 .RS 4
rgallard@8813 2982 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\&.
mfang@12442 2983 .sp
rgallard@8813 2984 The following example shows how to set the maximum class metadata size to 256 MB:
mfang@12442 2985 .sp
mfang@12442 2986 .if n \{\
mfang@12442 2987 .RS 4
mfang@12442 2988 .\}
mfang@12442 2989 .nf
mfang@12442 2990 \fB\-XX:MaxMetaspaceSize=256m\fR
mfang@12442 2991
mfang@12442 2992 .fi
mfang@12442 2993 .if n \{\
mfang@12442 2994 .RE
mfang@12442 2995 .\}
mfang@12442 2996 .RE
mfang@12442 2997 .PP
mfang@12442 2998 \-XX:MaxNewSize=\fIsize\fR
mfang@12442 2999 .RS 4
rgallard@8813 3000 Sets the maximum size (in bytes) of the heap for the young generation (nursery)\&. The default value is set ergonomically\&.
mfang@12442 3001 .RE
mfang@12442 3002 .PP
mfang@12442 3003 \-XX:MaxTenuringThreshold=\fIthreshold\fR
mfang@12442 3004 .RS 4
rgallard@8813 3005 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\&.
mfang@12442 3006 .sp
rgallard@8813 3007 The following example shows how to set the maximum tenuring threshold to 10:
mfang@12442 3008 .sp
mfang@12442 3009 .if n \{\
mfang@12442 3010 .RS 4
mfang@12442 3011 .\}
mfang@12442 3012 .nf
mfang@12442 3013 \fB\-XX:MaxTenuringThreshold=10\fR
mfang@12442 3014
mfang@12442 3015 .fi
mfang@12442 3016 .if n \{\
mfang@12442 3017 .RE
mfang@12442 3018 .\}
mfang@12442 3019 .RE
mfang@12442 3020 .PP
mfang@12442 3021 \-XX:MetaspaceSize=\fIsize\fR
mfang@12442 3022 .RS 4
rgallard@8813 3023 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\&.
mfang@12442 3024 .RE
mfang@12442 3025 .PP
mfang@12442 3026 \-XX:MinHeapFreeRatio=\fIpercent\fR
mfang@12442 3027 .RS 4
rgallard@8813 3028 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%\&.
mfang@12442 3029 .sp
rgallard@8813 3030 The following example shows how to set the minimum free heap ratio to 25%:
mfang@12442 3031 .sp
mfang@12442 3032 .if n \{\
mfang@12442 3033 .RS 4
mfang@12442 3034 .\}
mfang@12442 3035 .nf
mfang@12442 3036 \fB\-XX:MinHeapFreeRatio=25\fR
mfang@12442 3037
mfang@12442 3038 .fi
mfang@12442 3039 .if n \{\
mfang@12442 3040 .RE
mfang@12442 3041 .\}
mfang@12442 3042 .RE
mfang@12442 3043 .PP
mfang@12442 3044 \-XX:NewRatio=\fIratio\fR
mfang@12442 3045 .RS 4
rgallard@8813 3046 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:
mfang@12442 3047 .sp
mfang@12442 3048 .if n \{\
mfang@12442 3049 .RS 4
mfang@12442 3050 .\}
mfang@12442 3051 .nf
mfang@12442 3052 \fB\-XX:NewRatio=1\fR
mfang@12442 3053
mfang@12442 3054 .fi
mfang@12442 3055 .if n \{\
mfang@12442 3056 .RE
mfang@12442 3057 .\}
mfang@12442 3058 .RE
mfang@12442 3059 .PP
mfang@12442 3060 \-XX:NewSize=\fIsize\fR
mfang@12442 3061 .RS 4
mfang@12442 3062 Sets the initial size (in bytes) of the heap for the young generation (nursery)\&. Append the letter
mfang@12442 3063 \fBk\fR
mfang@12442 3064 or
mfang@12442 3065 \fBK\fR
mfang@12442 3066 to indicate kilobytes,
mfang@12442 3067 \fBm\fR
mfang@12442 3068 or
mfang@12442 3069 \fBM\fR
mfang@12442 3070 to indicate megabytes,
mfang@12442 3071 \fBg\fR
mfang@12442 3072 or
mfang@12442 3073 \fBG\fR
mfang@12442 3074 to indicate gigabytes\&.
mfang@12442 3075 .sp
rgallard@8813 3076 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\&.
mfang@12442 3077 .sp
rgallard@8813 3078 The following examples show how to set the initial size of young generation to 256 MB using various units:
mfang@12442 3079 .sp
mfang@12442 3080 .if n \{\
mfang@12442 3081 .RS 4
mfang@12442 3082 .\}
mfang@12442 3083 .nf
mfang@12442 3084 \fB\-XX:NewSize=256m\fR
mfang@12442 3085 \fB\-XX:NewSize=262144k\fR
mfang@12442 3086 \fB\-XX:NewSize=268435456\fR
mfang@12442 3087
mfang@12442 3088 .fi
mfang@12442 3089 .if n \{\
mfang@12442 3090 .RE
mfang@12442 3091 .\}
mfang@12442 3092 The
mfang@12442 3093 \fB\-XX:NewSize\fR
mfang@12442 3094 option is equivalent to
mfang@12442 3095 \fB\-Xmn\fR\&.
mfang@12442 3096 .RE
mfang@12442 3097 .PP
mfang@12442 3098 \-XX:ParallelGCThreads=\fIthreads\fR
mfang@12442 3099 .RS 4
rgallard@8813 3100 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\&.
mfang@12442 3101 .sp
rgallard@8813 3102 For example, to set the number of threads for parallel GC to 2, specify the following option:
mfang@12442 3103 .sp
mfang@12442 3104 .if n \{\
mfang@12442 3105 .RS 4
mfang@12442 3106 .\}
mfang@12442 3107 .nf
mfang@12442 3108 \fB\-XX:ParallelGCThreads=2\fR
mfang@12442 3109
mfang@12442 3110 .fi
mfang@12442 3111 .if n \{\
mfang@12442 3112 .RE
mfang@12442 3113 .\}
mfang@12442 3114 .RE
mfang@12442 3115 .PP
mfang@12442 3116 \-XX:+ParallelRefProcEnabled
mfang@12442 3117 .RS 4
rgallard@8813 3118 Enables parallel reference processing\&. By default, this option is disabled\&.
mfang@12442 3119 .RE
mfang@12442 3120 .PP
mfang@12442 3121 \-XX:+PrintAdaptiveSizePolicy
mfang@12442 3122 .RS 4
rgallard@8813 3123 Enables printing of information about adaptive generation sizing\&. By default, this option is disabled\&.
mfang@12442 3124 .RE
mfang@12442 3125 .PP
mfang@12442 3126 \-XX:+PrintGC
mfang@12442 3127 .RS 4
rgallard@8813 3128 Enables printing of messages at every GC\&. By default, this option is disabled\&.
mfang@12442 3129 .RE
mfang@12442 3130 .PP
mfang@12442 3131 \-XX:+PrintGCApplicationConcurrentTime
mfang@12442 3132 .RS 4
rgallard@8813 3133 Enables printing of how much time elapsed since the last pause (for example, a GC pause)\&. By default, this option is disabled\&.
mfang@12442 3134 .RE
mfang@12442 3135 .PP
mfang@12442 3136 \-XX:+PrintGCApplicationStoppedTime
mfang@12442 3137 .RS 4
rgallard@8813 3138 Enables printing of how much time the pause (for example, a GC pause) lasted\&. By default, this option is disabled\&.
mfang@12442 3139 .RE
mfang@12442 3140 .PP
mfang@12442 3141 \-XX:+PrintGCDateStamps
mfang@12442 3142 .RS 4
rgallard@8813 3143 Enables printing of a date stamp at every GC\&. By default, this option is disabled\&.
mfang@12442 3144 .RE
mfang@12442 3145 .PP
mfang@12442 3146 \-XX:+PrintGCDetails
mfang@12442 3147 .RS 4
rgallard@8813 3148 Enables printing of detailed messages at every GC\&. By default, this option is disabled\&.
mfang@12442 3149 .RE
mfang@12442 3150 .PP
mfang@12442 3151 \-XX:+PrintGCTaskTimeStamps
mfang@12442 3152 .RS 4
rgallard@8813 3153 Enables printing of time stamps for every individual GC worker thread task\&. By default, this option is disabled\&.
mfang@12442 3154 .RE
mfang@12442 3155 .PP
mfang@12442 3156 \-XX:+PrintGCTimeStamps
mfang@12442 3157 .RS 4
rgallard@8813 3158 Enables printing of time stamps at every GC\&. By default, this option is disabled\&.
mfang@12442 3159 .RE
mfang@12442 3160 .PP
mfang@12442 3161 \-XX:+PrintStringDeduplicationStatistics
mfang@12442 3162 .RS 4
mfang@12442 3163 Prints detailed deduplication statistics\&. By default, this option is disabled\&. See the
mfang@12442 3164 \fB\-XX:+UseStringDeduplication\fR
mfang@12442 3165 option\&.
mfang@12442 3166 .RE
mfang@12442 3167 .PP
mfang@12442 3168 \-XX:+PrintTenuringDistribution
mfang@12442 3169 .RS 4
rgallard@8813 3170 Enables printing of tenuring age information\&. The following is an example of the output:
mfang@12442 3171 .sp
mfang@12442 3172 .if n \{\
mfang@12442 3173 .RS 4
mfang@12442 3174 .\}
mfang@12442 3175 .nf
mfang@12442 3176 \fBDesired survivor size 48286924 bytes, new threshold 10 (max 10)\fR
mfang@12442 3177 \fB\- age 1: 28992024 bytes, 28992024 total\fR
mfang@12442 3178 \fB\- age 2: 1366864 bytes, 30358888 total\fR
mfang@12442 3179 \fB\- age 3: 1425912 bytes, 31784800 total\fR
mfang@12442 3180 \fB\&.\&.\&.\fR
mfang@12442 3181
mfang@12442 3182 .fi
mfang@12442 3183 .if n \{\
mfang@12442 3184 .RE
mfang@12442 3185 .\}
rgallard@8813 3186 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\&.
mfang@12442 3187 .sp
rgallard@8813 3188 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\&.
mfang@12442 3189 .sp
rgallard@8813 3190 By default, this option is disabled\&.
mfang@12442 3191 .RE
mfang@12442 3192 .PP
mfang@12442 3193 \-XX:+ScavengeBeforeFullGC
mfang@12442 3194 .RS 4
mfang@12442 3195 Enables GC of the young generation before each full GC\&. This option is enabled by default\&. Oracle recommends that you
mfang@12442 3196 \fIdo not\fR
mfang@12442 3197 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
mfang@12442 3198 \fB\-XX:\-ScavengeBeforeFullGC\fR\&.
mfang@12442 3199 .RE
mfang@12442 3200 .PP
mfang@12442 3201 \-XX:SoftRefLRUPolicyMSPerMB=\fItime\fR
mfang@12442 3202 .RS 4
mfang@12442 3203 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
mfang@12442 3204 \fB\-XX:SoftRefLRUPolicyMSPerMB\fR
mfang@12442 3205 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
mfang@12442 3206 \fB\-Xmx\fR
mfang@12442 3207 option has a significant effect on how quickly soft references are garbage collected\&.
mfang@12442 3208 .sp
rgallard@8813 3209 The following example shows how to set the value to 2\&.5 seconds:
mfang@12442 3210 .sp
mfang@12442 3211 .if n \{\
mfang@12442 3212 .RS 4
mfang@12442 3213 .\}
mfang@12442 3214 .nf
mfang@12442 3215 \fB\-XX:SoftRefLRUPolicyMSPerMB=2500\fR
mfang@12442 3216
mfang@12442 3217 .fi
mfang@12442 3218 .if n \{\
mfang@12442 3219 .RE
mfang@12442 3220 .\}
mfang@12442 3221 .RE
mfang@12442 3222 .PP
mfang@12442 3223 \-XX:StringDeduplicationAgeThreshold=\fIthreshold\fR
mfang@12442 3224 .RS 4
mfang@12442 3225 \fBString\fR
mfang@12442 3226 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
mfang@12442 3227 \fB\-XX:+PrintTenuringDistribution\fR
mfang@12442 3228 option\&. Note that
mfang@12442 3229 \fBString\fR
mfang@12442 3230 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
mfang@12442 3231 \fB3\fR\&. See the
mfang@12442 3232 \fB\-XX:+UseStringDeduplication\fR
mfang@12442 3233 option\&.
mfang@12442 3234 .RE
mfang@12442 3235 .PP
mfang@12442 3236 \-XX:SurvivorRatio=\fIratio\fR
mfang@12442 3237 .RS 4
rgallard@8813 3238 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:
mfang@12442 3239 .sp
mfang@12442 3240 .if n \{\
mfang@12442 3241 .RS 4
mfang@12442 3242 .\}
mfang@12442 3243 .nf
mfang@12442 3244 \fB\-XX:SurvivorRatio=4\fR
mfang@12442 3245
mfang@12442 3246 .fi
mfang@12442 3247 .if n \{\
mfang@12442 3248 .RE
mfang@12442 3249 .\}
mfang@12442 3250 .RE
mfang@12442 3251 .PP
mfang@12442 3252 \-XX:TargetSurvivorRatio=\fIpercent\fR
mfang@12442 3253 .RS 4
rgallard@8813 3254 Sets the desired percentage of survivor space (0 to 100) used after young garbage collection\&. By default, this option is set to 50%\&.
mfang@12442 3255 .sp
rgallard@8813 3256 The following example shows how to set the target survivor space ratio to 30%:
mfang@12442 3257 .sp
mfang@12442 3258 .if n \{\
mfang@12442 3259 .RS 4
mfang@12442 3260 .\}
mfang@12442