src/linux/doc/man/java.1

Print this page




   4 .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5 .\"
   6 .\" This code is free software; you can redistribute it and/or modify it
   7 .\" under the terms of the GNU General Public License version 2 only, as
   8 .\" published by the Free Software Foundation.
   9 .\"
  10 .\" This code is distributed in the hope that it will be useful, but WITHOUT
  11 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12 .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  13 .\" version 2 for more details (a copy is included in the LICENSE file that
  14 .\" accompanied this code).
  15 .\"
  16 .\" You should have received a copy of the GNU General Public License version
  17 .\" 2 along with this work; if not, write to the Free Software Foundation,
  18 .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19 .\"
  20 .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21 .\" or visit www.oracle.com if you need additional information or have any
  22 .\" questions.
  23 .\"
  24 .\"     Arch: generic
  25 .\"     Software: JDK 8
  26 .\"     Date: 03 March 2015
  27 .\"     SectDesc: Basic Tools
  28 .\"     Title: java.1



  29 .\"
  30 .if n .pl 99999
  31 .TH java 1 "03 March 2015" "JDK 8" "Basic Tools"
  32 .\" -----------------------------------------------------------------
  33 .\" * Define some portability stuff
  34 .\" -----------------------------------------------------------------
  35 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  36 .\" http://bugs.debian.org/507673
  37 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  38 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  39 .ie \n(.g .ds Aq \(aq
  40 .el       .ds Aq '
  41 .\" -----------------------------------------------------------------
  42 .\" * set default formatting
  43 .\" -----------------------------------------------------------------
  44 .\" disable hyphenation
  45 .nh
  46 .\" disable justification (adjust text to left margin only)
  47 .ad l
  48 .\" -----------------------------------------------------------------
  49 .\" * MAIN CONTENT STARTS HERE *
  50 .\" -----------------------------------------------------------------
  51 
  52 .SH NAME    
  53 java \- Launches a Java application\&.
  54 .SH SYNOPSIS    
  55 .sp     



  56 .nf     
  57 
  58 \fBjava\fR [\fIoptions\fR] \fIclassname\fR [\fIargs\fR]
  59 .fi     







  60 .nf     
  61 
  62 \fBjava\fR [\fIoptions\fR] \fB\-jar\fR \fIfilename\fR [\fIargs\fR]
  63 .fi     
  64 .sp     
  65 .TP     


  66 \fIoptions\fR
  67 Command-line options separated by spaces\&. See Options\&.
  68 .TP     


  69 \fIclassname\fR

  70 The name of the class to be launched\&.
  71 .TP     

  72 \fIfilename\fR
  73 The name of the Java Archive (JAR) file to be called\&. Used only with the \f3-jar\fR option\&.
  74 .TP     




  75 \fIargs\fR
  76 The arguments passed to the \f3main()\fR method separated by spaces\&.
  77 .SH DESCRIPTION    
  78 The \f3java\fR command starts a Java application\&. It does this by starting the Java Runtime Environment (JRE), loading the specified class, and calling that class\&'s \f3main()\fR method\&. The method must be declared \fIpublic\fR and \fIstatic\fR, it must not return any value, and it must accept a \f3String\fR array as a parameter\&. The method declaration has the following form:














  79 .sp     



  80 .nf     
  81 \f3public static void main(String[] args)\fP

  82 .fi     
  83 .nf     
  84 \f3\fP
  85 .fi     
  86 .sp     
  87 The \f3java\fR command can be used to launch a JavaFX application by loading a class that either has a \f3main()\fR method or that extends \f3javafx\&.application\&.Application\fR\&. In the latter case, the launcher constructs an instance of the \f3Application\fR class, calls its \f3init()\fR method, and then calls the \f3start(javafx\&.stage\&.Stage)\fR method\&.
  88 .PP
  89 By default, the first argument that is not an option of the \f3java\fR command is the fully qualified name of the class to be called\&. If the \f3-jar\fR 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 \f3Main-Class\fR manifest header in its source code\&.











  90 .PP








  91 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\&.
  92 .PP
  93 Arguments after the class file name or the JAR file name are passed to the \f3main()\fR method\&.
  94 .SH OPTIONS    
  95 The \f3java\fR command supports a wide range of options that can be divided into the following categories:
  96 .TP 0.2i    
  97 \(bu












  98 Standard Options
  99 .TP 0.2i    
 100 \(bu
 101 Non-Standard Options
 102 .TP 0.2i    
 103 \(bu
















 104 Advanced Runtime Options
 105 .TP 0.2i    
 106 \(bu








 107 Advanced JIT Compiler Options
 108 .TP 0.2i    
 109 \(bu








 110 Advanced Serviceability Options
 111 .TP 0.2i    
 112 \(bu








 113 Advanced Garbage Collection Options

 114 .PP
 115 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\&.
 116 .PP
 117 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 \f3-X\fR\&.

 118 .PP
 119 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 \f3-XX\fR\&.

 120 .PP
 121 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\&.
 122 .PP
 123 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 \f3-XX\fR options are enabled using the plus sign (\f3-XX:+\fR\fIOptionName\fR) and disabled using the minus sign (\f3-XX:-\fR\fIOptionName\fR)\&.


 124 .PP
 125 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 \f3k\fR or \f3K\fR for kilobytes (KB), \f3m\fR or \f3M\fR for megabytes (MB), \f3g\fR or \f3G\fR for gigabytes (GB)\&. For example, to set the size to 8 GB, you can specify either \f38g\fR, \f38192m\fR, \f38388608k\fR, or \f38589934592\fR as the argument\&. If you are expected to specify the percentage, use a number from 0 to 1 (for example, specify \f30\&.25\fR for 25%)\&.
 126 .SS STANDARD\ OPTIONS    




















 127 These are the most commonly used options that are supported by all implementations of the JVM\&.
 128 .TP
 129 -agentlib:\fIlibname\fR[=\fIoptions\fR]
 130 .br
 131 Loads the specified native agent library\&. After the library name, a comma-separated list of options specific to the library can be used\&.
 132 
 133 If the option \f3-agentlib:foo\fR is specified, then the JVM attempts to load the library named \f3libfoo\&.so\fR in the location specified by the \f3LD_LIBRARY_PATH\fR system variable (on OS X this variable is \f3DYLD_LIBRARY_PATH\fR)\&.
 134 







 135 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:
 136 .sp     



 137 .nf     
 138 \f3\-agentlib:hprof=cpu=samples,interval=20,depth=3\fP
 139 .fi     
 140 .nf     
 141 \f3\fP
 142 .fi     
 143 .sp     
 144 
 145 



 146 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:
 147 .sp     



 148 .nf     
 149 \f3\-agentlib:jdwp=transport=dt_socket,server=y,address=8000\fP
 150 .fi     
 151 .nf     
 152 \f3\fP
 153 .fi     
 154 .sp     
 155 
 156 



 157 For more information about the native agent libraries, refer to the following:
 158 .RS     
 159 .TP 0.2i    
 160 \(bu
 161 The \f3java\&.lang\&.instrument\fR package description at http://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package-summary\&.html
 162 .TP 0.2i    
 163 \(bu
















 164 Agent Command Line Options in the JVM Tools Interface guide at http://docs\&.oracle\&.com/javase/8/docs/platform/jvmti/jvmti\&.html#starting
 165 .RE     
 166 
 167 .TP
 168 -agentpath:\fIpathname\fR[=\fIoptions\fR]













































 169 .br
 170 Loads the native agent library specified by the absolute path name\&. This option is equivalent to \f3-agentlib\fR but uses the full path and file name of the library\&.
 171 .TP
 172 -client
 173 .br
 174 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\&.
 175 
 176 For default JVM selection, see Server-Class Machine Detection at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/server-class\&.html
 177 .TP
 178 -D\fIproperty\fR=\fIvalue\fR
 179 .br
 180 Sets a system property value\&. The \fIproperty\fR variable is a string with no spaces that represents the name of the property\&. The \fIvalue\fR variable is a string that represents the value of the property\&. If \fIvalue\fR is a string with spaces, then enclose it in quotation marks (for example \f3-Dfoo="foo bar"\fR)\&.
 181 .TP
 182 -d32
 183 .br
 184 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\&.
 185 .TP
 186 -d64
 187 .br
 188 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\&.
 189 
 190 Currently only the Java HotSpot Server VM supports 64-bit operation, and the \f3-server\fR option is implicit with the use of \f3-d64\fR\&. The \f3-client\fR option is ignored with the use of \f3-d64\fR\&. This is subject to change in a future release\&.
 191 .TP
 192 .nf
 193 -disableassertions[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR], -da[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
 194 .br
 195 .fi
 196 Disables assertions\&. By default, assertions are disabled in all packages and classes\&.
 197 
 198 With no arguments, \f3-disableassertions\fR (\f3-da\fR) disables assertions in all packages and classes\&. With the \fIpackagename\fR argument ending in \f3\&.\&.\&.\fR, the switch disables assertions in the specified package and any subpackages\&. If the argument is simply \f3\&.\&.\&.\fR, then the switch disables assertions in the unnamed package in the current working directory\&. With the \fIclassname\fR argument\f3\fR, the switch disables assertions in the specified class\&.
 199 
 200 The \f3-disableassertions\fR (\f3-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 \f3-disablesystemassertions\fR option enables you to disable assertions in all system classes\&.
 201 
 202 To explicitly enable assertions in specific packages or classes, use the \f3-enableassertions\fR (\f3-ea\fR) option\&. Both options can be used at the same time\&. For example, to run the \f3MyClass\fR application with assertions enabled in package \f3com\&.wombat\&.fruitbat\fR (and any subpackages) but disabled in class \f3com\&.wombat\&.fruitbat\&.Brickbat\fR, use the following command:
 203 .sp     
 204 .nf     
 205 \f3java \-ea:com\&.wombat\&.fruitbat\&.\&.\&. \-da:com\&.wombat\&.fruitbat\&.Brickbat MyClass\fP
 206 .fi     
 207 .nf     
 208 \f3\fP
 209 .fi     



 210 .sp     




















 211 
 212 .TP
 213 -disablesystemassertions, -dsa





 214 .br


 215 Disables assertions in all system classes\&.
 216 .TP
 217 .nf
 218 -enableassertions[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR], -ea[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
 219 .br
 220 .fi

 221 Enables assertions\&. By default, assertions are disabled in all packages and classes\&.
 222 
 223 With no arguments, \f3-enableassertions\fR (\f3-ea\fR) enables assertions in all packages and classes\&. With the \fIpackagename\fR argument ending in \f3\&.\&.\&.\fR, the switch enables assertions in the specified package and any subpackages\&. If the argument is simply \f3\&.\&.\&.\fR, then the switch enables assertions in the unnamed package in the current working directory\&. With the \fIclassname\fR argument\f3\fR, the switch enables assertions in the specified class\&.
 224 
 225 The \f3-enableassertions\fR (\f3-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 \f3-enablesystemassertions\fR option provides a separate switch to enable assertions in all system classes\&.
 226 
 227 To explicitly disable assertions in specific packages or classes, use the \f3-disableassertions\fR (\f3-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 \f3MyClass\fR application with assertions enabled only in package \f3com\&.wombat\&.fruitbat\fR (and any subpackages) but disabled in class \f3com\&.wombat\&.fruitbat\&.Brickbat\fR, use the following command:
 228 .sp     
 229 .nf     
 230 \f3java \-ea:com\&.wombat\&.fruitbat\&.\&.\&. \-da:com\&.wombat\&.fruitbat\&.Brickbat MyClass\fP
 231 .fi     
 232 .nf     
 233 \f3\fP
 234 .fi     



 235 .sp     




















 236 
 237 .TP
 238 -enablesystemassertions, -esa





 239 .br


 240 Enables assertions in all system classes\&.
 241 .TP
 242 -help, -?

 243 .br
 244 Displays usage information for the \f3java\fR command without actually running the JVM\&.
 245 .TP
 246 -jar \fIfilename\fR
 247 .br
 248 Executes a program encapsulated in a JAR file\&. The \fIfilename\fR argument is the name of a JAR file with a manifest that contains a line in the form \f3Main-Class:\fR\fIclassname\fR that defines the class with the \f3public static void main(String[] args)\fR method that serves as your application\&'s starting point\&.
 249 
 250 When you use the \f3-jar\fR option, the specified JAR file is the source of all user classes, and other class path settings are ignored\&.
 251 













 252 For more information about JAR files, see the following resources:
 253 .RS     
 254 .TP 0.2i    
 255 \(bu






 256 jar(1)
 257 .TP 0.2i    
 258 \(bu








 259 The Java Archive (JAR) Files guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jar/index\&.html
 260 .TP 0.2i    
 261 \(bu
 262 Lesson: Packaging Programs in JAR Files at http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.html
 263 .RE     










 264 
 265 .TP
 266 -javaagent:\fIjarpath\fR[=\fIoptions\fR]
 267 .br
 268 Loads the specified Java programming language agent\&. For more information about instrumenting Java applications, see the \f3java\&.lang\&.instrument\fR package description in the Java API documentation at http://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package-summary\&.html
 269 .TP
 270 -jre-restrict-search
 271 .br
 272 Includes user-private JREs in the version search\&.
 273 .TP
 274 -no-jre-restrict-search
 275 .br
 276 Excludes user-private JREs from the version search\&.
 277 .TP
 278 -server
 279 .br
 280 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\&.
 281 
 282 For default JVM selection, see Server-Class Machine Detection at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/server-class\&.html
 283 .TP
 284 -showversion
 285 .br
 286 Displays version information and continues execution of the application\&. This option is equivalent to the \f3-version\fR option except that the latter instructs the JVM to exit after displaying version information\&.
 287 .TP
 288 -splash:\fIimgname\fR
 289 .br
 290 Shows the splash screen with the image specified by \fIimgname\fR\&. For example, to show the \f3splash\&.gif\fR file from the \f3images\fR directory when starting your application, use the following option:
 291 .sp     
 292 .nf     
 293 \f3\-splash:images/splash\&.gif\fP
 294 .fi     
 295 .nf     
 296 \f3\fP
 297 .fi     













 298 .sp     





 299 
 300 .TP
 301 -verbose:class
 302 .br





 303 Displays information about each loaded class\&.
 304 .TP
 305 -verbose:gc
 306 .br

 307 Displays information about each garbage collection (GC) event\&.
 308 .TP
 309 -verbose:jni
 310 .br

 311 Displays information about the use of native methods and other Java Native Interface (JNI) activity\&.
 312 .TP
 313 -version
 314 .br
 315 Displays version information and then exits\&. This option is equivalent to the \f3-showversion\fR option except that the latter does not instruct the JVM to exit after displaying version information\&.
 316 .TP
 317 -version:\fIrelease\fR
 318 .br
 319 Specifies the release version to be used for running the application\&. If the version of the \f3java\fR command called does not meet this specification and an appropriate implementation is found on the system, then the appropriate implementation will be used\&.
 320 
 321 The \fIrelease\fR argument specifies either the exact version string, or a list of version strings and ranges separated by spaces\&. A \fIversion string\fR is the developer designation of the version number in the following form: \f31\&.\fR\fIx\fR\f3\&.0_\fR\fIu\fR (where \fIx\fR is the major version number, and \fIu\fR is the update version number)\&. A \fIversion range\fR is made up of a version string followed by a plus sign (\f3+\fR) to designate this version or later, or a part of a version string followed by an asterisk (\f3*\fR) to designate any version string with a matching prefix\&. Version strings and ranges can be combined using a space for a logical \fIOR\fR combination, or an ampersand (\f3&\fR) for a logical \fIAND\fR 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:




 322 .sp     





















 323 .nf     
 324 \f3\-version:"1\&.6\&.0_13 1\&.6* & 1\&.6\&.0_10+"\fP

 325 .fi     
 326 .nf     
 327 \f3\fP
 328 .fi     



 329 .sp     
 330 
 331 
 332 Quotation marks are necessary only if there are spaces in the \fIrelease\fR parameter\&.
 333 
 334 For JAR files, the preference is to specify version requirements in the JAR file manifest rather than on the command line\&.
 335 .SS NON-STANDARD\ OPTIONS    


 336 These options are general purpose options that are specific to the Java HotSpot Virtual Machine\&.
 337 .TP
 338 -X
 339 .br
 340 Displays help for all available \f3-X\fR options\&.
 341 .TP
 342 -Xbatch
 343 .br
 344 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 \f3-Xbatch\fR flag disables background compilation so that compilation of all methods proceeds as a foreground task until completed\&.
 345 
 346 This option is equivalent to \f3-XX:-BackgroundCompilation\fR\&.
 347 .TP
 348 -Xbootclasspath:\fIpath\fR
 349 .br







 350 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\&.
 351 
 352 \fI\fRDo not deploy applications that use this option to override a class in \f3rt\&.jar\fR, because this violates the JRE binary code license\&.
 353 .TP
 354 -Xbootclasspath/a:\fIpath\fR
 355 .br


 356 Specifies a list of directories, JAR files, and ZIP archives separated by colons (:) to append to the end of the default bootstrap class path\&.
 357 
 358 Do not deploy applications that use this option to override a class in \f3rt\&.jar\fR, because this violates the JRE binary code license\&.
 359 .TP
 360 -Xbootclasspath/p:\fIpath\fR
 361 .br


 362 Specifies a list of directories, JAR files, and ZIP archives separated by colons (:) to prepend to the front of the default bootstrap class path\&.
 363 
 364 Do not deploy applications that use this option to override a class in \f3rt\&.jar\fR, because this violates the JRE binary code license\&.
 365 .TP
 366 -Xcheck:jni
 367 .br


 368 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\&.
 369 .TP
 370 -Xcomp
 371 .br
 372 Forces compilation of methods on first invocation\&. By default, the Client VM (\f3-client\fR) performs 1,000 interpreted method invocations and the Server VM (\f3-server\fR) performs 10,000 interpreted method invocations to gather information for efficient compilation\&. Specifying the \f3-Xcomp\fR option disables interpreted method invocations to increase compilation performance at the expense of efficiency\&.
 373 
 374 You can also change the number of interpreted method invocations before compilation using the \f3-XX:CompileThreshold\fR option\&.
 375 .TP
 376 -Xdebug
 377 .br






 378 Does nothing\&. Provided for backward compatibility\&.
 379 .TP
 380 -Xdiag
 381 .br

 382 Shows additional diagnostic messages\&.
 383 .TP
 384 -Xfuture
 385 .br
 386 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\&.
 387 .TP
 388 -Xint
 389 .br
 390 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\&.
 391 .TP
 392 -Xinternalversion
 393 .br
 394 Displays more detailed JVM version information than the \f3-version\fR option, and then exits\&.
 395 .TP
 396 -Xloggc:\fIfilename\fR
 397 .br
 398 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 \f3-verbose:gc\fR with the time elapsed since the first GC event preceding each logged event\&. The \f3-Xloggc\fR option overrides \f3-verbose:gc\fR if both are given with the same \f3java\fR command\&.
 399 














 400 Example:
 401 .sp     



 402 .nf     
 403 \f3\-Xloggc:garbage\-collection\&.log\fP
 404 .fi     
 405 .nf     
 406 \f3\fP
 407 .fi     
 408 .sp     
 409 
 410 .TP
 411 -Xmaxjitcodesize=\fIsize\fR
 412 .br
 413 Specifies the maximum code cache size (in bytes) for JIT-compiled code\&. Append the letter \f3k\fR or \f3K\fR to indicate kilobytes, \f3m\fR or \f3M\fR to indicate megabytes, \f3g\fR or \f3G\fR to indicate gigabytes\&. By default, the value is set to 48 MB:
 414 .sp     
 415 .nf     
 416 \f3\-Xmaxjitcodesize=48m\fP
 417 .fi     
 418 .nf     
 419 \f3\fP
 420 .fi     


















 421 .sp     





 422 
 423 
 424 This option is equivalent to \f3-XX:ReservedCodeCacheSize\fR\&.
 425 .TP
 426 -Xmixed
 427 .br





 428 Executes all bytecode by the interpreter except for hot methods, which are compiled to native code\&.
 429 .TP
 430 -Xmn\fIsize\fR
 431 .br
 432 Sets the initial and maximum size (in bytes) of the heap for the young generation (nursery)\&. Append the letter \f3k\fR or \f3K\fR to indicate kilobytes, \f3m\fR or \f3M\fR to indicate megabytes, \f3g\fR or \f3G\fR to indicate gigabytes\&.
 433 













 434 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\&.
 435 
 436 The following examples show how to set the initial and maximum size of young generation to 256 MB using various units:
 437 .sp     



 438 .nf     
 439 \f3\-Xmn256m\fP



 440 .fi     
 441 .nf     
 442 \f3\-Xmn262144k\fP
 443 .fi     
 444 .nf     
 445 \f3\-Xmn268435456\fP
 446 .fi     
 447 .nf     
 448 \f3\fP
 449 .fi     


















 450 .sp     
 451 
 452 
 453 Instead of the \f3-Xmn\fR option to set both the initial and maximum size of the heap for the young generation, you can use \f3-XX:NewSize\fR to set the initial size and \f3-XX:MaxNewSize\fR to set the maximum size\&.
 454 .TP
 455 -Xms\fIsize\fR
 456 .br
 457 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 \f3k\fR or \f3K\fR to indicate kilobytes, \f3m\fR or \f3M\fR to indicate megabytes, \f3g\fR or \f3G\fR to indicate gigabytes\&.
 458 
 459 The following examples show how to set the size of allocated memory to 6 MB using various units:
 460 .sp     



 461 .nf     
 462 \f3\-Xms6291456\fP



 463 .fi     
 464 .nf     
 465 \f3\-Xms6144k\fP
 466 .fi     
 467 .nf     
 468 \f3\-Xms6m\fP
 469 .fi     
 470 .nf     
 471 \f3\fP
 472 .fi     






















 473 .sp     
 474 
 475 
 476 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 \f3-Xmn\fR option or the \f3-XX:NewSize\fR option\&.
 477 .TP
 478 -Xmx\fIsize\fR
 479 .br
 480 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 \f3k\fR or \f3K\fR to indicate kilobytes, \f3m\fR or \f3M\fR to indicate megabytes, \f3g\fR or \f3G\fR to indicate gigabytes\&. The default value is chosen at runtime based on system configuration\&. For server deployments, \f3-Xms\fR and \f3-Xmx\fR are often set to the same value\&. See the section "Ergonomics" in \fIJava SE HotSpot Virtual Machine Garbage Collection Tuning Guide\fR at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gctuning/index\&.html\&.
 481 
 482 The following examples show how to set the maximum allowed size of allocated memory to 80 MB using various units:
 483 .sp     



 484 .nf     
 485 \f3\-Xmx83886080\fP
 486 .fi     
 487 .nf     
 488 \f3\-Xmx81920k\fP
 489 .fi     
 490 .nf     
 491 \f3\-Xmx80m\fP
 492 .fi     
 493 .nf     
 494 \f3\fP
 495 .fi     
 496 .sp     
 497 
 498 
 499 The \f3-Xmx\fR option is equivalent to \f3-XX:MaxHeapSize\fR\&.
 500 .TP
 501 -Xnoclassgc
 502 .br







 503 Disables garbage collection (GC) of classes\&. This can save some GC time, which shortens interruptions during the application run\&.
 504 
 505 When you specify \f3-Xnoclassgc\fR 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\&.
 506 .TP
 507 -Xprof
 508 .br



 509 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\&.
 510 .TP
 511 -Xrs
 512 .br

 513 Reduces the use of operating system signals by the JVM\&.
 514 
 515 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\&.
 516 
 517 The JVM catches signals to implement shutdown hooks for unexpected termination\&. The JVM uses \f3SIGHUP\fR, \f3SIGINT\fR, and \f3SIGTERM\fR to initiate the running of shutdown hooks\&.
 518 
 519 The JVM uses a similar mechanism to implement the feature of dumping thread stacks for debugging purposes\&. The JVM uses \f3SIGQUIT\fR to perform thread dumps\&.
 520 
 521 Applications embedding the JVM frequently need to trap signals such as \f3SIGINT\fR or \f3SIGTERM\fR, which can lead to interference with the JVM signal handlers\&. The \f3-Xrs\fR option is available to address this issue\&. When \f3-Xrs\fR is used, the signal masks for \f3SIGINT\fR, \f3SIGTERM\fR, \f3SIGHUP\fR, and \f3SIGQUIT\fR are not changed by the JVM, and signal handlers for these signals are not installed\&.
 522 
 523 There are two consequences of specifying \f3-Xrs\fR:
 524 .RS     
 525 .TP 0.2i    
 526 \(bu
 527 \f3SIGQUIT\fR thread dumps are not available\&.
 528 .TP 0.2i    
 529 \(bu
 530 User code is responsible for causing shutdown hooks to run, for example, by calling \f3System\&.exit()\fR when the JVM is to be terminated\&.























 531 .RE     
 532 
 533 .TP
 534 -Xshare:\fImode\fR
 535 .br
 536 Sets the class data sharing mode\&. Possible \fImode\fR arguments for this option include the following:
 537 .RS     
 538 .TP     














 539 auto
 540 Use shared class data if possible\&. This is the default value for Java HotSpot 32-Bit Client VM\&.
 541 .TP     


 542 on
 543 Require the use of class data sharing\&. Print an error message and exit if class data sharing cannot be used\&.
 544 .TP     


 545 off
 546 Do not use shared class data\&. 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\&.
 547 .TP     


 548 dump
 549 Manually generate the class data sharing archive\&.



 550 .RE     
 551 
 552 .TP
 553 -XshowSettings:\fIcategory\fR
 554 .br
 555 Shows settings and continues\&. Possible \fIcategory\fR arguments for this option include the following:
 556 .RS     
 557 .TP     

 558 all

 559 Shows all categories of settings\&. This is the default value\&.
 560 .TP     

 561 locale

 562 Shows settings related to locale\&.
 563 .TP     

 564 properties

 565 Shows settings related to system properties\&.
 566 .TP     

 567 vm

 568 Shows the settings of the JVM\&.
 569 .RE     
 570 
 571 .TP
 572 -Xss\fIsize\fR
 573 .br
 574 Sets the thread stack size (in bytes)\&. Append the letter \f3k\fR or \f3K\fR to indicate KB, \f3m\fR or \f3M\fR to indicate MB, \f3g\fR or \f3G\fR to indicate GB\&. The default value depends on the platform:
 575 .RS     
 576 .TP 0.2i    
 577 \(bu
 578 Linux/ARM (32-bit): 320 KB
 579 .TP 0.2i    
 580 \(bu
 581 Linux/i386 (32-bit): 320 KB
 582 .TP 0.2i    
 583 \(bu
 584 Linux/x64 (64-bit): 1024 KB
 585 .TP 0.2i    
 586 \(bu
 587 OS X (64-bit): 1024 KB
 588 .TP 0.2i    
 589 \(bu
 590 Oracle Solaris/i386 (32-bit): 320 KB
 591 .TP 0.2i    
 592 \(bu
 593 Oracle Solaris/x64 (64-bit): 1024 KB
 594 .TP 0.2i    
 595 \(bu
 596 Windows: depends on virtual memory
 597 .RE     
 598 
 599 

















































































 600 The following examples set the thread stack size to 1024 KB in different units:
 601 .sp     



 602 .nf     
 603 \f3\-Xss1m\fP
 604 .fi     
 605 .nf     
 606 \f3\-Xss1024k\fP
 607 .fi     
 608 .nf     
 609 \f3\-Xss1048576\fP
 610 .fi     
 611 .nf     
 612 \f3\fP
 613 .fi     
 614 .sp     
 615 
 616 
 617 This option is equivalent to \f3-XX:ThreadStackSize\fR\&.
 618 .TP
 619 -Xusealtsigs
 620 .br
 621 Use alternative signals instead of \f3SIGUSR1\fR and \f3SIGUSR2\fR for JVM internal signals\&. This option is equivalent to \f3-XX:+UseAltSigs\fR\&.
 622 .TP
 623 -Xverify:\fImode\fR
 624 .br
 625 Sets the mode of the bytecode verifier\&. Bytecode verification helps to troubleshoot some problems, but it also adds overhead to the running application\&. Possible \fImode\fR arguments for this option include the following:
 626 .RS     
 627 .TP     












 628 none

 629 Do not verify the bytecode\&. This reduces startup time and also reduces the protection provided by Java\&.
 630 .TP     

 631 remote
 632 Verify those classes that are not loaded by the bootstrap class loader\&. This is the default behavior if you do not specify the \f3-Xverify\fR option\&.
 633 .TP     




 634 all

 635 Verify all classes\&.
 636 .RE     
 637 
 638 .SS ADVANCED\ RUNTIME\ OPTIONS    

 639 These options control the runtime behavior of the Java HotSpot VM\&.
 640 .TP
 641 -XX:+DisableAttachMechanism
 642 .br
 643 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 \f3jcmd\fR, \f3jstack\fR, \f3jmap\fR, and \f3jinfo\fR\&.
 644 .TP
 645 -XX:ErrorFile=\fIfilename\fR
 646 .br
 647 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 \f3hs_err_pid\fR\fIpid\fR\f3\&.log\fR where \fIpid\fR 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 \f3%p\fR):
 648 .sp     
 649 .nf     
 650 \f3\-XX:ErrorFile=\&./hs_err_pid%p\&.log\fP
 651 .fi     
 652 .nf     
 653 \f3\fP
 654 .fi     








 655 .sp     
 656 
 657 
 658 The following example shows how to set the error log to \f3/var/log/java/java_error\&.log\fR:









 659 .sp     














































 660 .nf     
 661 \f3\-XX:ErrorFile=/var/log/java/java_error\&.log\fP

 662 .fi     
 663 .nf     
 664 \f3\fP
 665 .fi     


 666 .sp     





 667 
 668 
 669 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 \f3/tmp\fR\&.
 670 .TP
 671 -XX:+FailOverToOldVerifier
 672 .br





 673 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\&.
 674 .TP
 675 -XX:LargePageSizeInBytes=\fIsize\fR
 676 .br
 677 On Solaris, sets the maximum size (in bytes) for large pages used for Java heap\&. The \fIsize\fR argument must be a power of 2 (2, 4, 8, 16, \&.\&.\&.)\&. Append the letter \f3k\fR or \f3K\fR to indicate kilobytes, \f3m\fR or \f3M\fR to indicate megabytes, \f3g\fR or \f3G\fR to indicate gigabytes\&. By default, the size is set to 0, meaning that the JVM chooses the size for large pages automatically\&.
 678 















 679 The following example illustrates how to set the large page size to 4 megabytes (MB):
 680 .sp     



 681 .nf     
 682 \f3\-XX:LargePageSizeInBytes=4m\fP

 683 .fi     
 684 .nf     
 685 \f3\fP
 686 .fi     



















 687 .sp     
 688 
 689 .TP
 690 -XX:MaxDirectMemorySize=\fIsize\fR
 691 .br
 692 Sets the maximum total size (in bytes) of the New I/O (the \f3java\&.nio\fR package) direct-buffer allocations\&. Append the letter \f3k\fR or \f3K\fR to indicate kilobytes, \f3m\fR or \f3M\fR to indicate megabytes, \f3g\fR or \f3G\fR to indicate gigabytes\&. By default, the size is set to 0, meaning that the JVM chooses the size for NIO direct-buffer allocations automatically\&.
 693 
 694 The following examples illustrate how to set the NIO size to 1024 KB in different units:
 695 .sp     



 696 .nf     
 697 \f3\-XX:MaxDirectMemorySize=1m\fP
 698 .fi     
 699 .nf     
 700 \f3\-XX:MaxDirectMemorySize=1024k\fP
 701 .fi     
 702 .nf     
 703 \f3\-XX:MaxDirectMemorySize=1048576\fP
 704 .fi     
 705 .nf     
 706 \f3\fP
 707 .fi     
 708 .sp     
 709 
 710 .TP
 711 -XX:NativeMemoryTracking=\fImode\fR
 712 .br
 713 Specifies the mode for tracking JVM native memory usage\&. Possible \fImode\fR arguments for this option include the following:
 714 .RS     
 715 .TP     






 716 off
 717 Do not track JVM native memory usage\&. This is the default behavior if you do not specify the \f3-XX:NativeMemoryTracking\fR option\&.
 718 .TP     




 719 summary

 720 Only track memory usage by JVM subsystems, such as Java heap, class, code, and thread\&.
 721 .TP     

 722 detail
 723 In addition to tracking memory usage by JVM subsystems, track memory usage by individual \f3CallSite\fR, individual virtual memory region and its committed regions\&.


 724 .RE     
 725 
 726 .TP
 727 -XX:ObjectAlignmentInBytes=\fIalignment\fR
 728 .br
 729 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\&.
 730 
 731 The heap size limit in bytes is calculated as:
 732 
 733 \f34GB * ObjectAlignmentInBytes\fR
 734 
 735 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\&.
 736 .TP
 737 -XX:OnError=\fIstring\fR
 738 .br
 739 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\&.
 740 
 741 \fI\fRThe following example shows how the \f3-XX:OnError\fR option can be used to run the \f3gcore\fR command to create the core image, and the debugger is started to attach to the process in case of an irrecoverable error (the \f3%p\fR designates the current process):
 742 .sp     











 743 .nf     
 744 \f3\-XX:OnError="gcore %p;dbx \- %p"\fP

 745 .fi     
 746 .nf     
 747 \f3\fP
 748 .fi     




















 749 .sp     
 750 
 751 .TP
 752 -XX:OnOutOfMemoryError=\fIstring\fR
 753 .br
 754 Sets a custom command or a series of semicolon-separated commands to run when an \f3OutOfMemoryError\fR 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 \f3-XX:OnError\fR option\&.
 755 .TP
 756 -XX:+PerfDataSaveToFile
 757 .br
 758 If enabled, saves jstat(1) binary data when the Java application exits\&. This binary data is saved in a file named \f3hsperfdata_\fR\fI<pid>\fR, where \fI<pid>\fR is the process identifier of the Java application you ran\&. Use \f3jstat\fR to display the performance data contained in this file as follows:
 759 .sp     
 760 .nf     
 761 \f3jstat \-class file:///\fI<path>\fR/hsperfdata_\fI<pid>\fR\fP

 762 .fi     
 763 .nf     
 764 \f3jstat \-gc file:///\fI<path>\fR/hsperfdata_\fI<pid>\fR\fP
 765 .fi     
 766 .sp     
 767 
 768 .TP
 769 -XX:+PrintCommandLineFlags
 770 .br
 771 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\&.
 772 .TP
 773 -XX:+PrintNMTStatistics
 774 .br
 775 Enables printing of collected native memory tracking data at JVM exit when native memory tracking is enabled (see \f3-XX:NativeMemoryTracking\fR)\&. By default, this option is disabled and native memory tracking data is not printed\&.
 776 .TP
 777 -XX:+RelaxAccessControlCheck
 778 .br



 779 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\&.
 780 .TP
 781 -XX:+ShowMessageBoxOnError
 782 .br

 783 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\&.
 784 .TP
 785 -XX:ThreadStackSize=\fIsize\fR
 786 .br
 787 Sets the thread stack size (in bytes)\&. Append the letter \f3k\fR or \f3K\fR to indicate kilobytes, \f3m\fR or \f3M\fR to indicate megabytes, \f3g\fR or \f3G\fR to indicate gigabytes\&. The default value depends on the platform:
 788 .RS     
 789 .TP 0.2i    
 790 \(bu
 791 Linux/ARM (32-bit): 320 KB
 792 .TP 0.2i    
 793 \(bu
 794 Linux/i386 (32-bit): 320 KB
 795 .TP 0.2i    
 796 \(bu
 797 Linux/x64 (64-bit): 1024 KB
 798 .TP 0.2i    
 799 \(bu
 800 OS X (64-bit): 1024 KB
 801 .TP 0.2i    
 802 \(bu
 803 Oracle Solaris/i386 (32-bit): 320 KB
 804 .TP 0.2i    
 805 \(bu
 806 Oracle Solaris/x64 (64-bit): 1024 KB
 807 .TP 0.2i    
 808 \(bu
 809 Windows: depends on virtual memory
 810 .RE     
 811 
 812 

















































































 813 The following examples show how to set the thread stack size to 1024 KB in different units:
 814 .sp     



 815 .nf     
 816 \f3\-XX:ThreadStackSize=1m\fP
 817 .fi     
 818 .nf     
 819 \f3\-XX:ThreadStackSize=1024k\fP
 820 .fi     
 821 .nf     
 822 \f3\-XX:ThreadStackSize=1048576\fP
 823 .fi     
 824 .nf     
 825 \f3\fP
 826 .fi     
 827 .sp     
 828 
 829 
 830 This option is equivalent to \f3-Xss\fR\&.
 831 .TP
 832 -XX:+TraceClassLoading
 833 .br





 834 Enables tracing of classes as they are loaded\&. By default, this option is disabled and classes are not traced\&.
 835 .TP
 836 -XX:+TraceClassLoadingPreorder
 837 .br

 838 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\&.
 839 .TP
 840 -XX:+TraceClassResolution
 841 .br

 842 Enables tracing of constant pool resolutions\&. By default, this option is disabled and constant pool resolutions are not traced\&.
 843 .TP
 844 -XX:+TraceClassUnloading
 845 .br

 846 Enables tracing of classes as they are unloaded\&. By default, this option is disabled and classes are not traced\&.
 847 .TP
 848 -XX:+TraceLoaderConstraints
 849 .br

 850 Enables tracing of the loader constraints recording\&. By default, this option is disabled and loader constraints recording is not traced\&.
 851 .TP
 852 -XX:+UseAltSigs
 853 .br
 854 Enables the use of alternative signals instead of \f3SIGUSR1\fR and \f3SIGUSR2\fR for JVM internal signals\&. By default, this option is disabled and alternative signals are not used\&. This option is equivalent to \f3-Xusealtsigs\fR\&.
 855 .TP
 856 -XX:-UseBiasedLocking
 857 .br
 858 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
 859 







 860 By default, this option is enabled\&.
 861 .TP
 862 -XX:-UseCompressedOops
 863 .br
 864 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\&.
 865 
 866 It is also possible to use compressed pointers when Java heap sizes are greater than 32GB\&. See the \f3-XX:ObjectAlignmentInBytes\fR option\&.
 867 .TP
 868 -XX:+UseHugeTLBFS
 869 .br
 870 This option for Linux is the equivalent of specifying \f3-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 \f3-XX:UseTransparentHugePages\fR if you want this behavior\&.
 871 
 872 For more information, see Large Pages\&.
 873 .TP
 874 -XX:+UseLargePages
 875 .br








 876 Enables the use of large page memory\&. By default, this option is disabled and large page memory is not used\&.
 877 
 878 For more information, see Large Pages\&.
 879 .TP
 880 -XX:+UseMembar
 881 .br

 882 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\&.)
 883 .TP
 884 -XX:+UsePerfData
 885 .br
 886 Enables the \f3perfdata\fR feature\&. This option is enabled by default to allow JVM monitoring and performance testing\&. Disabling it suppresses the creation of the \f3hsperfdata_userid\fR directories\&. To disable the \f3perfdata\fR feature, specify \f3-XX:-UsePerfData\fR\&.
 887 .TP
 888 -XX:+UseTransparentHugePages
 889 .br









 890 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\&.
 891 
 892 For more information, see Large Pages\&.
 893 .TP
 894 -XX:+AllowUserSignalHandlers
 895 .br

 896 Enables installation of signal handlers by the application\&. By default, this option is disabled and the application is not allowed to install signal handlers\&.
 897 .SS ADVANCED\ JIT\ COMPILER\ OPTIONS    
 898 These options control the dynamic just-in-time (JIT) compilation performed by the Java HotSpot VM\&.
 899 .TP
 900 -XX:+AggressiveOpts
 901 .br


 902 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\&.
 903 .TP
 904 -XX:AllocateInstancePrefetchLines=\fIlines\fR
 905 .br

 906 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:
 907 .sp     



 908 .nf     
 909 \f3\-XX:AllocateInstancePrefetchLines=1\fP
 910 .fi     
 911 .nf     
 912 \f3\fP
 913 .fi     
 914 .sp     
 915 
 916 



 917 Only the Java HotSpot Server VM supports this option\&.
 918 .TP
 919 -XX:AllocatePrefetchDistance=\fIsize\fR
 920 .br

 921 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\&.
 922 
 923 Negative values denote that prefetch distance is chosen based on the platform\&. Positive values are bytes to prefetch\&. Append the letter \f3k\fR or \f3K\fR to indicate kilobytes, \f3m\fR or \f3M\fR to indicate megabytes, \f3g\fR or \f3G\fR to indicate gigabytes\&. The default value is set to -1\&.
 924 












 925 The following example shows how to set the prefetch distance to 1024 bytes:
 926 .sp     



 927 .nf     
 928 \f3\-XX:AllocatePrefetchDistance=1024\fP
 929 .fi     
 930 .nf     
 931 \f3\fP
 932 .fi     
 933 .sp     
 934 
 935 



 936 Only the Java HotSpot Server VM supports this option\&.
 937 .TP
 938 -XX:AllocatePrefetchInstr=\fIinstruction\fR
 939 .br

 940 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:
 941 .sp     



 942 .nf     
 943 \f3\-XX:AllocatePrefetchInstr=0\fP
 944 .fi     
 945 .nf     
 946 \f3\fP
 947 .fi     
 948 .sp     
 949 
 950 



 951 Only the Java HotSpot Server VM supports this option\&.
 952 .TP
 953 -XX:AllocatePrefetchLines=\fIlines\fR
 954 .br

 955 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\&.
 956 
 957 The following example shows how to set the number of loaded cache lines to 5:
 958 .sp     



 959 .nf     
 960 \f3\-XX:AllocatePrefetchLines=5\fP
 961 .fi     
 962 .nf     
 963 \f3\fP
 964 .fi     
 965 .sp     
 966 
 967 



 968 Only the Java HotSpot Server VM supports this option\&.
 969 .TP
 970 -XX:AllocatePrefetchStepSize=\fIsize\fR
 971 .br
 972 Sets the step size (in bytes) for sequential prefetch instructions\&. Append the letter \f3k\fR or \f3K\fR to indicate kilobytes, \f3m\fR or \f3M\fR to indicate megabytes, \f3g\fR or \f3G\fR to indicate gigabytes\&. By default, the step size is set to 16 bytes:













 973 .sp     



 974 .nf     
 975 \f3\-XX:AllocatePrefetchStepSize=16\fP
 976 .fi     
 977 .nf     
 978 \f3\fP
 979 .fi     
 980 .sp     
 981 
 982 



 983 Only the Java HotSpot Server VM supports this option\&.
 984 .TP
 985 -XX:AllocatePrefetchStyle=\fIstyle\fR
 986 .br
 987 Sets the generated code style for prefetch instructions\&. The \fIstyle\fR argument is an integer from 0 to 3:
 988 .RS     
 989 .TP     


 990 0

 991 Do not generate prefetch instructions\&.
 992 .TP     

 993 1

 994 Execute prefetch instructions after each allocation\&. This is the default parameter\&.
 995 .TP     

 996 2
 997 Use the thread-local allocation block (TLAB) watermark pointer to determine when prefetch instructions are executed\&.
 998 .TP     


 999 3

1000 Use BIS instruction on SPARC for allocation prefetch\&.
1001 .RE     
1002 
1003 
1004 Only the Java HotSpot Server VM supports this option\&.
1005 .TP
1006 -XX:+BackgroundCompilation
1007 .br
1008 Enables background compilation\&. This option is enabled by default\&. To disable background compilation, specify \f3-XX:-BackgroundCompilation\fR (this is equivalent to specifying \f3-Xbatch\fR)\&.
1009 .TP
1010 -XX:CICompilerCount=\fIthreads\fR
1011 .br





1012 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:
1013 .sp     



1014 .nf     
1015 \f3\-XX:CICompilerCount=2\fP

1016 .fi     
1017 .nf     
1018 \f3\fP
1019 .fi     

















1020 .sp     
1021 
1022 .TP
1023 -XX:CodeCacheMinimumFreeSpace=\fIsize\fR
1024 .br
1025 Sets the minimum free space (in bytes) required for compilation\&. Append the letter \f3k\fR or \f3K\fR to indicate kilobytes, \f3m\fR or \f3M\fR to indicate megabytes, \f3g\fR or \f3G\fR 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:
1026 .sp     
1027 .nf     
1028 \f3\-XX:CodeCacheMinimumFreeSpace=1024m\fP

1029 .fi     
1030 .nf     
1031 \f3\fP
1032 .fi     









1033 .sp     
1034 
1035 .TP
1036 -XX:CompileCommand=\fIcommand\fR,\fImethod\fR[,\fIoption\fR]
1037 .br
1038 Specifies a command to perform on a method\&. For example, to exclude the \f3indexOf()\fR method of the \f3String\fR class from being compiled, use the following:
1039 .sp     
1040 .nf     
1041 \f3\-XX:CompileCommand=exclude,java/lang/String\&.indexOf\fP

1042 .fi     
1043 .nf     
1044 \f3\fP
1045 .fi     





1046 .sp     
1047 
1048 
1049 Note that the full class name is specified, including all packages and subpackages separated by a slash (\f3/\fR)\&. For easier cut and paste operations, it is also possible to use the method name format produced by the \f3-XX:+PrintCompilation\fR and \f3-XX:+LogCompilation\fR options:
1050 .sp     
1051 .nf     
1052 \f3\-XX:CompileCommand=exclude,java\&.lang\&.String::indexOf\fP

1053 .fi     
1054 .nf     
1055 \f3\fP
1056 .fi     





1057 .sp     
1058 
1059 
1060 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 \f3indexOf(String)\fR method of the \f3String\fR class from being compiled, use the following:
1061 .sp     
1062 .nf     
1063 \f3\-XX:CompileCommand="exclude,java/lang/String\&.indexOf,(Ljava/lang/String;)I"\fP

1064 .fi     
1065 .nf     
1066 \f3\fP
1067 .fi     



1068 .sp     
1069 
1070 
1071 You can also use the asterisk (*) as a wildcard for class and method names\&. For example, to exclude all \f3indexOf()\fR methods in all classes from being compiled, use the following:
1072 .sp     
1073 .nf     
1074 \f3\-XX:CompileCommand=exclude,*\&.indexOf\fP

1075 .fi     
1076 .nf     
1077 \f3\fP
1078 .fi     



1079 .sp     
1080 
1081 
1082 The commas and periods are aliases for spaces, making it easier to pass compiler commands through a shell\&. You can pass arguments to \f3-XX:CompileCommand\fR using spaces as separators by enclosing the argument in quotation marks:
1083 .sp     
1084 .nf     
1085 \f3\-XX:CompileCommand="exclude java/lang/String indexOf"\fP

1086 .fi     
1087 .nf     
1088 \f3\fP
1089 .fi     







1090 .sp     
1091 
1092 
1093 Note that after parsing the commands passed on the command line using the \f3-XX:CompileCommand\fR options, the JIT compiler then reads commands from the \f3\&.hotspot_compiler\fR file\&. You can add commands to this file or specify a different file using the \f3-XX:CompileCommandFile\fR option\&.
1094 
1095 To add several commands, either specify the \f3-XX:CompileCommand\fR option multiple times, or separate each argument with the newline separator (\f3\en\fR)\&. The following commands are available:
1096 .RS     
1097 .TP     
1098 break

1099 Set a breakpoint when debugging the JVM to stop at the beginning of compilation of the specified method\&.
1100 .TP     

1101 compileonly
1102 Exclude all methods from compilation except for the specified method\&. As an alternative, you can use the \f3-XX:CompileOnly\fR option, which allows to specify several methods\&.
1103 .TP     




1104 dontinline

1105 Prevent inlining of the specified method\&.
1106 .TP     

1107 exclude

1108 Exclude the specified method from compilation\&.
1109 .TP     

1110 help
1111 Print a help message for the \f3-XX:CompileCommand\fR option\&.
1112 .TP     




1113 inline

1114 Attempt to inline the specified method\&.
1115 .TP     

1116 log
1117 Exclude compilation logging (with the \f3-XX:+LogCompilation\fR option) for all methods except for the specified method\&. By default, logging is performed for all compiled methods\&.
1118 .TP     




1119 option
1120 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 \f3BlockLayoutByFrequency\fR option for the \f3append()\fR method of the \f3StringBuffer\fR class, use the following:







1121 .sp     



1122 .nf     
1123 \f3\-XX:CompileCommand=option,java/lang/StringBuffer\&.append,BlockLayoutByFrequency\fP
1124 .fi     
1125 .nf     
1126 \f3\fP
1127 .fi     
1128 .sp     
1129 
1130 



1131 You can specify multiple compilation options, separated by commas or spaces\&.
1132 .TP     

1133 print

1134 Print generated assembler code after compilation of the specified method\&.
1135 .TP     

1136 quiet
1137 Do not print the compile commands\&. By default, the commands that you specify with the -\f3XX:CompileCommand\fR option are printed; for example, if you exclude from compilation the \f3indexOf()\fR method of the \f3String\fR class, then the following will be printed to standard output:






1138 .sp     



1139 .nf     
1140 \f3CompilerOracle: exclude java/lang/String\&.indexOf\fP
1141 .fi     
1142 .nf     
1143 \f3\fP
1144 .fi     
1145 .sp     
1146 
1147 
1148 You can suppress this by specifying the \f3-XX:CompileCommand=quiet\fR option before other \f3-XX:CompileCommand\fR options\&.
1149 .RE     
1150 
1151 .TP
1152 -XX:CompileCommandFile=\fIfilename\fR
1153 .br
1154 Sets the file from which JIT compiler commands are read\&. By default, the \f3\&.hotspot_compiler\fR file is used to store commands performed by the JIT compiler\&.
1155 
1156 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 \f3toString()\fR method of the \f3String\fR class:







1157 .sp     
1158 .nf     
1159 \f3print java/lang/String toString\fP
1160 .fi     
1161 .nf     
1162 \f3\fP
1163 .fi     
1164 .sp     
1165 
1166 
1167 For more information about specifying the commands for the JIT compiler to perform on methods, see the \f3-XX:CompileCommand\fR option\&.
1168 .TP
1169 -XX:CompileOnly=\fImethods\fR
1170 .br
1171 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 \f3length()\fR method of the \f3String\fR class and the \f3size()\fR method of the \f3List\fR class, use the following:
1172 .sp     
1173 .nf     
1174 \f3\-XX:CompileOnly=java/lang/String\&.length,java/util/List\&.size\fP

1175 .fi     
1176 .nf     
1177 \f3\fP
1178 .fi     
















1179 .sp     
1180 
1181 
1182 Note that the full class name is specified, including all packages and subpackages separated by a slash (\f3/\fR)\&. For easier cut and paste operations, it is also possible to use the method name format produced by the \f3-XX:+PrintCompilation\fR and \f3-XX:+LogCompilation\fR options:
1183 .sp     
1184 .nf     
1185 \f3\-XX:CompileOnly=java\&.lang\&.String::length,java\&.util\&.List::size\fP

1186 .fi     
1187 .nf     
1188 \f3\fP
1189 .fi     





1190 .sp     





1191 
1192 



1193 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:
1194 .sp     



1195 .nf     
1196 \f3\-XX:CompileOnly=java/lang/String\fP



1197 .fi     
1198 .nf     
1199 \f3\-XX:CompileOnly=java/lang\fP
1200 .fi     
1201 .nf     
1202 \f3\-XX:CompileOnly=\&.length\fP
1203 .fi     
1204 .nf     
1205 \f3\fP
1206 .fi     
1207 .sp     
1208 
1209 .TP
1210 -XX:CompileThreshold=\fIinvocations\fR
1211 .br
1212 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 \f3-XX:+TieredCompilation\fR\&. The following example shows how to set the number of interpreted method invocations to 5,000:
1213 .sp     
1214 .nf     
1215 \f3\-XX:CompileThreshold=5000\fP

1216 .fi     
1217 .nf     
1218 \f3\fP
1219 .fi     


























1220 .sp     
1221 
1222 
1223 You can completely disable interpretation of Java methods before compilation by specifying the \f3-Xcomp\fR option\&.
1224 .TP
1225 -XX:+DoEscapeAnalysis
1226 .br
1227 Enables the use of escape analysis\&. This option is enabled by default\&. To disable the use of escape analysis, specify \f3-XX:-DoEscapeAnalysis\fR\&. Only the Java HotSpot Server VM supports this option\&.
1228 .TP
1229 -XX:InitialCodeCacheSize=\fIsize\fR
1230 .br
1231 Sets the initial code cache size (in bytes)\&. Append the letter \f3k\fR or \f3K\fR to indicate kilobytes, \f3m\fR or \f3M\fR to indicate megabytes, \f3g\fR or \f3G\fR to indicate gigabytes\&. The default value is set to 500 KB\&. The initial code cache size should be not less than the system\&'s minimal memory page size\&. The following example shows how to set the initial code cache size to 32 KB:
1232 .sp     
1233 .nf     
1234 \f3\-XX:InitialCodeCacheSize=32k\fP

1235 .fi     
1236 .nf     
1237 \f3\fP
1238 .fi     























1239 .sp     
1240 
1241 .TP
1242 -XX:+Inline
1243 .br
1244 Enables method inlining\&. This option is enabled by default to increase performance\&. To disable method inlining, specify \f3-XX:-Inline\fR\&.
1245 .TP
1246 -XX:InlineSmallCode=\fIsize\fR
1247 .br
1248 Sets the maximum code size (in bytes) for compiled methods that should be inlined\&. Append the letter \f3k\fR or \f3K\fR to indicate kilobytes, \f3m\fR or \f3M\fR to indicate megabytes, \f3g\fR or \f3G\fR 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:
1249 .sp     
1250 .nf     
1251 \f3\-XX:InlineSmallCode=1000\fP

1252 .fi     
1253 .nf     
1254 \f3\fP
1255 .fi     









1256 .sp     
1257 
1258 .TP
1259 -XX:+LogCompilation
1260 .br
1261 Enables logging of compilation activity to a file named \f3hotspot\&.log\fR in the current working directory\&. You can specify a different log file path and name using the \f3-XX:LogFile\fR option\&.
1262 
1263 By default, this option is disabled and compilation activity is not logged\&. The \f3-XX:+LogCompilation\fR option has to be used together with the \f3-XX:UnlockDiagnosticVMOptions\fR option that unlocks diagnostic JVM options\&.
1264 
1265 You can enable verbose diagnostic output with a message printed to the console every time a method is compiled by using the \f3-XX:+PrintCompilation\fR option\&.
1266 .TP
1267 -XX:MaxInlineSize=\fIsize\fR
1268 .br
1269 Sets the maximum bytecode size (in bytes) of a method to be inlined\&. Append the letter \f3k\fR or \f3K\fR to indicate kilobytes, \f3m\fR or \f3M\fR to indicate megabytes, \f3g\fR or \f3G\fR to indicate gigabytes\&. By default, the maximum bytecode size is set to 35 bytes:
1270 .sp     
1271 .nf     
1272 \f3\-XX:MaxInlineSize=35\fP
1273 .fi     
1274 .nf     
1275 \f3\fP
1276 .fi     














1277 .sp     





1278 
1279 .TP
1280 -XX:MaxNodeLimit=\fInodes\fR
1281 .br





1282 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:
1283 .sp     



1284 .nf     
1285 \f3\-XX:MaxNodeLimit=65000\fP

1286 .fi     
1287 .nf     
1288 \f3\fP
1289 .fi     

















1290 .sp     
1291 
1292 .TP
1293 -XX:MaxTrivialSize=\fIsize\fR
1294 .br
1295 Sets the maximum bytecode size (in bytes) of a trivial method to be inlined\&. Append the letter \f3k\fR or \f3K\fR to indicate kilobytes, \f3m\fR or \f3M\fR to indicate megabytes, \f3g\fR or \f3G\fR to indicate gigabytes\&. By default, the maximum bytecode size of a trivial method is set to 6 bytes:
1296 .sp     
1297 .nf     
1298 \f3\-XX:MaxTrivialSize=6\fP

1299 .fi     
1300 .nf     
1301 \f3\fP
1302 .fi     

















1303 .sp     
1304 
1305 .TP
1306 -XX:+OptimizeStringConcat
1307 .br
1308 Enables the optimization of \f3String\fR concatenation operations\&. This option is enabled by default\&. To disable the optimization of \f3String\fR concatenation operations, specify \f3-XX:-OptimizeStringConcat\fR\&. Only the Java HotSpot Server VM supports this option\&.
1309 .TP
1310 -XX:+PrintAssembly
1311 .br
1312 Enables printing of assembly code for bytecoded and native methods by using the external \f3disassembler\&.so\fR library\&. This enables you to see the generated code, which may help you to diagnose performance issues\&.
1313 
1314 By default, this option is disabled and assembly code is not printed\&. The \f3-XX:+PrintAssembly\fR option has to be used together with the \f3-XX:UnlockDiagnosticVMOptions\fR option that unlocks diagnostic JVM options\&.
1315 .TP
1316 -XX:+PrintCompilation
1317 .br
1318 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\&.
1319 
1320 You can also log compilation activity to a file by using the \f3-XX:+LogCompilation\fR option\&.
1321 .TP
1322 -XX:+PrintInlining
1323 .br



1324 Enables printing of inlining decisions\&. This enables you to see which methods are getting inlined\&.
1325 
1326 By default, this option is disabled and inlining information is not printed\&. The \f3-XX:+PrintInlining\fR option has to be used together with the \f3-XX:+UnlockDiagnosticVMOptions\fR option that unlocks diagnostic JVM options\&.
1327 .TP
1328 -XX:ReservedCodeCacheSize=\fIsize\fR
1329 .br
1330 Sets the maximum code cache size (in bytes) for JIT-compiled code\&. Append the letter \f3k\fR or \f3K\fR to indicate kilobytes, \f3m\fR or \f3M\fR to indicate megabytes, \f3g\fR or \f3G\fR to indicate gigabytes\&. 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 \f3-XX:InitialCodeCacheSize\fR\&. This option is equivalent to \f3-Xmaxjitcodesize\fR\&.
1331 .TP
1332 -XX:RTMAbortRatio=\fIabort_ratio\fR
1333 .br
1334 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 \f3-XX:+UseRTMDeopt\fR 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\&.
1335 .TP
1336 -XX:RTMRetryCount=\fInumber_of_retries\fR
1337 .br
1338 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 \f3-XX:UseRTMLocking\fR option must be enabled\&.
1339 .TP
1340 -XX:+TieredCompilation
1341 .br
1342 Enables the use of tiered compilation\&. By default, this option is enabled\&. Only the Java HotSpot Server VM supports this option\&.
1343 .TP
1344 -XX:+UseAES
1345 .br
1346 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\&.
1347 .TP
1348 -XX:+UseAESIntrinsics
1349 .br
1350 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 \f3-XX:-UseAES -XX:-UseAESIntrinsics\fR\&. For example, to enable hardware AES, use the following flags:
1351 .sp     
1352 .nf     
1353 \f3\-XX:+UseAES \-XX:+UseAESIntrinsics\fP
1354 .fi     
1355 .nf     
1356 \f3\fP
1357 .fi     

















































1358 .sp     





1359 
1360 
1361 To support UseAES and UseAESIntrinsics flags for 32-bit and 64-bit use \f3-server\fR option to choose Java HotSpot Server VM\&. These flags are not supported on Client VM\&.
1362 .TP
1363 -XX:+UseCodeCacheFlushing
1364 .br
1365 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 \f3-XX:-UseCodeCacheFlushing\fR\&.
1366 .TP
1367 -XX:+UseCondCardMark
1368 .br








1369 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\&.
1370 .TP
1371 -XX:+UseRTMDeopt
1372 .br
1373 Auto-tunes RTM locking depending on the abort ratio\&. This ratio is specified by \f3-XX:RTMAbortRatio\fR 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 \f3-XX:+UseRTMLocking\fR option must be enabled\&.
1374 .TP
1375 -XX:+UseRTMLocking
1376 .br






1377 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)\&.
1378 
1379 RTM is part of Intel\&'s TSX, which is an x86 instruction set extension and facilitates the creation of multithreaded applications\&. RTM introduces the new instructions \f3XBEGIN\fR, \f3XABORT\fR, \f3XEND\fR, and \f3XTEST\fR\&. The \f3XBEGIN\fR and \f3XEND\fR 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 \f3XEND\fR instruction\&. The \f3XABORT\fR instruction can be used to explicitly abort a transaction and the \f3XEND\fR instruction to check if a set of instructions are being run in a transaction\&.
1380 
1381 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\&'s system\&.
1382 
1383 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\&.
1384 .TP
1385 -XX:+UseSHA
1386 .br
1387 Enables hardware-based intrinsics for SHA crypto hash functions for SPARC hardware\&. \f3UseSHA\fR is used in conjunction with the \f3UseSHA1Intrinsics\fR, \f3UseSHA256Intrinsics\fR, and \f3UseSHA512Intrinsics\fR options\&.
1388 
1389 The \f3UseSHA\fR and \f3UseSHA*Intrinsics\fR flags are enabled by default, and are supported only for Java HotSpot Server VM 64-bit on SPARC T4 and newer\&.
1390 
1391 This feature is only applicable when using the \f3sun\&.security\&.provider\&.Sun\fR provider for SHA operations\&.
1392 
1393 To disable all hardware-based SHA intrinsics, specify \f3-XX:-UseSHA\fR\&. To disable only a particular SHA intrinsic, use the appropriate corresponding option\&. For example: \f3-XX:-UseSHA256Intrinsics\fR\&.
1394 .TP
1395 -XX:+UseSHA1Intrinsics
1396 .br
1397 Enables intrinsics for SHA-1 crypto hash function\&.
1398 .TP
1399 -XX:+UseSHA256Intrinsics
1400 .br
1401 Enables intrinsics for SHA-224 and SHA-256 crypto hash functions\&.
1402 .TP
1403 -XX:+UseSHA512Intrinsics
1404 .br
1405 Enables intrinsics for SHA-384 and SHA-512 crypto hash functions\&.
1406 .TP
1407 -XX:+UseSuperWord
1408 .br
1409 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 \f3-XX:-UseSuperWord\fR\&. Only the Java HotSpot Server VM supports this option\&.
1410 .SS ADVANCED\ SERVICEABILITY\ OPTIONS    




































1411 These options provide the ability to gather system information and perform extensive debugging\&.
1412 .TP
1413 -XX:+ExtendedDTraceProbes
1414 .br
1415 Enables additional \f3dtrace\fR tool probes that impact the performance\&. By default, this option is disabled and \f3dtrace\fR performs only standard probes\&.
1416 .TP
1417 -XX:+HeapDumpOnOutOfMemory
1418 .br
1419 Enables the dumping of the Java heap to a file in the current directory by using the heap profiler (HPROF) when a \f3java\&.lang\&.OutOfMemoryError\fR exception is thrown\&. You can explicitly set the heap dump file path and name using the \f3-XX:HeapDumpPath\fR option\&. By default, this option is disabled and the heap is not dumped when an \f3OutOfMemoryError\fR exception is thrown\&.
1420 .TP
1421 -XX:HeapDumpPath=\fIpath\fR
1422 .br
1423 Sets the path and file name for writing the heap dump provided by the heap profiler (HPROF) when the \f3-XX:+HeapDumpOnOutOfMemoryError\fR option is set\&. By default, the file is created in the current working directory, and it is named \f3java_pid\fR\fIpid\fR\f3\&.hprof\fR where \fIpid\fR is the identifier of the process that caused the error\&. The following example shows how to set the default file explicitly (\f3%p\fR represents the current process identificator):



















1424 .sp     



1425 .nf     
1426 \f3\-XX:HeapDumpPath=\&./java_pid%p\&.hprof\fP

1427 .fi     









1428 .nf     
1429 \f3\fP

1430 .fi     









1431 .sp     
1432 
1433 
1434 \fI\fRThe following example shows how to set the heap dump file to \f3/var/log/java/java_heapdump\&.hprof\fR:
1435 .sp     



1436 .nf     
1437 \f3\-XX:HeapDumpPath=/var/log/java/java_heapdump\&.hprof\fP

1438 .fi     
1439 .nf     
1440 \f3\fP
1441 .fi     







1442 .sp     
1443 
1444 .TP
1445 -XX:LogFile=\fIpath\fR
1446 .br
1447 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 \f3hotspot\&.log\fR\&.
1448 
1449 \fI\fRThe following example shows how to set the log file to \f3/var/log/java/hotspot\&.log\fR:





1450 .sp     
1451 .nf     
1452 \f3\-XX:LogFile=/var/log/java/hotspot\&.log\fP
1453 .fi     
1454 .nf     
1455 \f3\fP
1456 .fi     
1457 .sp     
1458 
1459 .TP
1460 -XX:+PrintClassHistogram
1461 .br
1462 \fI\fREnables printing of a class instance histogram after a \f3Control+C\fR event (\f3SIGTERM\fR)\&. By default, this option is disabled\&.
1463 
1464 Setting this option is equivalent to running the \f3jmap -histo\fR command, or the \f3jcmd\fR\fIpid\fR\f3GC\&.class_histogram\fR command, where \fIpid\fR is the current Java process identifier\&.
1465 .TP     
1466 -XX:+PrintConcurrentLocks
1467 
1468 
1469 Enables printing of \f3java\&.util\&.concurrent\fR locks after a \f3Control+C\fR event (\f3SIGTERM\fR)\&. By default, this option is disabled\&.
1470 
1471 Setting this option is equivalent to running the \f3jstack -l\fR command or the \f3jcmd\fR\fIpid\fR\f3Thread\&.print -l\fR command, where \fIpid\fR is the current Java process identifier\&.
1472 .TP
1473 -XX:+UnlockDiagnosticVMOptions
1474 .br
1475 Unlocks the options intended for diagnosing the JVM\&. By default, this option is disabled and diagnostic options are not available\&.
1476 .SS ADVANCED\ GARBAGE\ COLLECTION\ OPTIONS    


1477 These options control how garbage collection (GC) is performed by the Java HotSpot VM\&.
1478 .TP
1479 -XX:+AggressiveHeap
1480 .br
1481 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\&.
1482 .TP
1483 -XX:+AlwaysPreTouch
1484 .br
1485 Enables touching of every page on the Java heap during JVM initialization\&. This gets all pages into the memory before entering the \f3main()\fR 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\&.
1486 .TP
1487 -XX:+CMSClassUnloadingEnabled
1488 .br
1489 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 \f3-XX:-CMSClassUnloadingEnabled\fR\&.
1490 .TP
1491 -XX:CMSExpAvgFactor=\fIpercent\fR
1492 .br






1493 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%:
1494 .sp     



1495 .nf     
1496 \f3\-XX:CMSExpAvgFactor=15\fP

1497 .fi     
1498 .nf     
1499 \f3\fP
1500 .fi     







1501 .sp     
1502 
1503 .TP
1504 -XX:CMSInitiatingOccupancyFraction=\fIpercent\fR
1505 .br
1506 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 \f3-XX:CMSTriggerRatio\fR is used to define the value of the initiating occupancy fraction\&.
1507 
1508 The following example shows how to set the occupancy fraction to 20%:
1509 .sp     



1510 .nf     
1511 \f3\-XX:CMSInitiatingOccupancyFraction=20\fP
1512 .fi     
1513 .nf     
1514 \f3\fP
1515 .fi     
1516 .sp     
1517 
1518 .TP
1519 -XX:+CMSScavengeBeforeRemark
1520 .br





1521 Enables scavenging attempts before the CMS remark step\&. By default, this option is disabled\&.
1522 .TP
1523 -XX:CMSTriggerRatio=\fIpercent\fR
1524 .br
1525 Sets the percentage (0 to 100) of the value specified by \f3-XX:MinHeapFreeRatio\fR that is allocated before a CMS collection cycle commences\&. The default value is set to 80%\&.
1526 



1527 The following example shows how to set the occupancy fraction to 75%:
1528 .sp     



1529 .nf     
1530 \f3\-XX:CMSTriggerRatio=75\fP
1531 .fi     
1532 .nf     
1533 \f3\fP
1534 .fi     
1535 .sp     
1536 
1537 .TP
1538 -XX:ConcGCThreads=\fIthreads\fR
1539 .br





1540 Sets the number of threads used for concurrent GC\&. The default value depends on the number of CPUs available to the JVM\&.
1541 
1542 For example, to set the number of threads for concurrent GC to 2, specify the following option:
1543 .sp     



1544 .nf     
1545 \f3\-XX:ConcGCThreads=2\fP

1546 .fi     
1547 .nf     
1548 \f3\fP
1549 .fi     

































1550 .sp     
1551 
1552 .TP
1553 -XX:+DisableExplicitGC
1554 .br
1555 Enables the option that disables processing of calls to \f3System\&.gc()\fR\&. This option is disabled by default, meaning that calls to \f3System\&.gc()\fR are processed\&. If processing of calls to \f3System\&.gc()\fR is disabled, the JVM still performs GC when necessary\&.
1556 .TP
1557 -XX:+ExplicitGCInvokesConcurrent
1558 .br
1559 Enables invoking of concurrent GC by using the \f3System\&.gc()\fR request\&. This option is disabled by default and can be enabled only together with the \f3-XX:+UseConcMarkSweepGC\fR option\&.
1560 .TP
1561 -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses
1562 .br
1563 Enables invoking of concurrent GC by using the \f3System\&.gc()\fR request and unloading of classes during the concurrent GC cycle\&. This option is disabled by default and can be enabled only together with the \f3-XX:+UseConcMarkSweepGC\fR option\&.
1564 .TP
1565 -XX:G1HeapRegionSize=\fIsize\fR
1566 .br
1567 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\&.
1568 
1569 The following example shows how to set the size of the subdivisions to 16 MB:
1570 .sp     



1571 .nf     
1572 \f3\-XX:G1HeapRegionSize=16m\fP
1573 .fi     
1574 .nf     
1575 \f3\fP
1576 .fi     
1577 .sp     
1578 
1579 .TP
1580 -XX:+G1PrintHeapRegions
1581 .br





1582 Enables the printing of information about which regions are allocated and which are reclaimed by the G1 collector\&. By default, this option is disabled\&.
1583 .TP
1584 -XX:G1ReservePercent=\fIpercent\fR
1585 .br

1586 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%\&.
1587 
1588 The following example shows how to set the reserved heap to 20%:
1589 .sp     



1590 .nf     
1591 \f3\-XX:G1ReservePercent=20\fP

1592 .fi     
1593 .nf     
1594 \f3\fP
1595 .fi     



















1596 .sp     
1597 
1598 .TP
1599 -XX:InitialHeapSize=\fIsize\fR
1600 .br
1601 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 \f3k\fR or \f3K\fR to indicate kilobytes, \f3m\fR or \f3M\fR to indicate megabytes, \f3g\fR or \f3G\fR to indicate gigabytes\&. The default value is chosen at runtime based on system configuration\&. See the section "Ergonomics" in \fIJava SE HotSpot Virtual Machine Garbage Collection Tuning Guide\fR at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gctuning/index\&.html\&.
1602 
1603 The following examples show how to set the size of allocated memory to 6 MB using various units:
1604 .sp     



1605 .nf     
1606 \f3\-XX:InitialHeapSize=6291456\fP



1607 .fi     
1608 .nf     
1609 \f3\-XX:InitialHeapSize=6144k\fP
1610 .fi     
1611 .nf     
1612 \f3\-XX:InitialHeapSize=6m\fP
1613 .fi     
1614 .nf     
1615 \f3\fP
1616 .fi     













1617 .sp     
1618 
1619 
1620 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 \f3-XX:NewSize\fR option\&.
1621 .TP
1622 -XX:InitialSurvivorRatio=\fIratio\fR
1623 .br
1624 Sets the initial survivor space ratio used by the throughput garbage collector (which is enabled by the \f3-XX:+UseParallelGC\fR and/or -\f3XX:+UseParallelOldGC\fR options)\&. Adaptive sizing is enabled by default with the throughput garbage collector by using the \f3-XX:+UseParallelGC\fR and \f3-XX:+UseParallelOldGC\fR options, and survivor space is resized according to the application behavior, starting with the initial value\&. If adaptive sizing is disabled (using the \f3-XX:-UseAdaptiveSizePolicy\fR option), then the \f3-XX:SurvivorRatio\fR option should be used to set the size of the survivor space for the entire execution of the application\&.
1625 
1626 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):
1627 .sp     



1628 .nf     
1629 \f3S=Y/(R+2)\fP
1630 .fi     
1631 .nf     
1632 \f3\fP
1633 .fi     
1634 .sp     
1635 
1636 



1637 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\&.
1638 
1639 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\&.
1640 
1641 The following example shows how to set the initial survivor space ratio to 4:
1642 .sp     



1643 .nf     
1644 \f3\-XX:InitialSurvivorRatio=4\fP
1645 .fi     
1646 .nf     
1647 \f3\fP
1648 .fi     
1649 .sp     
1650 
1651 .TP
1652 -XX:InitiatingHeapOccupancyPercent=\fIpercent\fR
1653 .br





1654 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)\&.
1655 
1656 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%:
1657 .sp     



1658 .nf     
1659 \f3\-XX:InitiatingHeapOccupancyPercent=75\fP
1660 .fi     
1661 .nf     
1662 \f3\fP
1663 .fi     
1664 .sp     
1665 
1666 .TP
1667 -XX:MaxGCPauseMillis=\fItime\fR
1668 .br





1669 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\&.
1670 
1671 The following example shows how to set the maximum target pause time to 500 ms:
1672 .sp     



1673 .nf     
1674 \f3\-XX:MaxGCPauseMillis=500\fP

1675 .fi     
1676 .nf     
1677 \f3\fP
1678 .fi     























1679 .sp     
1680 
1681 .TP
1682 -XX:MaxHeapSize=\fIsize\fR
1683 .br
1684 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 \f3k\fR or \f3K\fR to indicate kilobytes, \f3m\fR or \f3M\fR to indicate megabytes, \f3g\fR or \f3G\fR to indicate gigabytes\&. The default value is chosen at runtime based on system configuration\&. For server deployments, \f3-XX:InitialHeapSize\fR and \f3-XX:MaxHeapSize\fR are often set to the same value\&. See the section "Ergonomics" in \fIJava SE HotSpot Virtual Machine Garbage Collection Tuning Guide\fR at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gctuning/index\&.html\&.
1685 
1686 The following examples show how to set the maximum allowed size of allocated memory to 80 MB using various units:
1687 .sp     



1688 .nf     
1689 \f3\-XX:MaxHeapSize=83886080\fP
1690 .fi     
1691 .nf     
1692 \f3\-XX:MaxHeapSize=81920k\fP
1693 .fi     
1694 .nf     
1695 \f3\-XX:MaxHeapSize=80m\fP
1696 .fi     
1697 .nf     
1698 \f3\fP
1699 .fi     
1700 .sp     
1701 
1702 



1703 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\&.
1704 
1705 The \f3-XX:MaxHeapSize\fR option is equivalent to \f3-Xmx\fR\&.
1706 .TP
1707 -XX:MaxHeapFreeRatio=\fIpercent\fR
1708 .br




1709 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%\&.
1710 
1711 The following example shows how to set the maximum free heap ratio to 75%:
1712 .sp     



1713 .nf     
1714 \f3\-XX:MaxHeapFreeRatio=75\fP
1715 .fi     
1716 .nf     
1717 \f3\fP
1718 .fi     
1719 .sp     
1720 
1721 .TP
1722 -XX:MaxMetaspaceSize=\fIsize\fR
1723 .br





1724 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\&.
1725 
1726 The following example shows how to set the maximum class metadata size to 256 MB:
1727 .sp     



1728 .nf     
1729 \f3\-XX:MaxMetaspaceSize=256m\fP
1730 .fi     
1731 .nf     
1732 \f3\fP
1733 .fi     
1734 .sp     
1735 
1736 .TP
1737 -XX:MaxNewSize=\fIsize\fR
1738 .br





1739 Sets the maximum size (in bytes) of the heap for the young generation (nursery)\&. The default value is set ergonomically\&.
1740 .TP
1741 -XX:MaxTenuringThreshold=\fIthreshold\fR
1742 .br

1743 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\&.
1744 
1745 The following example shows how to set the maximum tenuring threshold to 10:
1746 .sp     



1747 .nf     
1748 \f3\-XX:MaxTenuringThreshold=10\fP
1749 .fi     
1750 .nf     
1751 \f3\fP
1752 .fi     
1753 .sp     
1754 
1755 .TP
1756 -XX:MetaspaceSize=\fIsize\fR
1757 .br





1758 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\&.
1759 .TP
1760 -XX:MinHeapFreeRatio=\fIpercent\fR
1761 .br

1762 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%\&.
1763 
1764 The following example shows how to set the minimum free heap ratio to 25%:
1765 .sp     



1766 .nf     
1767 \f3\-XX:MinHeapFreeRatio=25\fP
1768 .fi     
1769 .nf     
1770 \f3\fP
1771 .fi     
1772 .sp     
1773 
1774 .TP
1775 -XX:NewRatio=\fIratio\fR
1776 .br





1777 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:
1778 .sp     



1779 .nf     
1780 \f3\-XX:NewRatio=1\fP

1781 .fi     
1782 .nf     
1783 \f3\fP
1784 .fi     

















1785 .sp     
1786 
1787 .TP
1788 -XX:NewSize=\fIsize\fR
1789 .br
1790 Sets the initial size (in bytes) of the heap for the young generation (nursery)\&. Append the letter \f3k\fR or \f3K\fR to indicate kilobytes, \f3m\fR or \f3M\fR to indicate megabytes, \f3g\fR or \f3G\fR to indicate gigabytes\&.
1791 
1792 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\&.
1793 
1794 The following examples show how to set the initial size of young generation to 256 MB using various units:
1795 .sp     



1796 .nf     
1797 \f3\-XX:NewSize=256m\fP
1798 .fi     
1799 .nf     
1800 \f3\-XX:NewSize=262144k\fP
1801 .fi     
1802 .nf     
1803 \f3\-XX:NewSize=268435456\fP
1804 .fi     
1805 .nf     
1806 \f3\fP
1807 .fi     
1808 .sp     
1809 
1810 
1811 The \f3-XX:NewSize\fR option is equivalent to \f3-Xmn\fR\&.
1812 .TP
1813 -XX:ParallelGCThreads=\fIthreads\fR
1814 .br







1815 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\&.
1816 
1817 For example, to set the number of threads for parallel GC to 2, specify the following option:
1818 .sp     



1819 .nf     
1820 \f3\-XX:ParallelGCThreads=2\fP
1821 .fi     
1822 .nf     
1823 \f3\fP
1824 .fi     
1825 .sp     
1826 
1827 .TP
1828 -XX:+ParallelRefProcEnabled
1829 .br





1830 Enables parallel reference processing\&. By default, this option is disabled\&.
1831 .TP
1832 -XX:+PrintAdaptiveSizePolicy
1833 .br

1834 Enables printing of information about adaptive generation sizing\&. By default, this option is disabled\&.
1835 .TP
1836 -XX:+PrintGC
1837 .br

1838 Enables printing of messages at every GC\&. By default, this option is disabled\&.
1839 .TP
1840 -XX:+PrintGCApplicationConcurrentTime
1841 .br

1842 Enables printing of how much time elapsed since the last pause (for example, a GC pause)\&. By default, this option is disabled\&.
1843 .TP
1844 -XX:+PrintGCApplicationStoppedTime
1845 .br

1846 Enables printing of how much time the pause (for example, a GC pause) lasted\&. By default, this option is disabled\&.
1847 .TP
1848 -XX:+PrintGCDateStamps
1849 .br

1850 Enables printing of a date stamp at every GC\&. By default, this option is disabled\&.
1851 .TP
1852 -XX:+PrintGCDetails
1853 .br

1854 Enables printing of detailed messages at every GC\&. By default, this option is disabled\&.
1855 .TP
1856 -XX:+PrintGCTaskTimeStamps
1857 .br

1858 Enables printing of time stamps for every individual GC worker thread task\&. By default, this option is disabled\&.
1859 .TP
1860 -XX:+PrintGCTimeStamps
1861 .br

1862 Enables printing of time stamps at every GC\&. By default, this option is disabled\&.
1863 .TP
1864 -XX:+PrintStringDeduplicationStatistics
1865 .br
1866 Prints detailed deduplication statistics\&. By default, this option is disabled\&. See the \f3-XX:+UseStringDeduplication\fR option\&.
1867 .TP
1868 -XX:+PrintTenuringDistribution
1869 .br




1870 Enables printing of tenuring age information\&. The following is an example of the output:
1871 .sp     



1872 .nf     
1873 \f3Desired survivor size 48286924 bytes, new threshold 10 (max 10)\fP
1874 .fi     
1875 .nf     
1876 \f3\- age 1: 28992024 bytes, 28992024 total\fP
1877 .fi     
1878 .nf     
1879 \f3\- age 2: 1366864 bytes, 30358888 total\fP
1880 .fi     
1881 .nf     
1882 \f3\- age 3: 1425912 bytes, 31784800 total\fP
1883 .fi     
1884 .nf     
1885 \f3\&.\&.\&.\fP
1886 .fi     
1887 .nf     
1888 \f3\fP
1889 .fi     
1890 .sp     
1891 
1892 



1893 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\&.
1894 
1895 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\&.
1896 
1897 By default, this option is disabled\&.
1898 .TP
1899 -XX:+ScavengeBeforeFullGC
1900 .br
1901 Enables GC of the young generation before each full GC\&. This option is enabled by default\&. Oracle recommends that you \fIdo not\fR 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 \f3-XX:-ScavengeBeforeFullGC\fR\&.
1902 .TP
1903 -XX:SoftRefLRUPolicyMSPerMB=\fItime\fR
1904 .br
1905 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 \f3-XX:SoftRefLRUPolicyMSPerMB\fR 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 \f3-Xmx\fR option has a significant effect on how quickly soft references are garbage collected\&.
1906 









1907 The following example shows how to set the value to 2\&.5 seconds:
1908 .sp     



1909 .nf     
1910 \f3\-XX:SoftRefLRUPolicyMSPerMB=2500\fP
1911 .fi     
1912 .nf     
1913 \f3\fP
1914 .fi     
1915 .sp     
1916 
1917 .TP
1918 -XX:StringDeduplicationAgeThreshold=\fIthreshold\fR
1919 .br
1920 \f3String\fR objects reaching the specified age are considered candidates for deduplication\&. An object\&'s age is a measure of how many times it has survived garbage collection\&. This is sometimes referred to as tenuring; see the \f3-XX:+PrintTenuringDistribution\fR option\&. Note that \f3String\fR 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 \f33\fR\&. See the \f3-XX:+UseStringDeduplication\fR option\&.
1921 .TP
1922 -XX:SurvivorRatio=\fIratio\fR
1923 .br














1924 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:
1925 .sp     



1926 .nf     
1927 \f3\-XX:SurvivorRatio=4\fP
1928 .fi     
1929 .nf     
1930 \f3\fP
1931 .fi     
1932 .sp     
1933 
1934 .TP
1935 -XX:TargetSurvivorRatio=\fIpercent\fR
1936 .br





1937 Sets the desired percentage of survivor space (0 to 100) used after young garbage collection\&. By default, this option is set to 50%\&.
1938 
1939 The following example shows how to set the target survivor space ratio to 30%:
1940 .sp     



1941 .nf     
1942 \f3\-XX:TargetSurvivorRatio=30\fP

1943 .fi     
1944 .nf     
1945 \f3\fP
1946 .fi     

















1947 .sp     
1948 
1949 .TP
1950 -XX:TLABSize=\fIsize\fR
1951 .br
1952 Sets the initial size (in bytes) of a thread-local allocation buffer (TLAB)\&. Append the letter \f3k\fR or \f3K\fR to indicate kilobytes, \f3m\fR or \f3M\fR to indicate megabytes, \f3g\fR or \f3G\fR to indicate gigabytes\&. If this option is set to 0, then the JVM chooses the initial size automatically\&.
1953 
1954 The following example shows how to set the initial TLAB size to 512 KB:
1955 .sp     



1956 .nf     
1957 \f3\-XX:TLABSize=512k\fP
1958 .fi     
1959 .nf     
1960 \f3\fP
1961 .fi     
1962 .sp     
1963 
1964 .TP
1965 -XX:+UseAdaptiveSizePolicy
1966 .br
1967 Enables the use of adaptive generation sizing\&. This option is enabled by default\&. To disable adaptive generation sizing, specify \f3-XX:-UseAdaptiveSizePolicy\fR and set the size of the memory allocation pool explicitly (see the \f3-XX:SurvivorRatio\fR option)\&.
1968 .TP
1969 -XX:+UseCMSInitiatingOccupancyOnly
1970 .br










1971 Enables the use of the occupancy value as the only criterion for initiating the CMS collector\&. By default, this option is disabled and other criteria may be used\&.
1972 .TP
1973 -XX:+UseConcMarkSweepGC
1974 .br
1975 Enables the use of the CMS garbage collector for the old generation\&. Oracle recommends that you use the CMS garbage collector when application latency requirements cannot be met by the throughput (\f3-XX:+UseParallelGC\fR) garbage collector\&. The G1 garbage collector (\f3-XX:+UseG1GC\fR) is another alternative\&.
1976 
1977 By default, this option is disabled and the collector is chosen automatically based on the configuration of the machine and type of the JVM\&. When this option is enabled, the \f3-XX:+UseParNewGC\fR option is automatically set and you should not disable it, because the following combination of options has been deprecated in JDK 8: \f3-XX:+UseConcMarkSweepGC -XX:-UseParNewGC\fR\&.
1978 .TP
1979 -XX:+UseG1GC
1980 .br
1981 Enables the use of the garbage-first (G1) garbage collector\&. It is a server-style garbage collector, targeted for multiprocessor machines with a large amount of RAM\&. It meets GC pause time goals with high probability, while maintaining good throughput\&. The G1 collector is recommended for applications requiring large heaps (sizes of around 6 GB or larger) with limited GC latency requirements (stable and predictable pause time below 0\&.5 seconds)\&.
1982 





1983 By default, this option is disabled and the collector is chosen automatically based on the configuration of the machine and type of the JVM\&.
1984 .TP
1985 -XX:+UseGCOverheadLimit
1986 .br
1987 Enables the use of a policy that limits the proportion of time spent by the JVM on GC before an \f3OutOfMemoryError\fR exception is thrown\&. This option is enabled, by default and the parallel GC will throw an \f3OutOfMemoryError\fR if more than 98% of the total time is spent on garbage collection and less than 2% of the heap is recovered\&. When the heap is small, this feature can be used to prevent applications from running for long periods of time with little or no progress\&. To disable this option, specify \f3-XX:-UseGCOverheadLimit\fR\&.
1988 .TP
1989 -XX:+UseNUMA
1990 .br
1991 Enables performance optimization of an application on a machine with nonuniform memory architecture (NUMA) by increasing the application\&'s use of lower latency memory\&. By default, this option is disabled and no optimization for NUMA is made\&. The option is only available when the parallel garbage collector is used (\f3-XX:+UseParallelGC\fR)\&.
1992 .TP
1993 -XX:+UseParallelGC
1994 .br








1995 Enables the use of the parallel scavenge garbage collector (also known as the throughput collector) to improve the performance of your application by leveraging multiple processors\&.
1996 
1997 By default, this option is disabled and the collector is chosen automatically based on the configuration of the machine and type of the JVM\&. If it is enabled, then the \f3-XX:+UseParallelOldGC\fR option is automatically enabled, unless you explicitly disable it\&.
1998 .TP
1999 -XX:+UseParallelOldGC
2000 .br
2001 Enables the use of the parallel garbage collector for full GCs\&. By default, this option is disabled\&. Enabling it automatically enables the \f3-XX:+UseParallelGC\fR option\&.
2002 .TP
2003 -XX:+UseParNewGC
2004 .br
2005 Enables the use of parallel threads for collection in the young generation\&. By default, this option is disabled\&. It is automatically enabled when you set the \f3-XX:+UseConcMarkSweepGC\fR option\&. Using the \f3-XX:+UseParNewGC\fR option without the \f3-XX:+UseConcMarkSweepGC\fR option was deprecated in JDK 8\&.
2006 .TP
2007 -XX:+UseSerialGC
2008 .br













2009 Enables the use of the serial garbage collector\&. This is generally the best choice for small and simple applications that do not require any special functionality from garbage collection\&. By default, this option is disabled and the collector is chosen automatically based on the configuration of the machine and type of the JVM\&.
2010 .TP
2011 -XX:+UseSHM
2012 .br

2013 On Linux, enables the JVM to use shared memory to setup large pages\&.
2014 
2015 For more information, see Large Pages\&.
2016 .TP
2017 -XX:+UseStringDeduplication
2018 .br
2019 Enables string deduplication\&. By default, this option is disabled\&. To use this option, you must enable the garbage-first (G1) garbage collector\&. See the \f3-XX:+UseG1GC\fR option\&.
2020 
2021 \fIString deduplication\fR reduces the memory footprint of \f3String\fR objects on the Java heap by taking advantage of the fact that many \f3String\fR objects are identical\&. Instead of each \f3String\fR object pointing to its own character array, identical \f3String\fR objects can point to and share the same character array\&.
2022 .TP
2023 -XX:+UseTLAB
2024 .br
2025 Enables the use of thread-local allocation blocks (TLABs) in the young generation space\&. This option is enabled by default\&. To disable the use of TLABs, specify \f3-XX:-UseTLAB\fR\&.
2026 .SS DEPRECATED\ AND\ REMOVED\ OPTIONS    
















2027 These options were included in the previous release, but have since been considered unnecessary\&.
2028 .TP
2029 -Xincgc
2030 .br
2031 Enables incremental garbage collection\&. This option was deprecated in JDK 8 with no replacement\&.
2032 .TP
2033 -Xrun\fIlibname\fR
2034 .br
2035 Loads the specified debugging/profiling library\&. This option was superseded by the \f3-agentlib\fR option\&.
2036 .TP
2037 -XX:CMSIncrementalDutyCycle=\fIpercent\fR
2038 .br
2039 Sets the percentage of time (0 to 100) between minor collections that the concurrent collector is allowed to run\&. This option was deprecated in JDK 8 with no replacement, following the deprecation of the \f3-XX:+CMSIncrementalMode\fR option\&.
2040 .TP
2041 -XX:CMSIncrementalDutyCycleMin=\fIpercent\fR
2042 .br
2043 Sets the percentage of time (0 to 100) between minor collections that is the lower bound for the duty cycle when \f3-XX:+CMSIncrementalPacing\fR is enabled\&. This option was deprecated in JDK 8 with no replacement, following the deprecation of the \f3-XX:+CMSIncrementalMode\fR option\&.
2044 .TP
2045 -XX:+CMSIncrementalMode
2046 .br
2047 Enables the incremental mode for the CMS collector\&. This option was deprecated in JDK 8 with no replacement, along with other options that start with \f3CMSIncremental\fR\&.
2048 .TP
2049 -XX:CMSIncrementalOffset=\fIpercent\fR
2050 .br
2051 Sets the percentage of time (0 to 100) by which the incremental mode duty cycle is shifted to the right within the period between minor collections\&. This option was deprecated in JDK 8 with no replacement, following the deprecation of the \f3-XX:+CMSIncrementalMode\fR option\&.
2052 .TP
2053 -XX:+CMSIncrementalPacing
2054 .br
2055 Enables automatic adjustment of the incremental mode duty cycle based on statistics collected while the JVM is running\&. This option was deprecated in JDK 8 with no replacement, following the deprecation of the \f3-XX:+CMSIncrementalMode\fR option\&.
2056 .TP
2057 -XX:CMSIncrementalSafetyFactor=\fIpercent\fR
2058 .br
2059 Sets the percentage of time (0 to 100) used to add conservatism when computing the duty cycle\&. This option was deprecated in JDK 8 with no replacement, following the deprecation of the \f3-XX:+CMSIncrementalMode\fR option\&.
2060 .TP
2061 -XX:CMSInitiatingPermOccupancyFraction=\fIpercent\fR
2062 .br























2063 Sets the percentage of the permanent generation occupancy (0 to 100) at which to start a GC\&. This option was deprecated in JDK 8 with no replacement\&.
2064 .TP
2065 -XX:MaxPermSize=\fIsize\fR
2066 .br
2067 Sets the maximum permanent generation space size (in bytes)\&. This option was deprecated in JDK 8, and superseded by the \f3-XX:MaxMetaspaceSize\fR option\&.
2068 .TP
2069 -XX:PermSize=\fIsize\fR
2070 .br
2071 Sets the space (in bytes) allocated to the permanent generation that triggers a garbage collection if it is exceeded\&. This option was deprecated un JDK 8, and superseded by the \f3-XX:MetaspaceSize\fR option\&.
2072 .TP
2073 -XX:+UseSplitVerifier
2074 .br







2075 Enables splitting of the verification process\&. By default, this option was enabled in the previous releases, and verification was split into two phases: type referencing (performed by the compiler) and type checking (performed by the JVM runtime)\&. This option was deprecated in JDK 8, and verification is now split by default without a way to disable it\&.
2076 .TP
2077 -XX:+UseStringCache
2078 .br

2079 Enables caching of commonly allocated strings\&. This option was removed from JDK 8 with no replacement\&.
2080 .SH PERFORMANCE\ TUNING\ EXAMPLES    


2081 The following examples show how to use experimental tuning flags to either optimize throughput or to provide lower response time\&.
2082 .PP
2083 \f3Example 1 Tuning for Higher Throughput\fR

2084 .sp     



2085 .nf     
2086 \f3java \-d64 \-server \-XX:+AggressiveOpts \-XX:+UseLargePages \-Xmn10g  \-Xms26g \-Xmx26g\fP

2087 .fi     
2088 .nf     
2089 \f3\fP
2090 .fi     




2091 .sp     
2092 \f3Example 2 Tuning for Lower Response Time\fR
2093 .sp     

2094 .nf     
2095 \f3java \-d64 \-XX:+UseG1GC \-Xms26g Xmx26g \-XX:MaxGCPauseMillis=500 \-XX:+PrintGCTimeStamp\fP

2096 .fi     
2097 .nf     
2098 \f3\fP
2099 .fi     
2100 .sp     
2101 .SH LARGE\ PAGES    
2102 Also known as huge pages, large pages are memory pages that are significantly larger than the standard memory page size (which varies depending on the processor and operating system)\&. Large pages optimize processor Translation-Lookaside Buffers\&.
2103 .PP
2104 A Translation-Lookaside Buffer (TLB) is a page translation cache that holds the most-recently used virtual-to-physical address translations\&. TLB is a scarce system resource\&. A TLB miss can be costly as the processor must then read from the hierarchical page table, which may require multiple memory accesses\&. By using a larger memory page size, a single TLB entry can represent a larger memory range\&. There will be less pressure on TLB, and memory-intensive applications may have better performance\&.
2105 .PP


2106 However, large pages page memory can negatively affect system performance\&. For example, when a large mount of memory is pinned by an application, it may create a shortage of regular memory and cause excessive paging in other applications and slow down the entire system\&. Also, a system that has been up for a long time could produce excessive fragmentation, which could make it impossible to reserve enough large page memory\&. When this happens, either the OS or JVM reverts to using regular pages\&.
2107 .SS LARGE\ PAGES\ SUPPORT    

2108 Solaris and Linux support large pages\&.








2109 .PP
2110 Solaris 9 and later include Multiple Page Size Support (MPSS); no additional configuration is necessary\&. See http://www\&.oracle\&.com/technetwork/server-storage/solaris10/overview/solaris9-features-scalability-135663\&.html\&.









2111 .PP
2112 The 2\&.6 kernel supports large pages\&. Some vendors have backported the code to their 2\&.4-based releases\&. To check if your system can support large page memory, try the following:
2113 .sp     



2114 .nf     
2115 \f3# cat /proc/meminfo | grep Huge\fP




2116 .fi     
2117 .nf     
2118 \f3HugePages_Total: 0\fP
2119 .fi     
2120 .nf     
2121 \f3HugePages_Free: 0\fP
2122 .fi     
2123 .nf     
2124 \f3Hugepagesize: 2048 kB\fP
2125 .fi     
2126 .nf     
2127 \f3\fP
2128 .fi     
2129 .sp     
2130 If the output shows the three "Huge" variables, then your system can support large page memory but it needs to be configured\&. If the command prints nothing, then your system does not support large pages\&. To configure the system to use large page memory, login as \f3root\fR, and then follow these steps:
2131 .TP 0.4i    
2132 1\&.
2133 If you are using the option \f3-XX:+UseSHM\fR (instead of \f3-XX:+UseHugeTLBFS\fR), then increase the \f3SHMMAX\fR value\&. It must be larger than the Java heap size\&. On a system with 4 GB of physical RAM (or less), the following will make all the memory sharable:










2134 .sp     



2135 .nf     
2136 \f3# echo 4294967295 > /proc/sys/kernel/shmmax\fP

2137 .fi     
2138 .nf     
2139 \f3\fP
2140 .fi     

2141 .sp     
2142 
2143 .TP 0.4i    
2144 2\&.
2145 If you are using the option \f3-XX:+UseSHM\fR or \f3-XX:+UseHugeTLBFS\fR, then specify the number of large pages\&. In the following example, 3 GB of a 4 GB system are reserved for large pages (assuming a large page size of 2048kB, then 3 GB = 3 * 1024 MB = 3072 MB = 3072 * 1024 kB = 3145728 kB and 3145728 kB / 2048 kB = 1536):








2146 .sp     



2147 .nf     
2148 \f3# echo 1536 > /proc/sys/vm/nr_hugepages\fP

2149 .fi     
2150 .nf     
2151 \f3\fP
2152 .fi     


2153 .sp     
2154 
2155 .PP
2156 Note
2157 .PP
2158 Note that the values contained in \f3/proc\fR will reset after you reboot your system, so may want to set them in an initialization script (for example, \f3rc\&.local\fR or \f3sysctl\&.conf\fR)\&.
2159 .PP
2160 If you configure (or resize) the OS kernel parameters \f3/proc/sys/kernel/shmmax\fR or \f3/proc/sys/vm/nr_hugepages\fR, Java processes may allocate large pages for areas in addition to the Java heap\&. These steps can allocate large pages for the following areas:
2161 .PP












































2162 Java heap
2163 .PP
2164 Permanent generation
2165 .PP







2166 Code cache
2167 .PP









2168 The marking bitmap data structure for the parallel GC













2169 .PP
2170 Consequently, if you configure the \f3nr_hugepages\fR parameter to the size of the Java heap, then the JVM can fail in allocating the permanent generation and code cache areas on large pages because these areas are quite large in size\&.
2171 .SH EXIT\ STATUS    
2172 The following exit values are typically returned by the launcher when the launcher is called with the wrong arguments, serious errors, or exceptions thrown by the JVM\&. However, a Java application may choose to return any value by using the API call \f3System\&.exit(exitValue)\fR\&. The values are:
2173 .TP 0.2i    
2174 \(bu
2175 \f30\fR: Successful completion
2176 .TP 0.2i    
2177 \(bu
2178 \f3>0\fR: An error occurred
2179 .SH SEE\ ALSO    
2180 .TP 0.2i    
2181 \(bu






















2182 javac(1)
2183 .TP 0.2i    
2184 \(bu








2185 jdb(1)
2186 .TP 0.2i    
2187 \(bu








2188 javah(1)
2189 .TP 0.2i    
2190 \(bu








2191 jar(1)
2192 .TP 0.2i    
2193 \(bu








2194 jstat(1)
2195 .RE
2196 .br
2197 'pl 8.5i
2198 'bp


   4 .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5 .\"
   6 .\" This code is free software; you can redistribute it and/or modify it
   7 .\" under the terms of the GNU General Public License version 2 only, as
   8 .\" published by the Free Software Foundation.
   9 .\"
  10 .\" This code is distributed in the hope that it will be useful, but WITHOUT
  11 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12 .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  13 .\" version 2 for more details (a copy is included in the LICENSE file that
  14 .\" accompanied this code).
  15 .\"
  16 .\" You should have received a copy of the GNU General Public License version
  17 .\" 2 along with this work; if not, write to the Free Software Foundation,
  18 .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19 .\"
  20 .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21 .\" or visit www.oracle.com if you need additional information or have any
  22 .\" questions.
  23 .\"
  24 .\" Title: java
  25 .\" Language: English
  26 .\" Date: 03 March 2015
  27 .\" SectDesc: Basic Tools
  28 .\" Software: JDK 8
  29 .\" Arch: generic
  30 .\" Part Number: E38207-04
  31 .\" Doc ID: JSSON
  32 .\"
  33 .if n .pl 99999
  34 .TH "java" "1" "03 March 2015" "JDK 8" "Basic Tools"
  35 .\" -----------------------------------------------------------------
  36 .\" * Define some portability stuff
  37 .\" -----------------------------------------------------------------
  38 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  39 .\" http://bugs.debian.org/507673
  40 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  41 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  42 .ie \n(.g .ds Aq \(aq
  43 .el       .ds Aq '
  44 .\" -----------------------------------------------------------------
  45 .\" * set default formatting
  46 .\" -----------------------------------------------------------------
  47 .\" disable hyphenation
  48 .nh
  49 .\" disable justification (adjust text to left margin only)
  50 .ad l
  51 .\" -----------------------------------------------------------------
  52 .\" * MAIN CONTENT STARTS HERE *
  53 .\" -----------------------------------------------------------------
  54 .SH "NAME"

  55 java \- Launches a Java application\&.
  56 .SH "SYNOPSIS"
  57 .sp
  58 .if n \{\
  59 .RS 4
  60 .\}
  61 .nf

  62 \fBjava\fR [\fIoptions\fR] \fIclassname\fR [\fIargs\fR]
  63 .fi
  64 .if n \{\
  65 .RE
  66 .\}
  67 .sp
  68 .if n \{\
  69 .RS 4
  70 .\}
  71 .nf

  72 \fBjava\fR [\fIoptions\fR] \fB\-jar\fR \fIfilename\fR [\fIargs\fR]
  73 .fi
  74 .if n \{\
  75 .RE
  76 .\}
  77 .PP
  78 \fIoptions\fR
  79 .RS 4
  80 Command\-line options separated by spaces\&. See Options\&.
  81 .RE
  82 .PP
  83 \fIclassname\fR
  84 .RS 4
  85 The name of the class to be launched\&.
  86 .RE
  87 .PP
  88 \fIfilename\fR
  89 .RS 4
  90 The name of the Java Archive (JAR) file to be called\&. Used only with the
  91 \fB\-jar\fR
  92 option\&.
  93 .RE
  94 .PP
  95 \fIargs\fR
  96 .RS 4
  97 The arguments passed to the
  98 \fBmain()\fR
  99 method separated by spaces\&.
 100 .RE
 101 .SH "DESCRIPTION"
 102 .PP
 103 The
 104 \fBjava\fR
 105 command starts a Java application\&. It does this by starting the Java Runtime Environment (JRE), loading the specified class, and calling that class\*(Aqs
 106 \fBmain()\fR
 107 method\&. The method must be declared
 108 \fIpublic\fR
 109 and
 110 \fIstatic\fR, it must not return any value, and it must accept a
 111 \fBString\fR
 112 array as a parameter\&. The method declaration has the following form:
 113 .sp
 114 .if n \{\
 115 .RS 4
 116 .\}
 117 .nf
 118 \fBpublic static void main(String[] args)\fR
 119  
 120 .fi
 121 .if n \{\
 122 .RE
 123 .\}


 124 .PP
 125 The
 126 \fBjava\fR
 127 command can be used to launch a JavaFX application by loading a class that either has a
 128 \fBmain()\fR
 129 method or that extends
 130 \fBjavafx\&.application\&.Application\fR\&. In the latter case, the launcher constructs an instance of the
 131 \fBApplication\fR
 132 class, calls its
 133 \fBinit()\fR
 134 method, and then calls the
 135 \fBstart(javafx\&.stage\&.Stage)\fR
 136 method\&.
 137 .PP
 138 By default, the first argument that is not an option of the
 139 \fBjava\fR
 140 command is the fully qualified name of the class to be called\&. If the
 141 \fB\-jar\fR
 142 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
 143 \fBMain\-Class\fR
 144 manifest header in its source code\&.
 145 .PP
 146 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\&.
 147 .PP
 148 Arguments after the class file name or the JAR file name are passed to the
 149 \fBmain()\fR
 150 method\&.
 151 .SH "OPTIONS"
 152 .PP
 153 The
 154 \fBjava\fR
 155 command supports a wide range of options that can be divided into the following categories:
 156 .sp
 157 .RS 4
 158 .ie n \{\
 159 \h'-04'\(bu\h'+03'\c
 160 .\}
 161 .el \{\
 162 .sp -1
 163 .IP \(bu 2.3
 164 .\}
 165 Standard Options
 166 .RE
 167 .sp
 168 .RS 4
 169 .ie n \{\
 170 \h'-04'\(bu\h'+03'\c
 171 .\}
 172 .el \{\
 173 .sp -1
 174 .IP \(bu 2.3
 175 .\}
 176 Non\-Standard Options
 177 .RE
 178 .sp
 179 .RS 4
 180 .ie n \{\
 181 \h'-04'\(bu\h'+03'\c
 182 .\}
 183 .el \{\
 184 .sp -1
 185 .IP \(bu 2.3
 186 .\}
 187 Advanced Runtime Options
 188 .RE
 189 .sp
 190 .RS 4
 191 .ie n \{\
 192 \h'-04'\(bu\h'+03'\c
 193 .\}
 194 .el \{\
 195 .sp -1
 196 .IP \(bu 2.3
 197 .\}
 198 Advanced JIT Compiler Options
 199 .RE
 200 .sp
 201 .RS 4
 202 .ie n \{\
 203 \h'-04'\(bu\h'+03'\c
 204 .\}
 205 .el \{\
 206 .sp -1
 207 .IP \(bu 2.3
 208 .\}
 209 Advanced Serviceability Options
 210 .RE
 211 .sp
 212 .RS 4
 213 .ie n \{\
 214 \h'-04'\(bu\h'+03'\c
 215 .\}
 216 .el \{\
 217 .sp -1
 218 .IP \(bu 2.3
 219 .\}
 220 Advanced Garbage Collection Options
 221 .RE
 222 .PP
 223 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\&.
 224 .PP
 225 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
 226 \fB\-X\fR\&.
 227 .PP
 228 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
 229 \fB\-XX\fR\&.
 230 .PP
 231 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\&.
 232 .PP
 233 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
 234 \fB\-XX\fR
 235 options are enabled using the plus sign (\fB\-XX:+\fR\fIOptionName\fR) and disabled using the minus sign (\fB\-XX:\-\fR\fIOptionName\fR)\&.
 236 .PP
 237 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
 238 \fBk\fR
 239 or
 240 \fBK\fR
 241 for kilobytes (KB),
 242 \fBm\fR
 243 or
 244 \fBM\fR
 245 for megabytes (MB),
 246 \fBg\fR
 247 or
 248 \fBG\fR
 249 for gigabytes (GB)\&. For example, to set the size to 8 GB, you can specify either
 250 \fB8g\fR,
 251 \fB8192m\fR,
 252 \fB8388608k\fR, or
 253 \fB8589934592\fR
 254 as the argument\&. If you are expected to specify the percentage, use a number from 0 to 1 (for example, specify
 255 \fB0\&.25\fR
 256 for 25%)\&.
 257 .SS "Standard Options"
 258 .PP
 259 These are the most commonly used options that are supported by all implementations of the JVM\&.
 260 .PP
 261 \-agentlib:\fIlibname\fR[=\fIoptions\fR]
 262 .RS 4
 263 Loads the specified native agent library\&. After the library name, a comma\-separated list of options specific to the library can be used\&.
 264 .sp
 265 If the option
 266 \fB\-agentlib:foo\fR
 267 is specified, then the JVM attempts to load the library named
 268 \fBlibfoo\&.so\fR
 269 in the location specified by the
 270 \fBLD_LIBRARY_PATH\fR
 271 system variable (on OS X this variable is
 272 \fBDYLD_LIBRARY_PATH\fR)\&.
 273 .sp
 274 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:
 275 .sp
 276 .if n \{\
 277 .RS 4
 278 .\}
 279 .nf
 280 \fB\-agentlib:hprof=cpu=samples,interval=20,depth=3\fR





 281  
 282 .fi
 283 .if n \{\
 284 .RE
 285 .\}
 286 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:
 287 .sp
 288 .if n \{\
 289 .RS 4
 290 .\}
 291 .nf
 292 \fB\-agentlib:jdwp=transport=dt_socket,server=y,address=8000\fR





 293  
 294 .fi
 295 .if n \{\
 296 .RE
 297 .\}
 298 For more information about the native agent libraries, refer to the following:
 299 .sp
 300 .RS 4
 301 .ie n \{\
 302 \h'-04'\(bu\h'+03'\c
 303 .\}
 304 .el \{\
 305 .sp -1
 306 .IP \(bu 2.3
 307 .\}
 308 The
 309 \fBjava\&.lang\&.instrument\fR
 310 package description at http://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package\-summary\&.html
 311 .RE
 312 .sp
 313 .RS 4
 314 .ie n \{\
 315 \h'-04'\(bu\h'+03'\c
 316 .\}
 317 .el \{\
 318 .sp -1
 319 .IP \(bu 2.3
 320 .\}
 321 Agent Command Line Options in the JVM Tools Interface guide at http://docs\&.oracle\&.com/javase/8/docs/platform/jvmti/jvmti\&.html#starting
 322 .RE
 323 .RE
 324 .PP
 325 \-agentpath:\fIpathname\fR[=\fIoptions\fR]
 326 .RS 4
 327 Loads the native agent library specified by the absolute path name\&. This option is equivalent to
 328 \fB\-agentlib\fR
 329 but uses the full path and file name of the library\&.
 330 .RE
 331 .PP
 332 \-client
 333 .RS 4
 334 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\&.
 335 .sp
 336 For default JVM selection, see Server\-Class Machine Detection at
 337 http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/server\-class\&.html
 338 .RE
 339 .PP
 340 \-D\fIproperty\fR=\fIvalue\fR
 341 .RS 4
 342 Sets a system property value\&. The
 343 \fIproperty\fR
 344 variable is a string with no spaces that represents the name of the property\&. The
 345 \fIvalue\fR
 346 variable is a string that represents the value of the property\&. If
 347 \fIvalue\fR
 348 is a string with spaces, then enclose it in quotation marks (for example
 349 \fB\-Dfoo="foo bar"\fR)\&.
 350 .RE
 351 .PP
 352 \-d32
 353 .RS 4
 354 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\&.
 355 .RE
 356 .PP
 357 \-d64
 358 .RS 4
 359 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\&.
 360 .sp
 361 Currently only the Java HotSpot Server VM supports 64\-bit operation, and the
 362 \fB\-server\fR
 363 option is implicit with the use of
 364 \fB\-d64\fR\&. The
 365 \fB\-client\fR
 366 option is ignored with the use of
 367 \fB\-d64\fR\&. This is subject to change in a future release\&.
 368 .RE
 369 .PP
 370 \-disableassertions[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
 371 .br
 372 \-da[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
 373 .RS 4
























 374 Disables assertions\&. By default, assertions are disabled in all packages and classes\&.






 375 .sp
 376 With no arguments,
 377 \fB\-disableassertions\fR
 378 (\fB\-da\fR) disables assertions in all packages and classes\&. With the
 379 \fIpackagename\fR
 380 argument ending in
 381 \fB\&.\&.\&.\fR, the switch disables assertions in the specified package and any subpackages\&. If the argument is simply
 382 \fB\&.\&.\&.\fR, then the switch disables assertions in the unnamed package in the current working directory\&. With the
 383 \fIclassname\fR
 384 argument, the switch disables assertions in the specified class\&.
 385 .sp
 386 The
 387 \fB\-disableassertions\fR
 388 (\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
 389 \fB\-disablesystemassertions\fR
 390 option enables you to disable assertions in all system classes\&.
 391 .sp
 392 To explicitly enable assertions in specific packages or classes, use the
 393 \fB\-enableassertions\fR
 394 (\fB\-ea\fR) option\&. Both options can be used at the same time\&. For example, to run the
 395 \fBMyClass\fR
 396 application with assertions enabled in package
 397 \fBcom\&.wombat\&.fruitbat\fR
 398 (and any subpackages) but disabled in class
 399 \fBcom\&.wombat\&.fruitbat\&.Brickbat\fR, use the following command:
 400 .sp
 401 .if n \{\
 402 .RS 4
 403 .\}
 404 .nf
 405 \fBjava \-ea:com\&.wombat\&.fruitbat\&.\&.\&. \-da:com\&.wombat\&.fruitbat\&.Brickbat MyClass\fR
 406  
 407 .fi
 408 .if n \{\
 409 .RE
 410 .\}
 411 .RE
 412 .PP
 413 \-disablesystemassertions
 414 .br
 415 \-dsa
 416 .RS 4
 417 Disables assertions in all system classes\&.
 418 .RE
 419 .PP
 420 \-enableassertions[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
 421 .br
 422 \-ea[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
 423 .RS 4
 424 Enables assertions\&. By default, assertions are disabled in all packages and classes\&.






 425 .sp
 426 With no arguments,
 427 \fB\-enableassertions\fR
 428 (\fB\-ea\fR) enables assertions in all packages and classes\&. With the
 429 \fIpackagename\fR
 430 argument ending in
 431 \fB\&.\&.\&.\fR, the switch enables assertions in the specified package and any subpackages\&. If the argument is simply
 432 \fB\&.\&.\&.\fR, then the switch enables assertions in the unnamed package in the current working directory\&. With the
 433 \fIclassname\fR
 434 argument, the switch enables assertions in the specified class\&.
 435 .sp
 436 The
 437 \fB\-enableassertions\fR
 438 (\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
 439 \fB\-enablesystemassertions\fR
 440 option provides a separate switch to enable assertions in all system classes\&.
 441 .sp
 442 To explicitly disable assertions in specific packages or classes, use the
 443 \fB\-disableassertions\fR
 444 (\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
 445 \fBMyClass\fR
 446 application with assertions enabled only in package
 447 \fBcom\&.wombat\&.fruitbat\fR
 448 (and any subpackages) but disabled in class
 449 \fBcom\&.wombat\&.fruitbat\&.Brickbat\fR, use the following command:
 450 .sp
 451 .if n \{\
 452 .RS 4
 453 .\}
 454 .nf
 455 \fBjava \-ea:com\&.wombat\&.fruitbat\&.\&.\&. \-da:com\&.wombat\&.fruitbat\&.Brickbat MyClass\fR
 456  
 457 .fi
 458 .if n \{\
 459 .RE
 460 .\}
 461 .RE
 462 .PP
 463 \-enablesystemassertions
 464 .br
 465 \-esa
 466 .RS 4
 467 Enables assertions in all system classes\&.
 468 .RE
 469 .PP
 470 \-help
 471 .br
 472 \-?
 473 .RS 4
 474 Displays usage information for the
 475 \fBjava\fR
 476 command without actually running the JVM\&.
 477 .RE
 478 .PP
 479 \-jar \fIfilename\fR
 480 .RS 4
 481 Executes a program encapsulated in a JAR file\&. The
 482 \fIfilename\fR
 483 argument is the name of a JAR file with a manifest that contains a line in the form
 484 \fBMain\-Class:\fR\fIclassname\fR
 485 that defines the class with the
 486 \fBpublic static void main(String[] args)\fR
 487 method that serves as your application\*(Aqs starting point\&.
 488 .sp
 489 When you use the
 490 \fB\-jar\fR
 491 option, the specified JAR file is the source of all user classes, and other class path settings are ignored\&.
 492 .sp
 493 For more information about JAR files, see the following resources:
 494 .sp
 495 .RS 4
 496 .ie n \{\
 497 \h'-04'\(bu\h'+03'\c
 498 .\}
 499 .el \{\
 500 .sp -1
 501 .IP \(bu 2.3
 502 .\}
 503 jar(1)
 504 .RE
 505 .sp
 506 .RS 4
 507 .ie n \{\
 508 \h'-04'\(bu\h'+03'\c
 509 .\}
 510 .el \{\
 511 .sp -1
 512 .IP \(bu 2.3
 513 .\}
 514 The Java Archive (JAR) Files guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jar/index\&.html



 515 .RE
 516 .sp
 517 .RS 4
 518 .ie n \{\
 519 \h'-04'\(bu\h'+03'\c
 520 .\}
 521 .el \{\
 522 .sp -1
 523 .IP \(bu 2.3
 524 .\}
 525 Lesson: Packaging Programs in JAR Files at
 526 
 527 http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.html
 528 .RE
 529 .RE
 530 .PP
 531 \-javaagent:\fIjarpath\fR[=\fIoptions\fR]
 532 .RS 4
 533 Loads the specified Java programming language agent\&. For more information about instrumenting Java applications, see the
 534 \fBjava\&.lang\&.instrument\fR
 535 package description in the Java API documentation at http://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package\-summary\&.html
 536 .RE
 537 .PP
 538 \-jre\-restrict\-search
 539 .RS 4
 540 Includes user\-private JREs in the version search\&.
 541 .RE
 542 .PP
 543 \-no\-jre\-restrict\-search
 544 .RS 4
 545 Excludes user\-private JREs from the version search\&.
 546 .RE
 547 .PP
 548 \-server
 549 .RS 4
 550 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\&.


 551 .sp
 552 For default JVM selection, see Server\-Class Machine Detection at
 553 http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/server\-class\&.html
 554 .RE
 555 .PP
 556 \-showversion
 557 .RS 4
 558 Displays version information and continues execution of the application\&. This option is equivalent to the
 559 \fB\-version\fR
 560 option except that the latter instructs the JVM to exit after displaying version information\&.
 561 .RE
 562 .PP
 563 \-splash:\fIimgname\fR
 564 .RS 4
 565 Shows the splash screen with the image specified by
 566 \fIimgname\fR\&. For example, to show the
 567 \fBsplash\&.gif\fR
 568 file from the
 569 \fBimages\fR
 570 directory when starting your application, use the following option:
 571 .sp
 572 .if n \{\
 573 .RS 4
 574 .\}
 575 .nf
 576 \fB\-splash:images/splash\&.gif\fR
 577  
 578 .fi
 579 .if n \{\
 580 .RE
 581 .\}
 582 .RE
 583 .PP
 584 \-verbose:class
 585 .RS 4
 586 Displays information about each loaded class\&.
 587 .RE
 588 .PP
 589 \-verbose:gc
 590 .RS 4
 591 Displays information about each garbage collection (GC) event\&.
 592 .RE
 593 .PP
 594 \-verbose:jni
 595 .RS 4
 596 Displays information about the use of native methods and other Java Native Interface (JNI) activity\&.
 597 .RE
 598 .PP
 599 \-version
 600 .RS 4
 601 Displays version information and then exits\&. This option is equivalent to the
 602 \fB\-showversion\fR
 603 option except that the latter does not instruct the JVM to exit after displaying version information\&.
 604 .RE
 605 .PP
 606 \-version:\fIrelease\fR
 607 .RS 4
 608 Specifies the release version to be used for running the application\&. If the version of the
 609 \fBjava\fR
 610 command called does not meet this specification and an appropriate implementation is found on the system, then the appropriate implementation will be used\&.
 611 .sp
 612 The
 613 \fIrelease\fR
 614 argument specifies either the exact version string, or a list of version strings and ranges separated by spaces\&. A
 615 \fIversion string\fR
 616 is the developer designation of the version number in the following form:
 617 \fB1\&.\fR\fIx\fR\fB\&.0_\fR\fIu\fR
 618 (where
 619 \fIx\fR
 620 is the major version number, and
 621 \fIu\fR
 622 is the update version number)\&. A
 623 \fIversion range\fR
 624 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
 625 \fIOR\fR
 626 combination, or an ampersand (\fB&\fR) for a logical
 627 \fIAND\fR
 628 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:
 629 .sp
 630 .if n \{\
 631 .RS 4
 632 .\}
 633 .nf
 634 \fB\-version:"1\&.6\&.0_13 1\&.6* & 1\&.6\&.0_10+"\fR
 635  
 636 .fi
 637 .if n \{\
 638 .RE
 639 .\}
 640 Quotation marks are necessary only if there are spaces in the
 641 \fIrelease\fR
 642 parameter\&.
 643 .sp




 644 For JAR files, the preference is to specify version requirements in the JAR file manifest rather than on the command line\&.
 645 .RE
 646 .SS "Non\-Standard Options"
 647 .PP
 648 These options are general purpose options that are specific to the Java HotSpot Virtual Machine\&.
 649 .PP
 650 \-X
 651 .RS 4
 652 Displays help for all available
 653 \fB\-X\fR
 654 options\&.
 655 .RE
 656 .PP
 657 \-Xbatch
 658 .RS 4
 659 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
 660 \fB\-Xbatch\fR
 661 flag disables background compilation so that compilation of all methods proceeds as a foreground task until completed\&.
 662 .sp
 663 This option is equivalent to
 664 \fB\-XX:\-BackgroundCompilation\fR\&.
 665 .RE
 666 .PP
 667 \-Xbootclasspath:\fIpath\fR
 668 .RS 4
 669 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\&.
 670 .sp
 671 Do not deploy applications that use this option to override a class in
 672 \fBrt\&.jar\fR, because this violates the JRE binary code license\&.
 673 .RE
 674 .PP
 675 \-Xbootclasspath/a:\fIpath\fR
 676 .RS 4
 677 Specifies a list of directories, JAR files, and ZIP archives separated by colons (:) to append to the end of the default bootstrap class path\&.
 678 .sp
 679 Do not deploy applications that use this option to override a class in
 680 \fBrt\&.jar\fR, because this violates the JRE binary code license\&.
 681 .RE
 682 .PP
 683 \-Xbootclasspath/p:\fIpath\fR
 684 .RS 4
 685 Specifies a list of directories, JAR files, and ZIP archives separated by colons (:) to prepend to the front of the default bootstrap class path\&.
 686 .sp
 687 Do not deploy applications that use this option to override a class in
 688 \fBrt\&.jar\fR, because this violates the JRE binary code license\&.
 689 .RE
 690 .PP
 691 \-Xcheck:jni
 692 .RS 4
 693 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\&.
 694 .RE
 695 .PP
 696 \-Xcomp
 697 .RS 4
 698 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
 699 \fB\-Xcomp\fR
 700 option disables interpreted method invocations to increase compilation performance at the expense of efficiency\&.
 701 .sp
 702 You can also change the number of interpreted method invocations before compilation using the
 703 \fB\-XX:CompileThreshold\fR
 704 option\&.
 705 .RE
 706 .PP
 707 \-Xdebug
 708 .RS 4
 709 Does nothing\&. Provided for backward compatibility\&.
 710 .RE
 711 .PP
 712 \-Xdiag
 713 .RS 4
 714 Shows additional diagnostic messages\&.
 715 .RE
 716 .PP
 717 \-Xfuture
 718 .RS 4
 719 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\&.
 720 .RE
 721 .PP
 722 \-Xint
 723 .RS 4
 724 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\&.
 725 .RE
 726 .PP
 727 \-Xinternalversion
 728 .RS 4
 729 Displays more detailed JVM version information than the
 730 \fB\-version\fR
 731 option, and then exits\&.
 732 .RE
 733 .PP
 734 \-Xloggc:\fIfilename\fR
 735 .RS 4
 736 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
 737 \fB\-verbose:gc\fR
 738 with the time elapsed since the first GC event preceding each logged event\&. The
 739 \fB\-Xloggc\fR
 740 option overrides
 741 \fB\-verbose:gc\fR
 742 if both are given with the same
 743 \fBjava\fR
 744 command\&.
 745 .sp
 746 Example:
 747 .sp
 748 .if n \{\
 749 .RS 4
 750 .\}
 751 .nf
 752 \fB\-Xloggc:garbage\-collection\&.log\fR





 753  







 754 .fi
 755 .if n \{\
 756 .RE
 757 .\}
 758 .RE
 759 .PP
 760 \-Xmaxjitcodesize=\fIsize\fR
 761 .RS 4
 762 Specifies the maximum code cache size (in bytes) for JIT\-compiled code\&. Append the letter
 763 \fBk\fR
 764 or
 765 \fBK\fR
 766 to indicate kilobytes,
 767 \fBm\fR
 768 or
 769 \fBM\fR
 770 to indicate megabytes,
 771 \fBg\fR
 772 or
 773 \fBG\fR
 774 to indicate gigabytes\&. The default maximum code cache size is 240 MB; if you disable tiered compilation with the option
 775 \fB\-XX:\-TieredCompilation\fR, then the default size is 48 MB:
 776 .sp
 777 .if n \{\
 778 .RS 4
 779 .\}
 780 .nf
 781 \fB\-Xmaxjitcodesize=240m\fR
 782  
 783 .fi
 784 .if n \{\
 785 .RE
 786 .\}
 787 This option is equivalent to
 788 \fB\-XX:ReservedCodeCacheSize\fR\&.
 789 .RE
 790 .PP
 791 \-Xmixed
 792 .RS 4
 793 Executes all bytecode by the interpreter except for hot methods, which are compiled to native code\&.
 794 .RE
 795 .PP
 796 \-Xmn\fIsize\fR
 797 .RS 4
 798 Sets the initial and maximum size (in bytes) of the heap for the young generation (nursery)\&. Append the letter
 799 \fBk\fR
 800 or
 801 \fBK\fR
 802 to indicate kilobytes,
 803 \fBm\fR
 804 or
 805 \fBM\fR
 806 to indicate megabytes,
 807 \fBg\fR
 808 or
 809 \fBG\fR
 810 to indicate gigabytes\&.
 811 .sp
 812 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\&.
 813 .sp
 814 The following examples show how to set the initial and maximum size of young generation to 256 MB using various units:
 815 .sp
 816 .if n \{\
 817 .RS 4
 818 .\}
 819 .nf
 820 \fB\-Xmn256m\fR
 821 \fB\-Xmn262144k\fR
 822 \fB\-Xmn268435456\fR
 823  
 824 .fi
 825 .if n \{\
 826 .RE
 827 .\}
 828 Instead of the
 829 \fB\-Xmn\fR
 830 option to set both the initial and maximum size of the heap for the young generation, you can use
 831 \fB\-XX:NewSize\fR
 832 to set the initial size and
 833 \fB\-XX:MaxNewSize\fR
 834 to set the maximum size\&.
 835 .RE
 836 .PP
 837 \-Xms\fIsize\fR
 838 .RS 4
 839 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
 840 \fBk\fR
 841 or
 842 \fBK\fR
 843 to indicate kilobytes,
 844 \fBm\fR
 845 or
 846 \fBM\fR
 847 to indicate megabytes,
 848 \fBg\fR
 849 or
 850 \fBG\fR
 851 to indicate gigabytes\&.
 852 .sp








 853 The following examples show how to set the size of allocated memory to 6 MB using various units:
 854 .sp
 855 .if n \{\
 856 .RS 4
 857 .\}
 858 .nf
 859 \fB\-Xms6291456\fR
 860 \fB\-Xms6144k\fR
 861 \fB\-Xms6m\fR
 862  
 863 .fi
 864 .if n \{\
 865 .RE
 866 .\}
 867 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
 868 \fB\-Xmn\fR
 869 option or the
 870 \fB\-XX:NewSize\fR
 871 option\&.
 872 .RE
 873 .PP
 874 \-Xmx\fIsize\fR
 875 .RS 4
 876 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
 877 \fBk\fR
 878 or
 879 \fBK\fR
 880 to indicate kilobytes,
 881 \fBm\fR
 882 or
 883 \fBM\fR
 884 to indicate megabytes,
 885 \fBg\fR
 886 or
 887 \fBG\fR
 888 to indicate gigabytes\&. The default value is chosen at runtime based on system configuration\&. For server deployments,
 889 \fB\-Xms\fR
 890 and
 891 \fB\-Xmx\fR
 892 are often set to the same value\&. See the section "Ergonomics" in
 893 \fIJava SE HotSpot Virtual Machine Garbage Collection Tuning Guide\fR
 894 at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gctuning/index\&.html\&.
 895 .sp








 896 The following examples show how to set the maximum allowed size of allocated memory to 80 MB using various units:
 897 .sp
 898 .if n \{\
 899 .RS 4
 900 .\}
 901 .nf
 902 \fB\-Xmx83886080\fR
 903 \fB\-Xmx81920k\fR
 904 \fB\-Xmx80m\fR









 905  
 906 .fi
 907 .if n \{\
 908 .RE
 909 .\}
 910 The
 911 \fB\-Xmx\fR
 912 option is equivalent to
 913 \fB\-XX:MaxHeapSize\fR\&.
 914 .RE
 915 .PP
 916 \-Xnoclassgc
 917 .RS 4
 918 Disables garbage collection (GC) of classes\&. This can save some GC time, which shortens interruptions during the application run\&.
 919 .sp
 920 When you specify
 921 \fB\-Xnoclassgc\fR
 922 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\&.
 923 .RE
 924 .PP
 925 \-Xprof
 926 .RS 4
 927 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\&.
 928 .RE
 929 .PP
 930 \-Xrs
 931 .RS 4
 932 Reduces the use of operating system signals by the JVM\&.
 933 .sp
 934 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\&.
 935 .sp
 936 The JVM catches signals to implement shutdown hooks for unexpected termination\&. The JVM uses
 937 \fBSIGHUP\fR,
 938 \fBSIGINT\fR, and
 939 \fBSIGTERM\fR
 940 to initiate the running of shutdown hooks\&.
 941 .sp
 942 The JVM uses a similar mechanism to implement the feature of dumping thread stacks for debugging purposes\&. The JVM uses
 943 \fBSIGQUIT\fR
 944 to perform thread dumps\&.
 945 .sp
 946 Applications embedding the JVM frequently need to trap signals such as
 947 \fBSIGINT\fR
 948 or
 949 \fBSIGTERM\fR, which can lead to interference with the JVM signal handlers\&. The
 950 \fB\-Xrs\fR
 951 option is available to address this issue\&. When
 952 \fB\-Xrs\fR
 953 is used, the signal masks for
 954 \fBSIGINT\fR,
 955 \fBSIGTERM\fR,
 956 \fBSIGHUP\fR, and
 957 \fBSIGQUIT\fR
 958 are not changed by the JVM, and signal handlers for these signals are not installed\&.
 959 .sp
 960 There are two consequences of specifying
 961 \fB\-Xrs\fR:
 962 .sp
 963 .RS 4
 964 .ie n \{\
 965 \h'-04'\(bu\h'+03'\c
 966 .\}
 967 .el \{\
 968 .sp -1
 969 .IP \(bu 2.3
 970 .\}
 971 \fBSIGQUIT\fR
 972 thread dumps are not available\&.
 973 .RE
 974 .sp
 975 .RS 4
 976 .ie n \{\
 977 \h'-04'\(bu\h'+03'\c
 978 .\}
 979 .el \{\
 980 .sp -1
 981 .IP \(bu 2.3
 982 .\}
 983 User code is responsible for causing shutdown hooks to run, for example, by calling
 984 \fBSystem\&.exit()\fR
 985 when the JVM is to be terminated\&.
 986 .RE
 987 .RE
 988 .PP
 989 \-Xshare:\fImode\fR
 990 .RS 4
 991 Sets the class data sharing (CDS) mode\&. Possible
 992 \fImode\fR
 993 arguments for this option include the following:
 994 .PP
 995 auto
 996 .RS 4
 997 Use CDS if possible\&. This is the default value for Java HotSpot 32\-Bit Client VM\&.
 998 .RE
 999 .PP
1000 on
1001 .RS 4
1002 Require the use of CDS\&. Print an error message and exit if class data sharing cannot be used\&.
1003 .RE
1004 .PP
1005 off
1006 .RS 4
1007 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\&.
1008 .RE
1009 .PP
1010 dump
1011 .RS 4
1012 Manually generate the CDS archive\&. Specify the application class path as described in "Setting the Class Path "\&.
1013 .sp
1014 You should regenerate the CDS archive with each new JDK release\&.
1015 .RE
1016 .RE
1017 .PP
1018 \-XshowSettings:\fIcategory\fR
1019 .RS 4
1020 Shows settings and continues\&. Possible
1021 \fIcategory\fR
1022 arguments for this option include the following:
1023 .PP
1024 all
1025 .RS 4
1026 Shows all categories of settings\&. This is the default value\&.
1027 .RE
1028 .PP
1029 locale
1030 .RS 4
1031 Shows settings related to locale\&.
1032 .RE
1033 .PP
1034 properties
1035 .RS 4
1036 Shows settings related to system properties\&.
1037 .RE
1038 .PP
1039 vm
1040 .RS 4
1041 Shows the settings of the JVM\&.
1042 .RE



























1043 .RE
1044 .PP
1045 \-Xss\fIsize\fR
1046 .RS 4
1047 Sets the thread stack size (in bytes)\&. Append the letter
1048 \fBk\fR
1049 or
1050 \fBK\fR
1051 to indicate KB,
1052 \fBm\fR
1053 or
1054 \fBM\fR
1055 to indicate MB,
1056 \fBg\fR
1057 or
1058 \fBG\fR
1059 to indicate GB\&. The default value depends on the platform:
1060 .sp
1061 .RS 4
1062 .ie n \{\
1063 \h'-04'\(bu\h'+03'\c
1064 .\}
1065 .el \{\
1066 .sp -1
1067 .IP \(bu 2.3
1068 .\}
1069 Linux/ARM (32\-bit): 320 KB
1070 .RE
1071 .sp
1072 .RS 4
1073 .ie n \{\
1074 \h'-04'\(bu\h'+03'\c
1075 .\}
1076 .el \{\
1077 .sp -1
1078 .IP \(bu 2.3
1079 .\}
1080 Linux/i386 (32\-bit): 320 KB
1081 .RE
1082 .sp
1083 .RS 4
1084 .ie n \{\
1085 \h'-04'\(bu\h'+03'\c
1086 .\}
1087 .el \{\
1088 .sp -1
1089 .IP \(bu 2.3
1090 .\}
1091 Linux/x64 (64\-bit): 1024 KB
1092 .RE
1093 .sp
1094 .RS 4
1095 .ie n \{\
1096 \h'-04'\(bu\h'+03'\c
1097 .\}
1098 .el \{\
1099 .sp -1
1100 .IP \(bu 2.3
1101 .\}
1102 OS X (64\-bit): 1024 KB
1103 .RE
1104 .sp
1105 .RS 4
1106 .ie n \{\
1107 \h'-04'\(bu\h'+03'\c
1108 .\}
1109 .el \{\
1110 .sp -1
1111 .IP \(bu 2.3
1112 .\}
1113 Oracle Solaris/i386 (32\-bit): 320 KB
1114 .RE
1115 .sp
1116 .RS 4
1117 .ie n \{\
1118 \h'-04'\(bu\h'+03'\c
1119 .\}
1120 .el \{\
1121 .sp -1
1122 .IP \(bu 2.3
1123 .\}
1124 Oracle Solaris/x64 (64\-bit): 1024 KB
1125 .RE
1126 .sp
1127 The following examples set the thread stack size to 1024 KB in different units:
1128 .sp
1129 .if n \{\
1130 .RS 4
1131 .\}
1132 .nf
1133 \fB\-Xss1m\fR
1134 \fB\-Xss1024k\fR
1135 \fB\-Xss1048576\fR









1136  
1137 .fi
1138 .if n \{\
1139 .RE
1140 .\}
1141 This option is equivalent to
1142 \fB\-XX:ThreadStackSize\fR\&.
1143 .RE
1144 .PP
1145 \-Xusealtsigs
1146 .RS 4
1147 Use alternative signals instead of
1148 \fBSIGUSR1\fR
1149 and
1150 \fBSIGUSR2\fR
1151 for JVM internal signals\&. This option is equivalent to
1152 \fB\-XX:+UseAltSigs\fR\&.
1153 .RE
1154 .PP
1155 \-Xverify:\fImode\fR
1156 .RS 4
1157 Sets the mode of the bytecode verifier\&. Bytecode verification helps to troubleshoot some problems, but it also adds overhead to the running application\&. Possible
1158 \fImode\fR
1159 arguments for this option include the following:
1160 .PP
1161 none
1162 .RS 4
1163 Do not verify the bytecode\&. This reduces startup time and also reduces the protection provided by Java\&.
1164 .RE
1165 .PP
1166 remote
1167 .RS 4
1168 Verify those classes that are not loaded by the bootstrap class loader\&. This is the default behavior if you do not specify the
1169 \fB\-Xverify\fR
1170 option\&.
1171 .RE
1172 .PP
1173 all
1174 .RS 4
1175 Verify all classes\&.
1176 .RE
1177 .RE
1178 .SS "Advanced Runtime Options"
1179 .PP
1180 These options control the runtime behavior of the Java HotSpot VM\&.
1181 .PP
1182 \-XX:+CheckEndorsedAndExtDirs
1183 .RS 4
1184 Enables the option to prevent the
1185 \fBjava\fR
1186 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:


1187 .sp
1188 .RS 4
1189 .ie n \{\
1190 \h'-04'\(bu\h'+03'\c
1191 .\}
1192 .el \{\
1193 .sp -1
1194 .IP \(bu 2.3
1195 .\}
1196 The
1197 \fBjava\&.ext\&.dirs\fR
1198 or
1199 \fBjava\&.endorsed\&.dirs\fR
1200 system property is set\&.
1201 .RE
1202 .sp
1203 .RS 4
1204 .ie n \{\
1205 \h'-04'\(bu\h'+03'\c
1206 .\}
1207 .el \{\
1208 .sp -1
1209 .IP \(bu 2.3
1210 .\}
1211 The
1212 \fBlib/endorsed\fR
1213 directory exists and is not empty\&.
1214 .RE
1215 .sp
1216 .RS 4
1217 .ie n \{\
1218 \h'-04'\(bu\h'+03'\c
1219 .\}
1220 .el \{\
1221 .sp -1
1222 .IP \(bu 2.3
1223 .\}
1224 The
1225 \fBlib/ext\fR
1226 directory contains any JAR files other than those of the JDK\&.
1227 .RE
1228 .sp
1229 .RS 4
1230 .ie n \{\
1231 \h'-04'\(bu\h'+03'\c
1232 .\}
1233 .el \{\
1234 .sp -1
1235 .IP \(bu 2.3
1236 .\}
1237 The system\-wide platform\-specific extension directory contains any JAR files\&.
1238 .RE
1239 .RE
1240 .PP
1241 \-XX:+DisableAttachMechanism
1242 .RS 4
1243 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
1244 \fBjcmd\fR,
1245 \fBjstack\fR,
1246 \fBjmap\fR, and
1247 \fBjinfo\fR\&.
1248 .RE
1249 .PP
1250 \-XX:ErrorFile=\fIfilename\fR
1251 .RS 4
1252 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
1253 \fBhs_err_pid\fR\fIpid\fR\fB\&.log\fR
1254 where
1255 \fIpid\fR
1256 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
1257 \fB%p\fR):
1258 .sp
1259 .if n \{\
1260 .RS 4
1261 .\}
1262 .nf
1263 \fB\-XX:ErrorFile=\&./hs_err_pid%p\&.log\fR
1264  
1265 .fi
1266 .if n \{\
1267 .RE
1268 .\}
1269 The following example shows how to set the error log to
1270 \fB/var/log/java/java_error\&.log\fR:
1271 .sp
1272 .if n \{\
1273 .RS 4
1274 .\}
1275 .nf
1276 \fB\-XX:ErrorFile=/var/log/java/java_error\&.log\fR
1277  
1278 .fi
1279 .if n \{\
1280 .RE
1281 .\}
1282 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
1283 \fB/tmp\fR\&.
1284 .RE
1285 .PP
1286 \-XX:+FailOverToOldVerifier
1287 .RS 4
1288 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\&.
1289 .RE
1290 .PP
1291 \-XX:LargePageSizeInBytes=\fIsize\fR
1292 .RS 4
1293 On Solaris, sets the maximum size (in bytes) for large pages used for Java heap\&. The
1294 \fIsize\fR
1295 argument must be a power of 2 (2, 4, 8, 16, \&.\&.\&.)\&. Append the letter
1296 \fBk\fR
1297 or
1298 \fBK\fR
1299 to indicate kilobytes,
1300 \fBm\fR
1301 or
1302 \fBM\fR
1303 to indicate megabytes,
1304 \fBg\fR
1305 or
1306 \fBG\fR
1307 to indicate gigabytes\&. By default, the size is set to 0, meaning that the JVM chooses the size for large pages automatically\&.
1308 .sp
1309 The following example illustrates how to set the large page size to 4 megabytes (MB):
1310 .sp
1311 .if n \{\
1312 .RS 4
1313 .\}
1314 .nf
1315 \fB\-XX:LargePageSizeInBytes=4m\fR
1316  
1317 .fi
1318 .if n \{\
1319 .RE
1320 .\}
1321 .RE
1322 .PP
1323 \-XX:MaxDirectMemorySize=\fIsize\fR
1324 .RS 4
1325 Sets the maximum total size (in bytes) of the New I/O (the
1326 \fBjava\&.nio\fR
1327 package) direct\-buffer allocations\&. Append the letter
1328 \fBk\fR
1329 or
1330 \fBK\fR
1331 to indicate kilobytes,
1332 \fBm\fR
1333 or
1334 \fBM\fR
1335 to indicate megabytes,
1336 \fBg\fR
1337 or
1338 \fBG\fR
1339 to indicate gigabytes\&. By default, the size is set to 0, meaning that the JVM chooses the size for NIO direct\-buffer allocations automatically\&.
1340 .sp






1341 The following examples illustrate how to set the NIO size to 1024 KB in different units:
1342 .sp
1343 .if n \{\
1344 .RS 4
1345 .\}
1346 .nf
1347 \fB\-XX:MaxDirectMemorySize=1m\fR
1348 \fB\-XX:MaxDirectMemorySize=1024k\fR
1349 \fB\-XX:MaxDirectMemorySize=1048576\fR









1350  
1351 .fi
1352 .if n \{\
1353 .RE
1354 .\}
1355 .RE
1356 .PP
1357 \-XX:NativeMemoryTracking=\fImode\fR
1358 .RS 4
1359 Specifies the mode for tracking JVM native memory usage\&. Possible
1360 \fImode\fR
1361 arguments for this option include the following:
1362 .PP
1363 off
1364 .RS 4
1365 Do not track JVM native memory usage\&. This is the default behavior if you do not specify the
1366 \fB\-XX:NativeMemoryTracking\fR
1367 option\&.
1368 .RE
1369 .PP
1370 summary
1371 .RS 4
1372 Only track memory usage by JVM subsystems, such as Java heap, class, code, and thread\&.
1373 .RE
1374 .PP
1375 detail
1376 .RS 4
1377 In addition to tracking memory usage by JVM subsystems, track memory usage by individual
1378 \fBCallSite\fR, individual virtual memory region and its committed regions\&.
1379 .RE
1380 .RE
1381 .PP
1382 \-XX:ObjectAlignmentInBytes=\fIalignment\fR
1383 .RS 4
1384 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\&.
1385 .sp
1386 The heap size limit in bytes is calculated as:
1387 .sp
1388 \fB4GB * ObjectAlignmentInBytes\fR
1389 .sp
1390 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\&.
1391 .RE
1392 .PP
1393 \-XX:OnError=\fIstring\fR
1394 .RS 4
1395 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\&.

1396 .sp
1397 The following example shows how the
1398 \fB\-XX:OnError\fR
1399 option can be used to run the
1400 \fBgcore\fR
1401 command to create the core image, and the debugger is started to attach to the process in case of an irrecoverable error (the
1402 \fB%p\fR
1403 designates the current process):
1404 .sp
1405 .if n \{\
1406 .RS 4
1407 .\}
1408 .nf
1409 \fB\-XX:OnError="gcore %p;dbx \- %p"\fR
1410  
1411 .fi
1412 .if n \{\
1413 .RE
1414 .\}
1415 .RE
1416 .PP
1417 \-XX:OnOutOfMemoryError=\fIstring\fR
1418 .RS 4
1419 Sets a custom command or a series of semicolon\-separated commands to run when an
1420 \fBOutOfMemoryError\fR
1421 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
1422 \fB\-XX:OnError\fR
1423 option\&.
1424 .RE
1425 .PP
1426 \-XX:+PerfDataSaveToFile
1427 .RS 4
1428 If enabled, saves
1429 jstat(1) binary data when the Java application exits\&. This binary data is saved in a file named
1430 \fBhsperfdata_\fR\fI<pid>\fR, where
1431 \fI<pid>\fR
1432 is the process identifier of the Java application you ran\&. Use
1433 \fBjstat\fR
1434 to display the performance data contained in this file as follows:
1435 .sp
1436 .if n \{\
1437 .RS 4
1438 .\}







1439 .nf
1440 \fBjstat \-class file:///\fR\fB\fI<path>\fR\fR\fB/hsperfdata_\fR\fB\fI<pid>\fR\fR
1441 \fBjstat \-gc file:///\fR\fB\fI<path>\fR\fR\fB/hsperfdata_\fR\fB\fI<pid>\fR\fR
1442 .fi
1443 .if n \{\
1444 .RE
1445 .\}
1446 .RE
1447 .PP
1448 \-XX:+PrintCommandLineFlags
1449 .RS 4

1450 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\&.
1451 .RE
1452 .PP
1453 \-XX:+PrintNMTStatistics
1454 .RS 4
1455 Enables printing of collected native memory tracking data at JVM exit when native memory tracking is enabled (see
1456 \fB\-XX:NativeMemoryTracking\fR)\&. By default, this option is disabled and native memory tracking data is not printed\&.
1457 .RE
1458 .PP
1459 \-XX:+RelaxAccessControlCheck
1460 .RS 4
1461 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\&.
1462 .RE
1463 .PP
1464 \-XX:+ShowMessageBoxOnError
1465 .RS 4
1466 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\&.


























1467 .RE
1468 .PP
1469 \-XX:ThreadStackSize=\fIsize\fR
1470 .RS 4
1471 Sets the thread stack size (in bytes)\&. Append the letter
1472 \fBk\fR
1473 or
1474 \fBK\fR
1475 to indicate kilobytes,
1476 \fBm\fR
1477 or
1478 \fBM\fR
1479 to indicate megabytes,
1480 \fBg\fR
1481 or
1482 \fBG\fR
1483 to indicate gigabytes\&. The default value depends on the platform:
1484 .sp
1485 .RS 4
1486 .ie n \{\
1487 \h'-04'\(bu\h'+03'\c
1488 .\}
1489 .el \{\
1490 .sp -1
1491 .IP \(bu 2.3
1492 .\}
1493 Linux/ARM (32\-bit): 320 KB
1494 .RE
1495 .sp
1496 .RS 4
1497 .ie n \{\
1498 \h'-04'\(bu\h'+03'\c
1499 .\}
1500 .el \{\
1501 .sp -1
1502 .IP \(bu 2.3
1503 .\}
1504 Linux/i386 (32\-bit): 320 KB
1505 .RE
1506 .sp
1507 .RS 4
1508 .ie n \{\
1509 \h'-04'\(bu\h'+03'\c
1510 .\}
1511 .el \{\
1512 .sp -1
1513 .IP \(bu 2.3
1514 .\}
1515 Linux/x64 (64\-bit): 1024 KB
1516 .RE
1517 .sp
1518 .RS 4
1519 .ie n \{\
1520 \h'-04'\(bu\h'+03'\c
1521 .\}
1522 .el \{\
1523 .sp -1
1524 .IP \(bu 2.3
1525 .\}
1526 OS X (64\-bit): 1024 KB
1527 .RE
1528 .sp
1529 .RS 4
1530 .ie n \{\
1531 \h'-04'\(bu\h'+03'\c
1532 .\}
1533 .el \{\
1534 .sp -1
1535 .IP \(bu 2.3
1536 .\}
1537 Oracle Solaris/i386 (32\-bit): 320 KB
1538 .RE
1539 .sp
1540 .RS 4
1541 .ie n \{\
1542 \h'-04'\(bu\h'+03'\c
1543 .\}
1544 .el \{\
1545 .sp -1
1546 .IP \(bu 2.3
1547 .\}
1548 Oracle Solaris/x64 (64\-bit): 1024 KB
1549 .RE
1550 .sp
1551 The following examples show how to set the thread stack size to 1024 KB in different units:
1552 .sp
1553 .if n \{\
1554 .RS 4
1555 .\}
1556 .nf
1557 \fB\-XX:ThreadStackSize=1m\fR
1558 \fB\-XX:ThreadStackSize=1024k\fR
1559 \fB\-XX:ThreadStackSize=1048576\fR









1560  
1561 .fi
1562 .if n \{\
1563 .RE
1564 .\}
1565 This option is equivalent to
1566 \fB\-Xss\fR\&.
1567 .RE
1568 .PP
1569 \-XX:+TraceClassLoading
1570 .RS 4
1571 Enables tracing of classes as they are loaded\&. By default, this option is disabled and classes are not traced\&.
1572 .RE
1573 .PP
1574 \-XX:+TraceClassLoadingPreorder
1575 .RS 4
1576 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\&.
1577 .RE
1578 .PP
1579 \-XX:+TraceClassResolution
1580 .RS 4
1581 Enables tracing of constant pool resolutions\&. By default, this option is disabled and constant pool resolutions are not traced\&.
1582 .RE
1583 .PP
1584 \-XX:+TraceClassUnloading
1585 .RS 4
1586 Enables tracing of classes as they are unloaded\&. By default, this option is disabled and classes are not traced\&.
1587 .RE
1588 .PP
1589 \-XX:+TraceLoaderConstraints
1590 .RS 4
1591 Enables tracing of the loader constraints recording\&. By default, this option is disabled and loader constraints recording is not traced\&.
1592 .RE
1593 .PP
1594 \-XX:+UseAltSigs
1595 .RS 4
1596 Enables the use of alternative signals instead of
1597 \fBSIGUSR1\fR
1598 and
1599 \fBSIGUSR2\fR
1600 for JVM internal signals\&. By default, this option is disabled and alternative signals are not used\&. This option is equivalent to
1601 \fB\-Xusealtsigs\fR\&.
1602 .RE
1603 .PP
1604 \-XX:\-UseBiasedLocking
1605 .RS 4
1606 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
1607 .sp
1608 By default, this option is enabled\&.
1609 .RE
1610 .PP
1611 \-XX:\-UseCompressedOops
1612 .RS 4
1613 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\&.
1614 .sp
1615 It is also possible to use compressed pointers when Java heap sizes are greater than 32GB\&. See the
1616 \fB\-XX:ObjectAlignmentInBytes\fR
1617 option\&.
1618 .RE
1619 .PP
1620 \-XX:+UseHugeTLBFS
1621 .RS 4
1622 This option for Linux is the equivalent of specifying
1623 \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
1624 \fB\-XX:UseTransparentHugePages\fR
1625 if you want this behavior\&.
1626 .sp
1627 For more information, see "Large Pages"\&.
1628 .RE
1629 .PP
1630 \-XX:+UseLargePages
1631 .RS 4
1632 Enables the use of large page memory\&. By default, this option is disabled and large page memory is not used\&.
1633 .sp
1634 For more information, see "Large Pages"\&.
1635 .RE
1636 .PP
1637 \-XX:+UseMembar
1638 .RS 4
1639 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\&.)
1640 .RE
1641 .PP
1642 \-XX:+UsePerfData
1643 .RS 4
1644 Enables the
1645 \fBperfdata\fR
1646 feature\&. This option is enabled by default to allow JVM monitoring and performance testing\&. Disabling it suppresses the creation of the
1647 \fBhsperfdata_userid\fR
1648 directories\&. To disable the
1649 \fBperfdata\fR
1650 feature, specify
1651 \fB\-XX:\-UsePerfData\fR\&.
1652 .RE
1653 .PP
1654 \-XX:+UseTransparentHugePages
1655 .RS 4
1656 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\&.
1657 .sp
1658 For more information, see "Large Pages"\&.
1659 .RE
1660 .PP
1661 \-XX:+AllowUserSignalHandlers
1662 .RS 4
1663 Enables installation of signal handlers by the application\&. By default, this option is disabled and the application is not allowed to install signal handlers\&.
1664 .RE
1665 .SS "Advanced JIT Compiler Options"
1666 .PP
1667 These options control the dynamic just\-in\-time (JIT) compilation performed by the Java HotSpot VM\&.
1668 .PP
1669 \-XX:+AggressiveOpts
1670 .RS 4
1671 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\&.
1672 .RE
1673 .PP
1674 \-XX:AllocateInstancePrefetchLines=\fIlines\fR
1675 .RS 4
1676 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:
1677 .sp
1678 .if n \{\
1679 .RS 4
1680 .\}
1681 .nf
1682 \fB\-XX:AllocateInstancePrefetchLines=1\fR





1683  
1684 .fi
1685 .if n \{\
1686 .RE
1687 .\}
1688 Only the Java HotSpot Server VM supports this option\&.
1689 .RE
1690 .PP
1691 \-XX:AllocatePrefetchDistance=\fIsize\fR
1692 .RS 4
1693 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\&.
1694 .sp
1695 Negative values denote that prefetch distance is chosen based on the platform\&. Positive values are bytes to prefetch\&. Append the letter
1696 \fBk\fR
1697 or
1698 \fBK\fR
1699 to indicate kilobytes,
1700 \fBm\fR
1701 or
1702 \fBM\fR
1703 to indicate megabytes,
1704 \fBg\fR
1705 or
1706 \fBG\fR
1707 to indicate gigabytes\&. The default value is set to \-1\&.
1708 .sp
1709 The following example shows how to set the prefetch distance to 1024 bytes:
1710 .sp
1711 .if n \{\
1712 .RS 4
1713 .\}
1714 .nf
1715 \fB\-XX:AllocatePrefetchDistance=1024\fR





1716  
1717 .fi
1718 .if n \{\
1719 .RE
1720 .\}
1721 Only the Java HotSpot Server VM supports this option\&.
1722 .RE
1723 .PP
1724 \-XX:AllocatePrefetchInstr=\fIinstruction\fR
1725 .RS 4
1726 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:
1727 .sp
1728 .if n \{\
1729 .RS 4
1730 .\}
1731 .nf
1732 \fB\-XX:AllocatePrefetchInstr=0\fR





1733  
1734 .fi
1735 .if n \{\
1736 .RE
1737 .\}
1738 Only the Java HotSpot Server VM supports this option\&.
1739 .RE
1740 .PP
1741 \-XX:AllocatePrefetchLines=\fIlines\fR
1742 .RS 4
1743 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\&.
1744 .sp
1745 The following example shows how to set the number of loaded cache lines to 5:
1746 .sp
1747 .if n \{\
1748 .RS 4
1749 .\}
1750 .nf
1751 \fB\-XX:AllocatePrefetchLines=5\fR





1752  
1753 .fi
1754 .if n \{\
1755 .RE
1756 .\}
1757 Only the Java HotSpot Server VM supports this option\&.
1758 .RE
1759 .PP
1760 \-XX:AllocatePrefetchStepSize=\fIsize\fR
1761 .RS 4
1762 Sets the step size (in bytes) for sequential prefetch instructions\&. Append the letter
1763 \fBk\fR
1764 or
1765 \fBK\fR
1766 to indicate kilobytes,
1767 \fBm\fR
1768 or
1769 \fBM\fR
1770 to indicate megabytes,
1771 \fBg\fR
1772 or
1773 \fBG\fR
1774 to indicate gigabytes\&. By default, the step size is set to 16 bytes:
1775 .sp
1776 .if n \{\
1777 .RS 4
1778 .\}
1779 .nf
1780 \fB\-XX:AllocatePrefetchStepSize=16\fR





1781  
1782 .fi
1783 .if n \{\
1784 .RE
1785 .\}
1786 Only the Java HotSpot Server VM supports this option\&.
1787 .RE
1788 .PP
1789 \-XX:AllocatePrefetchStyle=\fIstyle\fR
1790 .RS 4
1791 Sets the generated code style for prefetch instructions\&. The
1792 \fIstyle\fR
1793 argument is an integer from 0 to 3:
1794 .PP
1795 0
1796 .RS 4
1797 Do not generate prefetch instructions\&.
1798 .RE
1799 .PP
1800 1
1801 .RS 4
1802 Execute prefetch instructions after each allocation\&. This is the default parameter\&.
1803 .RE
1804 .PP
1805 2
1806 .RS 4
1807 Use the thread\-local allocation block (TLAB) watermark pointer to determine when prefetch instructions are executed\&.
1808 .RE
1809 .PP
1810 3
1811 .RS 4
1812 Use BIS instruction on SPARC for allocation prefetch\&.
1813 .RE
1814 .sp

1815 Only the Java HotSpot Server VM supports this option\&.
1816 .RE
1817 .PP
1818 \-XX:+BackgroundCompilation
1819 .RS 4
1820 Enables background compilation\&. This option is enabled by default\&. To disable background compilation, specify
1821 \fB\-XX:\-BackgroundCompilation\fR
1822 (this is equivalent to specifying
1823 \fB\-Xbatch\fR)\&.
1824 .RE
1825 .PP
1826 \-XX:CICompilerCount=\fIthreads\fR
1827 .RS 4
1828 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:
1829 .sp
1830 .if n \{\
1831 .RS 4
1832 .\}
1833 .nf
1834 \fB\-XX:CICompilerCount=2\fR
1835  
1836 .fi
1837 .if n \{\
1838 .RE
1839 .\}
1840 .RE
1841 .PP
1842 \-XX:CodeCacheMinimumFreeSpace=\fIsize\fR
1843 .RS 4
1844 Sets the minimum free space (in bytes) required for compilation\&. Append the letter
1845 \fBk\fR
1846 or
1847 \fBK\fR
1848 to indicate kilobytes,
1849 \fBm\fR
1850 or
1851 \fBM\fR
1852 to indicate megabytes,
1853 \fBg\fR
1854 or
1855 \fBG\fR
1856 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:
1857 .sp
1858 .if n \{\
1859 .RS 4
1860 .\}



1861 .nf
1862 \fB\-XX:CodeCacheMinimumFreeSpace=1024m\fR
1863  
1864 .fi
1865 .if n \{\
1866 .RE
1867 .\}
1868 .RE
1869 .PP
1870 \-XX:CompileCommand=\fIcommand\fR,\fImethod\fR[,\fIoption\fR]
1871 .RS 4
1872 Specifies a command to perform on a method\&. For example, to exclude the
1873 \fBindexOf()\fR
1874 method of the
1875 \fBString\fR
1876 class from being compiled, use the following:
1877 .sp
1878 .if n \{\
1879 .RS 4
1880 .\}



1881 .nf
1882 \fB\-XX:CompileCommand=exclude,java/lang/String\&.indexOf\fR
1883  
1884 .fi
1885 .if n \{\
1886 .RE
1887 .\}
1888 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
1889 \fB\-XX:+PrintCompilation\fR
1890 and
1891 \fB\-XX:+LogCompilation\fR
1892 options:
1893 .sp
1894 .if n \{\
1895 .RS 4
1896 .\}

1897 .nf
1898 \fB\-XX:CompileCommand=exclude,java\&.lang\&.String::indexOf\fR
1899  
1900 .fi
1901 .if n \{\
1902 .RE
1903 .\}
1904 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
1905 \fBindexOf(String)\fR
1906 method of the
1907 \fBString\fR
1908 class from being compiled, use the following:
1909 .sp
1910 .if n \{\
1911 .RS 4
1912 .\}

1913 .nf
1914 \fB\-XX:CompileCommand="exclude,java/lang/String\&.indexOf,(Ljava/lang/String;)I"\fR
1915  
1916 .fi
1917 .if n \{\
1918 .RE
1919 .\}
1920 You can also use the asterisk (*) as a wildcard for class and method names\&. For example, to exclude all
1921 \fBindexOf()\fR
1922 methods in all classes from being compiled, use the following:
1923 .sp
1924 .if n \{\
1925 .RS 4
1926 .\}

1927 .nf
1928 \fB\-XX:CompileCommand=exclude,*\&.indexOf\fR
1929  
1930 .fi
1931 .if n \{\
1932 .RE
1933 .\}
1934 The commas and periods are aliases for spaces, making it easier to pass compiler commands through a shell\&. You can pass arguments to
1935 \fB\-XX:CompileCommand\fR
1936 using spaces as separators by enclosing the argument in quotation marks:
1937 .sp
1938 .if n \{\
1939 .RS 4
1940 .\}

1941 .nf
1942 \fB\-XX:CompileCommand="exclude java/lang/String indexOf"\fR
1943  
1944 .fi
1945 .if n \{\
1946 .RE
1947 .\}
1948 Note that after parsing the commands passed on the command line using the
1949 \fB\-XX:CompileCommand\fR
1950 options, the JIT compiler then reads commands from the
1951 \fB\&.hotspot_compiler\fR
1952 file\&. You can add commands to this file or specify a different file using the
1953 \fB\-XX:CompileCommandFile\fR
1954 option\&.
1955 .sp
1956 To add several commands, either specify the
1957 \fB\-XX:CompileCommand\fR
1958 option multiple times, or separate each argument with the newline separator (\fB\en\fR)\&. The following commands are available:
1959 .PP



1960 break
1961 .RS 4
1962 Set a breakpoint when debugging the JVM to stop at the beginning of compilation of the specified method\&.
1963 .RE
1964 .PP
1965 compileonly
1966 .RS 4
1967 Exclude all methods from compilation except for the specified method\&. As an alternative, you can use the
1968 \fB\-XX:CompileOnly\fR
1969 option, which allows to specify several methods\&.
1970 .RE
1971 .PP
1972 dontinline
1973 .RS 4
1974 Prevent inlining of the specified method\&.
1975 .RE
1976 .PP
1977 exclude
1978 .RS 4
1979 Exclude the specified method from compilation\&.
1980 .RE
1981 .PP
1982 help
1983 .RS 4
1984 Print a help message for the
1985 \fB\-XX:CompileCommand\fR
1986 option\&.
1987 .RE
1988 .PP
1989 inline
1990 .RS 4
1991 Attempt to inline the specified method\&.
1992 .RE
1993 .PP
1994 log
1995 .RS 4
1996 Exclude compilation logging (with the
1997 \fB\-XX:+LogCompilation\fR
1998 option) for all methods except for the specified method\&. By default, logging is performed for all compiled methods\&.
1999 .RE
2000 .PP
2001 option
2002 .RS 4
2003 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
2004 \fBBlockLayoutByFrequency\fR
2005 option for the
2006 \fBappend()\fR
2007 method of the
2008 \fBStringBuffer\fR
2009 class, use the following:
2010 .sp
2011 .if n \{\
2012 .RS 4
2013 .\}
2014 .nf
2015 \fB\-XX:CompileCommand=option,java/lang/StringBuffer\&.append,BlockLayoutByFrequency\fR





2016  
2017 .fi
2018 .if n \{\
2019 .RE
2020 .\}
2021 You can specify multiple compilation options, separated by commas or spaces\&.
2022 .RE
2023 .PP
2024 print
2025 .RS 4
2026 Print generated assembler code after compilation of the specified method\&.
2027 .RE
2028 .PP
2029 quiet
2030 .RS 4
2031 Do not print the compile commands\&. By default, the commands that you specify with the \-\fBXX:CompileCommand\fR
2032 option are printed; for example, if you exclude from compilation the
2033 \fBindexOf()\fR
2034 method of the
2035 \fBString\fR
2036 class, then the following will be printed to standard output:
2037 .sp
2038 .if n \{\
2039 .RS 4
2040 .\}
2041 .nf
2042 \fBCompilerOracle: exclude java/lang/String\&.indexOf\fR





2043  
2044 .fi
2045 .if n \{\
2046 .RE
2047 .\}
2048 You can suppress this by specifying the
2049 \fB\-XX:CompileCommand=quiet\fR
2050 option before other
2051 \fB\-XX:CompileCommand\fR
2052 options\&.
2053 .RE
2054 .RE
2055 .PP
2056 \-XX:CompileCommandFile=\fIfilename\fR
2057 .RS 4
2058 Sets the file from which JIT compiler commands are read\&. By default, the
2059 \fB\&.hotspot_compiler\fR
2060 file is used to store commands performed by the JIT compiler\&.
2061 .sp
2062 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
2063 \fBtoString()\fR
2064 method of the
2065 \fBString\fR
2066 class:

2067 .sp
2068 .if n \{\
2069 .RS 4
2070 .\}





2071 .nf
2072 \fBprint java/lang/String toString\fR
2073  
2074 .fi
2075 .if n \{\
2076 .RE
2077 .\}
2078 For more information about specifying the commands for the JIT compiler to perform on methods, see the
2079 \fB\-XX:CompileCommand\fR
2080 option\&.
2081 .RE
2082 .PP
2083 \-XX:CompileOnly=\fImethods\fR
2084 .RS 4
2085 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
2086 \fBlength()\fR
2087 method of the
2088 \fBString\fR
2089 class and the
2090 \fBsize()\fR
2091 method of the
2092 \fBList\fR
2093 class, use the following:
2094 .sp
2095 .if n \{\
2096 .RS 4
2097 .\}

2098 .nf
2099 \fB\-XX:CompileOnly=java/lang/String\&.length,java/util/List\&.size\fR
2100  
2101 .fi
2102 .if n \{\
2103 .RE
2104 .\}
2105 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
2106 \fB\-XX:+PrintCompilation\fR
2107 and
2108 \fB\-XX:+LogCompilation\fR
2109 options:
2110 .sp
2111 .if n \{\
2112 .RS 4
2113 .\}
2114 .nf
2115 \fB\-XX:CompileOnly=java\&.lang\&.String::length,java\&.util\&.List::size\fR
2116  
2117 .fi
2118 .if n \{\
2119 .RE
2120 .\}
2121 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:
2122 .sp
2123 .if n \{\
2124 .RS 4
2125 .\}
2126 .nf
2127 \fB\-XX:CompileOnly=java/lang/String\fR
2128 \fB\-XX:CompileOnly=java/lang\fR
2129 \fB\-XX:CompileOnly=\&.length\fR
2130  
2131 .fi
2132 .if n \{\
2133 .RE
2134 .\}
2135 .RE
2136 .PP
2137 \-XX:CompileThreshold=\fIinvocations\fR
2138 .RS 4
2139 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
2140 \fB\-XX:+TieredCompilation\fR\&. The following example shows how to set the number of interpreted method invocations to 5,000:
2141 .sp
2142 .if n \{\
2143 .RS 4
2144 .\}



2145 .nf
2146 \fB\-XX:CompileThreshold=5000\fR
2147  
2148 .fi
2149 .if n \{\
2150 .RE
2151 .\}
2152 You can completely disable interpretation of Java methods before compilation by specifying the
2153 \fB\-Xcomp\fR
2154 option\&.
2155 .RE
2156 .PP
2157 \-XX:+DoEscapeAnalysis
2158 .RS 4
2159 Enables the use of escape analysis\&. This option is enabled by default\&. To disable the use of escape analysis, specify
2160 \fB\-XX:\-DoEscapeAnalysis\fR\&. Only the Java HotSpot Server VM supports this option\&.
2161 .RE
2162 .PP
2163 \-XX:InitialCodeCacheSize=\fIsize\fR
2164 .RS 4
2165 Sets the initial code cache size (in bytes)\&. Append the letter
2166 \fBk\fR
2167 or
2168 \fBK\fR
2169 to indicate kilobytes,
2170 \fBm\fR
2171 or
2172 \fBM\fR
2173 to indicate megabytes,
2174 \fBg\fR
2175 or
2176 \fBG\fR
2177 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:
2178 .sp
2179 .if n \{\
2180 .RS 4
2181 .\}









2182 .nf
2183 \fB\-XX:InitialCodeCacheSize=32k\fR
2184  
2185 .fi
2186 .if n \{\
2187 .RE
2188 .\}
2189 .RE
2190 .PP
2191 \-XX:+Inline
2192 .RS 4
2193 Enables method inlining\&. This option is enabled by default to increase performance\&. To disable method inlining, specify
2194 \fB\-XX:\-Inline\fR\&.
2195 .RE
2196 .PP
2197 \-XX:InlineSmallCode=\fIsize\fR
2198 .RS 4
2199 Sets the maximum code size (in bytes) for compiled methods that should be inlined\&. Append the letter
2200 \fBk\fR
2201 or
2202 \fBK\fR
2203 to indicate kilobytes,
2204 \fBm\fR
2205 or
2206 \fBM\fR
2207 to indicate megabytes,
2208 \fBg\fR
2209 or
2210 \fBG\fR
2211 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:
2212 .sp
2213 .if n \{\
2214 .RS 4
2215 .\}







2216 .nf
2217 \fB\-XX:InlineSmallCode=1000\fR
2218  
2219 .fi
2220 .if n \{\
2221 .RE
2222 .\}
2223 .RE
2224 .PP
2225 \-XX:+LogCompilation
2226 .RS 4
2227 Enables logging of compilation activity to a file named
2228 \fBhotspot\&.log\fR
2229 in the current working directory\&. You can specify a different log file path and name using the
2230 \fB\-XX:LogFile\fR
2231 option\&.
2232 .sp
2233 By default, this option is disabled and compilation activity is not logged\&. The
2234 \fB\-XX:+LogCompilation\fR
2235 option has to be used together with the
2236 \fB\-XX:UnlockDiagnosticVMOptions\fR
2237 option that unlocks diagnostic JVM options\&.








2238 .sp
2239 You can enable verbose diagnostic output with a message printed to the console every time a method is compiled by using the
2240 \fB\-XX:+PrintCompilation\fR
2241 option\&.
2242 .RE
2243 .PP
2244 \-XX:MaxInlineSize=\fIsize\fR
2245 .RS 4
2246 Sets the maximum bytecode size (in bytes) of a method to be inlined\&. Append the letter
2247 \fBk\fR
2248 or
2249 \fBK\fR
2250 to indicate kilobytes,
2251 \fBm\fR
2252 or
2253 \fBM\fR
2254 to indicate megabytes,
2255 \fBg\fR
2256 or
2257 \fBG\fR
2258 to indicate gigabytes\&. By default, the maximum bytecode size is set to 35 bytes:
2259 .sp
2260 .if n \{\
2261 .RS 4
2262 .\}
2263 .nf
2264 \fB\-XX:MaxInlineSize=35\fR
2265  
2266 .fi
2267 .if n \{\
2268 .RE
2269 .\}
2270 .RE
2271 .PP
2272 \-XX:MaxNodeLimit=\fInodes\fR
2273 .RS 4
2274 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:
2275 .sp
2276 .if n \{\
2277 .RS 4
2278 .\}
2279 .nf
2280 \fB\-XX:MaxNodeLimit=65000\fR
2281  
2282 .fi
2283 .if n \{\
2284 .RE
2285 .\}
2286 .RE
2287 .PP
2288 \-XX:MaxTrivialSize=\fIsize\fR
2289 .RS 4
2290 Sets the maximum bytecode size (in bytes) of a trivial method to be inlined\&. Append the letter
2291 \fBk\fR
2292 or
2293 \fBK\fR
2294 to indicate kilobytes,
2295 \fBm\fR
2296 or
2297 \fBM\fR
2298 to indicate megabytes,
2299 \fBg\fR
2300 or
2301 \fBG\fR
2302 to indicate gigabytes\&. By default, the maximum bytecode size of a trivial method is set to 6 bytes:
2303 .sp
2304 .if n \{\
2305 .RS 4
2306 .\}



2307 .nf
2308 \fB\-XX:MaxTrivialSize=6\fR
2309  
2310 .fi
2311 .if n \{\
2312 .RE
2313 .\}
2314 .RE
2315 .PP
2316 \-XX:+OptimizeStringConcat
2317 .RS 4
2318 Enables the optimization of
2319 \fBString\fR
2320 concatenation operations\&. This option is enabled by default\&. To disable the optimization of
2321 \fBString\fR
2322 concatenation operations, specify
2323 \fB\-XX:\-OptimizeStringConcat\fR\&. Only the Java HotSpot Server VM supports this option\&.
2324 .RE
2325 .PP
2326 \-XX:+PrintAssembly
2327 .RS 4
2328 Enables printing of assembly code for bytecoded and native methods by using the external
2329 \fBdisassembler\&.so\fR
2330 library\&. This enables you to see the generated code, which may help you to diagnose performance issues\&.
2331 .sp
2332 By default, this option is disabled and assembly code is not printed\&. The
2333 \fB\-XX:+PrintAssembly\fR
2334 option has to be used together with the
2335 \fB\-XX:UnlockDiagnosticVMOptions\fR
2336 option that unlocks diagnostic JVM options\&.
2337 .RE
2338 .PP
2339 \-XX:+PrintCompilation
2340 .RS 4





2341 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\&.
2342 .sp
2343 You can also log compilation activity to a file by using the
2344 \fB\-XX:+LogCompilation\fR
2345 option\&.
2346 .RE
2347 .PP
2348 \-XX:+PrintInlining
2349 .RS 4
2350 Enables printing of inlining decisions\&. This enables you to see which methods are getting inlined\&.


























2351 .sp
2352 By default, this option is disabled and inlining information is not printed\&. The
2353 \fB\-XX:+PrintInlining\fR
2354 option has to be used together with the
2355 \fB\-XX:+UnlockDiagnosticVMOptions\fR
2356 option that unlocks diagnostic JVM options\&.
2357 .RE
2358 .PP
2359 \-XX:ReservedCodeCacheSize=\fIsize\fR
2360 .RS 4
2361 Sets the maximum code cache size (in bytes) for JIT\-compiled code\&. Append the letter
2362 \fBk\fR
2363 or
2364 \fBK\fR
2365 to indicate kilobytes,
2366 \fBm\fR
2367 or
2368 \fBM\fR
2369 to indicate megabytes,
2370 \fBg\fR
2371 or
2372 \fBG\fR
2373 to indicate gigabytes\&. The default maximum code cache size is 240 MB; if you disable tiered compilation with the option
2374 \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
2375 \fB\-XX:InitialCodeCacheSize\fR\&. This option is equivalent to
2376 \fB\-Xmaxjitcodesize\fR\&.
2377 .RE
2378 .PP
2379 \-XX:RTMAbortRatio=\fIabort_ratio\fR
2380 .RS 4
2381 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
2382 \fB\-XX:+UseRTMDeopt\fR
2383 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\&.
2384 .RE
2385 .PP
2386 \-XX:RTMRetryCount=\fInumber_of_retries\fR
2387 .RS 4
2388 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
2389 \fB\-XX:UseRTMLocking\fR
2390 option must be enabled\&.
2391 .RE
2392 .PP
2393 \-XX:\-TieredCompilation
2394 .RS 4
2395 Disables the use of tiered compilation\&. By default, this option is enabled\&. Only the Java HotSpot Server VM supports this option\&.
2396 .RE
2397 .PP
2398 \-XX:+UseAES
2399 .RS 4
2400 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\&.
2401 .RE
2402 .PP
2403 \-XX:+UseAESIntrinsics
2404 .RS 4
2405 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
2406 \fB\-XX:\-UseAES \-XX:\-UseAESIntrinsics\fR\&. For example, to enable hardware AES, use the following flags:
2407 .sp
2408 .if n \{\
2409 .RS 4
2410 .\}
2411 .nf
2412 \fB\-XX:+UseAES \-XX:+UseAESIntrinsics\fR
2413  
2414 .fi
2415 .if n \{\
2416 .RE
2417 .\}
2418 To support UseAES and UseAESIntrinsics flags for 32\-bit and 64\-bit use
2419 \fB\-server\fR
2420 option to choose Java HotSpot Server VM\&. These flags are not supported on Client VM\&.
2421 .RE
2422 .PP
2423 \-XX:+UseCodeCacheFlushing
2424 .RS 4
2425 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
2426 \fB\-XX:\-UseCodeCacheFlushing\fR\&.
2427 .RE
2428 .PP
2429 \-XX:+UseCondCardMark
2430 .RS 4
2431 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\&.
2432 .RE
2433 .PP
2434 \-XX:+UseRTMDeopt
2435 .RS 4
2436 Auto\-tunes RTM locking depending on the abort ratio\&. This ratio is specified by
2437 \fB\-XX:RTMAbortRatio\fR
2438 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
2439 \fB\-XX:+UseRTMLocking\fR
2440 option must be enabled\&.
2441 .RE
2442 .PP
2443 \-XX:+UseRTMLocking
2444 .RS 4
2445 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)\&.
2446 .sp
2447 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
2448 \fBXBEGIN\fR,
2449 \fBXABORT\fR,
2450 \fBXEND\fR, and
2451 \fBXTEST\fR\&. The
2452 \fBXBEGIN\fR
2453 and
2454 \fBXEND\fR
2455 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
2456 \fBXEND\fR
2457 instruction\&. The
2458 \fBXABORT\fR
2459 instruction can be used to explicitly abort a transaction and the
2460 \fBXEND\fR
2461 instruction to check if a set of instructions are being run in a transaction\&.
2462 .sp
2463 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\&.
2464 .sp
2465 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\&.
2466 .RE
2467 .PP
2468 \-XX:+UseSHA
2469 .RS 4
2470 Enables hardware\-based intrinsics for SHA crypto hash functions for SPARC hardware\&.
2471 \fBUseSHA\fR
2472 is used in conjunction with the
2473 \fBUseSHA1Intrinsics\fR,
2474 \fBUseSHA256Intrinsics\fR, and
2475 \fBUseSHA512Intrinsics\fR
2476 options\&.
2477 .sp
2478 The
2479 \fBUseSHA\fR
2480 and
2481 \fBUseSHA*Intrinsics\fR
2482 flags are enabled by default, and are supported only for Java HotSpot Server VM 64\-bit on SPARC T4 and newer\&.
2483 .sp
2484 This feature is only applicable when using the
2485 \fBsun\&.security\&.provider\&.Sun\fR
2486 provider for SHA operations\&.
2487 .sp
2488 To disable all hardware\-based SHA intrinsics, specify
2489 \fB\-XX:\-UseSHA\fR\&. To disable only a particular SHA intrinsic, use the appropriate corresponding option\&. For example:
2490 \fB\-XX:\-UseSHA256Intrinsics\fR\&.
2491 .RE
2492 .PP
2493 \-XX:+UseSHA1Intrinsics
2494 .RS 4
2495 Enables intrinsics for SHA\-1 crypto hash function\&.
2496 .RE
2497 .PP
2498 \-XX:+UseSHA256Intrinsics
2499 .RS 4
2500 Enables intrinsics for SHA\-224 and SHA\-256 crypto hash functions\&.
2501 .RE
2502 .PP
2503 \-XX:+UseSHA512Intrinsics
2504 .RS 4
2505 Enables intrinsics for SHA\-384 and SHA\-512 crypto hash functions\&.
2506 .RE
2507 .PP
2508 \-XX:+UseSuperWord
2509 .RS 4
2510 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
2511 \fB\-XX:\-UseSuperWord\fR\&. Only the Java HotSpot Server VM supports this option\&.
2512 .RE
2513 .SS "Advanced Serviceability Options"
2514 .PP
2515 These options provide the ability to gather system information and perform extensive debugging\&.
2516 .PP
2517 \-XX:+ExtendedDTraceProbes
2518 .RS 4
2519 Enables additional
2520 \fBdtrace\fR
2521 tool probes that impact the performance\&. By default, this option is disabled and
2522 \fBdtrace\fR
2523 performs only standard probes\&.
2524 .RE
2525 .PP
2526 \-XX:+HeapDumpOnOutOfMemory
2527 .RS 4
2528 Enables the dumping of the Java heap to a file in the current directory by using the heap profiler (HPROF) when a
2529 \fBjava\&.lang\&.OutOfMemoryError\fR
2530 exception is thrown\&. You can explicitly set the heap dump file path and name using the
2531 \fB\-XX:HeapDumpPath\fR
2532 option\&. By default, this option is disabled and the heap is not dumped when an
2533 \fBOutOfMemoryError\fR
2534 exception is thrown\&.
2535 .RE
2536 .PP
2537 \-XX:HeapDumpPath=\fIpath\fR
2538 .RS 4
2539 Sets the path and file name for writing the heap dump provided by the heap profiler (HPROF) when the
2540 \fB\-XX:+HeapDumpOnOutOfMemoryError\fR
2541 option is set\&. By default, the file is created in the current working directory, and it is named
2542 \fBjava_pid\fR\fIpid\fR\fB\&.hprof\fR
2543 where
2544 \fIpid\fR
2545 is the identifier of the process that caused the error\&. The following example shows how to set the default file explicitly (\fB%p\fR
2546 represents the current process identificator):
2547 .sp
2548 .if n \{\
2549 .RS 4
2550 .\}
2551 .nf
2552 \fB\-XX:HeapDumpPath=\&./java_pid%p\&.hprof\fR
2553  
2554 .fi
2555 .if n \{\
2556 .RE
2557 .\}
2558 The following example shows how to set the heap dump file to
2559 \fB/var/log/java/java_heapdump\&.hprof\fR:
2560 .sp
2561 .if n \{\
2562 .RS 4
2563 .\}
2564 .nf
2565 \fB\-XX:HeapDumpPath=/var/log/java/java_heapdump\&.hprof\fR
2566  
2567 .fi
2568 .if n \{\
2569 .RE
2570 .\}
2571 .RE
2572 .PP
2573 \-XX:LogFile=\fIpath\fR
2574 .RS 4
2575 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
2576 \fBhotspot\&.log\fR\&.
2577 .sp
2578 The following example shows how to set the log file to
2579 \fB/var/log/java/hotspot\&.log\fR:

2580 .sp
2581 .if n \{\
2582 .RS 4
2583 .\}
2584 .nf
2585 \fB\-XX:LogFile=/var/log/java/hotspot\&.log\fR
2586  
2587 .fi
2588 .if n \{\
2589 .RE
2590 .\}
2591 .RE
2592 .PP
2593 \-XX:+PrintClassHistogram
2594 .RS 4
2595 Enables printing of a class instance histogram after a
2596 \fBControl+C\fR
2597 event (\fBSIGTERM\fR)\&. By default, this option is disabled\&.
2598 .sp
2599 Setting this option is equivalent to running the
2600 \fBjmap \-histo\fR
2601 command, or the
2602 \fBjcmd \fR\fIpid\fR\fB GC\&.class_histogram\fR
2603 command, where
2604 \fIpid\fR
2605 is the current Java process identifier\&.
2606 .RE
2607 .PP
2608 \-XX:+PrintConcurrentLocks
2609 .RS 4
2610 Enables printing of locks after a event\&. By default, this option is disabled\&.
2611 .sp
2612 Enables printing of
2613 \fBjava\&.util\&.concurrent\fR
2614 locks after a
2615 \fBControl+C\fR
2616 event (\fBSIGTERM\fR)\&. By default, this option is disabled\&.

2617 .sp
2618 Setting this option is equivalent to running the
2619 \fBjstack \-l\fR
2620 command or the
2621 \fBjcmd \fR\fIpid\fR\fB Thread\&.print \-l\fR
2622 command, where
2623 \fIpid\fR
2624 is the current Java process identifier\&.
2625 .RE
2626 .PP
2627 \-XX:+UnlockDiagnosticVMOptions
2628 .RS 4






2629 Unlocks the options intended for diagnosing the JVM\&. By default, this option is disabled and diagnostic options are not available\&.
2630 .RE
2631 .SS "Advanced Garbage Collection Options"
2632 .PP
2633 These options control how garbage collection (GC) is performed by the Java HotSpot VM\&.
2634 .PP
2635 \-XX:+AggressiveHeap
2636 .RS 4
2637 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\&.
2638 .RE
2639 .PP
2640 \-XX:+AlwaysPreTouch
2641 .RS 4
2642 Enables touching of every page on the Java heap during JVM initialization\&. This gets all pages into the memory before entering the
2643 \fBmain()\fR
2644 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\&.
2645 .RE
2646 .PP
2647 \-XX:+CMSClassUnloadingEnabled
2648 .RS 4
2649 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
2650 \fB\-XX:\-CMSClassUnloadingEnabled\fR\&.
2651 .RE
2652 .PP
2653 \-XX:CMSExpAvgFactor=\fIpercent\fR
2654 .RS 4
2655 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%:
2656 .sp
2657 .if n \{\
2658 .RS 4
2659 .\}
2660 .nf
2661 \fB\-XX:CMSExpAvgFactor=15\fR
2662  
2663 .fi
2664 .if n \{\
2665 .RE
2666 .\}
2667 .RE
2668 .PP
2669 \-XX:CMSInitiatingOccupancyFraction=\fIpercent\fR
2670 .RS 4
2671 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
2672 \fB\-XX:CMSTriggerRatio\fR
2673 is used to define the value of the initiating occupancy fraction\&.
2674 .sp






2675 The following example shows how to set the occupancy fraction to 20%:
2676 .sp
2677 .if n \{\
2678 .RS 4
2679 .\}
2680 .nf
2681 \fB\-XX:CMSInitiatingOccupancyFraction=20\fR





2682  
2683 .fi
2684 .if n \{\
2685 .RE
2686 .\}
2687 .RE
2688 .PP
2689 \-XX:+CMSScavengeBeforeRemark
2690 .RS 4
2691 Enables scavenging attempts before the CMS remark step\&. By default, this option is disabled\&.
2692 .RE
2693 .PP
2694 \-XX:CMSTriggerRatio=\fIpercent\fR
2695 .RS 4
2696 Sets the percentage (0 to 100) of the value specified by
2697 \fB\-XX:MinHeapFreeRatio\fR
2698 that is allocated before a CMS collection cycle commences\&. The default value is set to 80%\&.
2699 .sp
2700 The following example shows how to set the occupancy fraction to 75%:
2701 .sp
2702 .if n \{\
2703 .RS 4
2704 .\}
2705 .nf
2706 \fB\-XX:CMSTriggerRatio=75\fR





2707  
2708 .fi
2709 .if n \{\
2710 .RE
2711 .\}
2712 .RE
2713 .PP
2714 \-XX:ConcGCThreads=\fIthreads\fR
2715 .RS 4
2716 Sets the number of threads used for concurrent GC\&. The default value depends on the number of CPUs available to the JVM\&.
2717 .sp
2718 For example, to set the number of threads for concurrent GC to 2, specify the following option:
2719 .sp
2720 .if n \{\
2721 .RS 4
2722 .\}
2723 .nf
2724 \fB\-XX:ConcGCThreads=2\fR
2725  
2726 .fi
2727 .if n \{\
2728 .RE
2729 .\}
2730 .RE
2731 .PP
2732 \-XX:+DisableExplicitGC
2733 .RS 4
2734 Enables the option that disables processing of calls to
2735 \fBSystem\&.gc()\fR\&. This option is disabled by default, meaning that calls to
2736 \fBSystem\&.gc()\fR
2737 are processed\&. If processing of calls to
2738 \fBSystem\&.gc()\fR
2739 is disabled, the JVM still performs GC when necessary\&.
2740 .RE
2741 .PP
2742 \-XX:+ExplicitGCInvokesConcurrent
2743 .RS 4
2744 Enables invoking of concurrent GC by using the
2745 \fBSystem\&.gc()\fR
2746 request\&. This option is disabled by default and can be enabled only together with the
2747 \fB\-XX:+UseConcMarkSweepGC\fR
2748 option\&.
2749 .RE
2750 .PP
2751 \-XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses
2752 .RS 4
2753 Enables invoking of concurrent GC by using the
2754 \fBSystem\&.gc()\fR
2755 request and unloading of classes during the concurrent GC cycle\&. This option is disabled by default and can be enabled only together with the
2756 \fB\-XX:+UseConcMarkSweepGC\fR
2757 option\&.
2758 .RE
2759 .PP
2760 \-XX:G1HeapRegionSize=\fIsize\fR
2761 .RS 4
2762 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\&.
2763 .sp


















2764 The following example shows how to set the size of the subdivisions to 16 MB:
2765 .sp
2766 .if n \{\
2767 .RS 4
2768 .\}
2769 .nf
2770 \fB\-XX:G1HeapRegionSize=16m\fR





2771  
2772 .fi
2773 .if n \{\
2774 .RE
2775 .\}
2776 .RE
2777 .PP
2778 \-XX:+G1PrintHeapRegions
2779 .RS 4
2780 Enables the printing of information about which regions are allocated and which are reclaimed by the G1 collector\&. By default, this option is disabled\&.
2781 .RE
2782 .PP
2783 \-XX:G1ReservePercent=\fIpercent\fR
2784 .RS 4
2785 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%\&.
2786 .sp
2787 The following example shows how to set the reserved heap to 20%:
2788 .sp
2789 .if n \{\
2790 .RS 4
2791 .\}
2792 .nf
2793 \fB\-XX:G1ReservePercent=20\fR
2794  
2795 .fi
2796 .if n \{\
2797 .RE
2798 .\}
2799 .RE
2800 .PP
2801 \-XX:InitialHeapSize=\fIsize\fR
2802 .RS 4
2803 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
2804 \fBk\fR
2805 or
2806 \fBK\fR
2807 to indicate kilobytes,
2808 \fBm\fR
2809 or
2810 \fBM\fR
2811 to indicate megabytes,
2812 \fBg\fR
2813 or
2814 \fBG\fR
2815 to indicate gigabytes\&. The default value is chosen at runtime based on system configuration\&. See the section "Ergonomics" in
2816 \fIJava SE HotSpot Virtual Machine Garbage Collection Tuning Guide\fR
2817 at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gctuning/index\&.html\&.
2818 .sp






2819 The following examples show how to set the size of allocated memory to 6 MB using various units:
2820 .sp
2821 .if n \{\
2822 .RS 4
2823 .\}
2824 .nf
2825 \fB\-XX:InitialHeapSize=6291456\fR
2826 \fB\-XX:InitialHeapSize=6144k\fR
2827 \fB\-XX:InitialHeapSize=6m\fR
2828  
2829 .fi
2830 .if n \{\
2831 .RE
2832 .\}
2833 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
2834 \fB\-XX:NewSize\fR
2835 option\&.
2836 .RE
2837 .PP
2838 \-XX:InitialSurvivorRatio=\fIratio\fR
2839 .RS 4
2840 Sets the initial survivor space ratio used by the throughput garbage collector (which is enabled by the
2841 \fB\-XX:+UseParallelGC\fR
2842 and/or \-\fBXX:+UseParallelOldGC\fR
2843 options)\&. Adaptive sizing is enabled by default with the throughput garbage collector by using the
2844 \fB\-XX:+UseParallelGC\fR
2845 and
2846 \fB\-XX:+UseParallelOldGC\fR
2847 options, and survivor space is resized according to the application behavior, starting with the initial value\&. If adaptive sizing is disabled (using the
2848 \fB\-XX:\-UseAdaptiveSizePolicy\fR
2849 option), then the
2850 \fB\-XX:SurvivorRatio\fR
2851 option should be used to set the size of the survivor space for the entire execution of the application\&.
2852 .sp








2853 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):
2854 .sp
2855 .if n \{\
2856 .RS 4
2857 .\}
2858 .nf
2859 \fBS=Y/(R+2)\fR





2860  
2861 .fi
2862 .if n \{\
2863 .RE
2864 .\}
2865 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\&.
2866 .sp
2867 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\&.
2868 .sp
2869 The following example shows how to set the initial survivor space ratio to 4:
2870 .sp
2871 .if n \{\
2872 .RS 4
2873 .\}
2874 .nf
2875 \fB\-XX:InitialSurvivorRatio=4\fR





2876  
2877 .fi
2878 .if n \{\
2879 .RE
2880 .\}
2881 .RE
2882 .PP
2883 \-XX:InitiatingHeapOccupancyPercent=\fIpercent\fR
2884 .RS 4
2885 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)\&.
2886 .sp
2887 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%:
2888 .sp
2889 .if n \{\
2890 .RS 4
2891 .\}
2892 .nf
2893 \fB\-XX:InitiatingHeapOccupancyPercent=75\fR





2894  
2895 .fi
2896 .if n \{\
2897 .RE
2898 .\}
2899 .RE
2900 .PP
2901 \-XX:MaxGCPauseMillis=\fItime\fR
2902 .RS 4
2903 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\&.
2904 .sp
2905 The following example shows how to set the maximum target pause time to 500 ms:
2906 .sp
2907 .if n \{\
2908 .RS 4
2909 .\}
2910 .nf
2911 \fB\-XX:MaxGCPauseMillis=500\fR
2912  
2913 .fi
2914 .if n \{\
2915 .RE
2916 .\}
2917 .RE
2918 .PP
2919 \-XX:MaxHeapSize=\fIsize\fR
2920 .RS 4
2921 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
2922 \fBk\fR
2923 or
2924 \fBK\fR
2925 to indicate kilobytes,
2926 \fBm\fR
2927 or
2928 \fBM\fR
2929 to indicate megabytes,
2930 \fBg\fR
2931 or
2932 \fBG\fR
2933 to indicate gigabytes\&. The default value is chosen at runtime based on system configuration\&. For server deployments,
2934 \fB\-XX:InitialHeapSize\fR
2935 and
2936 \fB\-XX:MaxHeapSize\fR
2937 are often set to the same value\&. See the section "Ergonomics" in
2938 \fIJava SE HotSpot Virtual Machine Garbage Collection Tuning Guide\fR
2939 at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gctuning/index\&.html\&.
2940 .sp






2941 The following examples show how to set the maximum allowed size of allocated memory to 80 MB using various units:
2942 .sp
2943 .if n \{\
2944 .RS 4
2945 .\}
2946 .nf
2947 \fB\-XX:MaxHeapSize=83886080\fR
2948 \fB\-XX:MaxHeapSize=81920k\fR
2949 \fB\-XX:MaxHeapSize=80m\fR









2950  
2951 .fi
2952 .if n \{\
2953 .RE
2954 .\}
2955 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\&.
2956 .sp
2957 The
2958 \fB\-XX:MaxHeapSize\fR
2959 option is equivalent to
2960 \fB\-Xmx\fR\&.
2961 .RE
2962 .PP
2963 \-XX:MaxHeapFreeRatio=\fIpercent\fR
2964 .RS 4
2965 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%\&.
2966 .sp
2967 The following example shows how to set the maximum free heap ratio to 75%:
2968 .sp
2969 .if n \{\
2970 .RS 4
2971 .\}
2972 .nf
2973 \fB\-XX:MaxHeapFreeRatio=75\fR





2974  
2975 .fi
2976 .if n \{\
2977 .RE
2978 .\}
2979 .RE
2980 .PP
2981 \-XX:MaxMetaspaceSize=\fIsize\fR
2982 .RS 4
2983 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\&.
2984 .sp
2985 The following example shows how to set the maximum class metadata size to 256 MB:
2986 .sp
2987 .if n \{\
2988 .RS 4
2989 .\}
2990 .nf
2991 \fB\-XX:MaxMetaspaceSize=256m\fR





2992  
2993 .fi
2994 .if n \{\
2995 .RE
2996 .\}
2997 .RE
2998 .PP
2999 \-XX:MaxNewSize=\fIsize\fR
3000 .RS 4
3001 Sets the maximum size (in bytes) of the heap for the young generation (nursery)\&. The default value is set ergonomically\&.
3002 .RE
3003 .PP
3004 \-XX:MaxTenuringThreshold=\fIthreshold\fR
3005 .RS 4
3006 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\&.
3007 .sp
3008 The following example shows how to set the maximum tenuring threshold to 10:
3009 .sp
3010 .if n \{\
3011 .RS 4
3012 .\}
3013 .nf
3014 \fB\-XX:MaxTenuringThreshold=10\fR





3015  
3016 .fi
3017 .if n \{\
3018 .RE
3019 .\}
3020 .RE
3021 .PP
3022 \-XX:MetaspaceSize=\fIsize\fR
3023 .RS 4
3024 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\&.
3025 .RE
3026 .PP
3027 \-XX:MinHeapFreeRatio=\fIpercent\fR
3028 .RS 4
3029 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%\&.
3030 .sp
3031 The following example shows how to set the minimum free heap ratio to 25%:
3032 .sp
3033 .if n \{\
3034 .RS 4
3035 .\}
3036 .nf
3037 \fB\-XX:MinHeapFreeRatio=25\fR





3038  
3039 .fi
3040 .if n \{\
3041 .RE
3042 .\}
3043 .RE
3044 .PP
3045 \-XX:NewRatio=\fIratio\fR
3046 .RS 4
3047 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:
3048 .sp
3049 .if n \{\
3050 .RS 4
3051 .\}
3052 .nf
3053 \fB\-XX:NewRatio=1\fR
3054  
3055 .fi
3056 .if n \{\
3057 .RE
3058 .\}
3059 .RE
3060 .PP
3061 \-XX:NewSize=\fIsize\fR
3062 .RS 4
3063 Sets the initial size (in bytes) of the heap for the young generation (nursery)\&. Append the letter
3064 \fBk\fR
3065 or
3066 \fBK\fR
3067 to indicate kilobytes,
3068 \fBm\fR
3069 or
3070 \fBM\fR
3071 to indicate megabytes,
3072 \fBg\fR
3073 or
3074 \fBG\fR
3075 to indicate gigabytes\&.
3076 .sp






3077 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\&.
3078 .sp
3079 The following examples show how to set the initial size of young generation to 256 MB using various units:
3080 .sp
3081 .if n \{\
3082 .RS 4
3083 .\}
3084 .nf
3085 \fB\-XX:NewSize=256m\fR
3086 \fB\-XX:NewSize=262144k\fR
3087 \fB\-XX:NewSize=268435456\fR









3088  
3089 .fi
3090 .if n \{\
3091 .RE
3092 .\}
3093 The
3094 \fB\-XX:NewSize\fR
3095 option is equivalent to
3096 \fB\-Xmn\fR\&.
3097 .RE
3098 .PP
3099 \-XX:ParallelGCThreads=\fIthreads\fR
3100 .RS 4
3101 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\&.
3102 .sp
3103 For example, to set the number of threads for parallel GC to 2, specify the following option:
3104 .sp
3105 .if n \{\
3106 .RS 4
3107 .\}
3108 .nf
3109 \fB\-XX:ParallelGCThreads=2\fR





3110  
3111 .fi
3112 .if n \{\
3113 .RE
3114 .\}
3115 .RE
3116 .PP
3117 \-XX:+ParallelRefProcEnabled
3118 .RS 4
3119 Enables parallel reference processing\&. By default, this option is disabled\&.
3120 .RE
3121 .PP
3122 \-XX:+PrintAdaptiveSizePolicy
3123 .RS 4
3124 Enables printing of information about adaptive generation sizing\&. By default, this option is disabled\&.
3125 .RE
3126 .PP
3127 \-XX:+PrintGC
3128 .RS 4
3129 Enables printing of messages at every GC\&. By default, this option is disabled\&.
3130 .RE
3131 .PP
3132 \-XX:+PrintGCApplicationConcurrentTime
3133 .RS 4
3134 Enables printing of how much time elapsed since the last pause (for example, a GC pause)\&. By default, this option is disabled\&.
3135 .RE
3136 .PP
3137 \-XX:+PrintGCApplicationStoppedTime
3138 .RS 4
3139 Enables printing of how much time the pause (for example, a GC pause) lasted\&. By default, this option is disabled\&.
3140 .RE
3141 .PP
3142 \-XX:+PrintGCDateStamps
3143 .RS 4
3144 Enables printing of a date stamp at every GC\&. By default, this option is disabled\&.
3145 .RE
3146 .PP
3147 \-XX:+PrintGCDetails
3148 .RS 4
3149 Enables printing of detailed messages at every GC\&. By default, this option is disabled\&.
3150 .RE
3151 .PP
3152 \-XX:+PrintGCTaskTimeStamps
3153 .RS 4
3154 Enables printing of time stamps for every individual GC worker thread task\&. By default, this option is disabled\&.
3155 .RE
3156 .PP
3157 \-XX:+PrintGCTimeStamps
3158 .RS 4
3159 Enables printing of time stamps at every GC\&. By default, this option is disabled\&.
3160 .RE
3161 .PP
3162 \-XX:+PrintStringDeduplicationStatistics
3163 .RS 4
3164 Prints detailed deduplication statistics\&. By default, this option is disabled\&. See the
3165 \fB\-XX:+UseStringDeduplication\fR
3166 option\&.
3167 .RE
3168 .PP
3169 \-XX:+PrintTenuringDistribution
3170 .RS 4
3171 Enables printing of tenuring age information\&. The following is an example of the output:
3172 .sp
3173 .if n \{\
3174 .RS 4
3175 .\}
3176 .nf
3177 \fBDesired survivor size 48286924 bytes, new threshold 10 (max 10)\fR
3178 \fB\- age 1: 28992024 bytes, 28992024 total\fR
3179 \fB\- age 2: 1366864 bytes, 30358888 total\fR
3180 \fB\- age 3: 1425912 bytes, 31784800 total\fR
3181 \fB\&.\&.\&.\fR













3182  
3183 .fi
3184 .if n \{\
3185 .RE
3186 .\}
3187 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\&.
3188 .sp
3189 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\&.
3190 .sp
3191 By default, this option is disabled\&.
3192 .RE
3193 .PP
3194 \-XX:+ScavengeBeforeFullGC
3195 .RS 4
3196 Enables GC of the young generation before each full GC\&. This option is enabled by default\&. Oracle recommends that you
3197 \fIdo not\fR
3198 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
3199 \fB\-XX:\-ScavengeBeforeFullGC\fR\&.
3200 .RE
3201 .PP
3202 \-XX:SoftRefLRUPolicyMSPerMB=\fItime\fR
3203 .RS 4
3204 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
3205 \fB\-XX:SoftRefLRUPolicyMSPerMB\fR
3206 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
3207 \fB\-Xmx\fR
3208 option has a significant effect on how quickly soft references are garbage collected\&.
3209 .sp
3210 The following example shows how to set the value to 2\&.5 seconds:
3211 .sp
3212 .if n \{\
3213 .RS 4
3214 .\}
3215 .nf
3216 \fB\-XX:SoftRefLRUPolicyMSPerMB=2500\fR





3217  
3218 .fi
3219 .if n \{\
3220 .RE
3221 .\}
3222 .RE
3223 .PP
3224 \-XX:StringDeduplicationAgeThreshold=\fIthreshold\fR
3225 .RS 4
3226 \fBString\fR
3227 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
3228 \fB\-XX:+PrintTenuringDistribution\fR
3229 option\&. Note that
3230 \fBString\fR
3231 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
3232 \fB3\fR\&. See the
3233 \fB\-XX:+UseStringDeduplication\fR
3234 option\&.
3235 .RE
3236 .PP
3237 \-XX:SurvivorRatio=\fIratio\fR
3238 .RS 4
3239 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:
3240 .sp
3241 .if n \{\
3242 .RS 4
3243 .\}
3244 .nf
3245 \fB\-XX:SurvivorRatio=4\fR





3246  
3247 .fi
3248 .if n \{\
3249 .RE
3250 .\}
3251 .RE
3252 .PP
3253 \-XX:TargetSurvivorRatio=\fIpercent\fR
3254 .RS 4
3255 Sets the desired percentage of survivor space (0 to 100) used after young garbage collection\&. By default, this option is set to 50%\&.
3256 .sp
3257 The following example shows how to set the target survivor space ratio to 30%:
3258 .sp
3259 .if n \{\
3260 .RS 4
3261 .\}
3262 .nf
3263 \fB\-XX:TargetSurvivorRatio=30\fR
3264  
3265 .fi
3266 .if n \{\
3267 .RE
3268 .\}
3269 .RE
3270 .PP
3271 \-XX:TLABSize=\fIsize\fR
3272 .RS 4
3273 Sets the initial size (in bytes) of a thread\-local allocation buffer (TLAB)\&. Append the letter
3274 \fBk\fR
3275 or
3276 \fBK\fR
3277 to indicate kilobytes,
3278 \fBm\fR
3279 or
3280 \fBM\fR
3281 to indicate megabytes,
3282 \fBg\fR
3283 or
3284 \fBG\fR
3285 to indicate gigabytes\&. If this option is set to 0, then the JVM chooses the initial size automatically\&.
3286 .sp






3287 The following example shows how to set the initial TLAB size to 512 KB:
3288 .sp
3289 .if n \{\
3290 .RS 4
3291 .\}
3292 .nf
3293 \fB\-XX:TLABSize=512k\fR





3294  
3295 .fi
3296 .if n \{\
3297 .RE
3298 .\}
3299 .RE
3300 .PP
3301 \-XX:+UseAdaptiveSizePolicy
3302 .RS 4
3303 Enables the use of adaptive generation sizing\&. This option is enabled by default\&. To disable adaptive generation sizing, specify
3304 \fB\-XX:\-UseAdaptiveSizePolicy\fR
3305 and set the size of the memory allocation pool explicitly (see the
3306 \fB\-XX:SurvivorRatio\fR
3307 option)\&.
3308 .RE
3309 .PP
3310 \-XX:+UseCMSInitiatingOccupancyOnly
3311 .RS 4
3312 Enables the use of the occupancy value as the only criterion for initiating the CMS collector\&. By default, this option is disabled and other criteria may be used\&.
3313 .RE
3314 .PP
3315 \-XX:+UseConcMarkSweepGC
3316 .RS 4
3317 Enables the use of the CMS garbage collector for the old generation\&. Oracle recommends that you use the CMS garbage collector when application latency requirements cannot be met by the throughput (\fB\-XX:+UseParallelGC\fR) garbage collector\&. The G1 garbage collector (\fB\-XX:+UseG1GC\fR) is another alternative\&.
3318 .sp
3319 By default, this option is disabled and the collector is chosen automatically based on the configuration of the machine and type of the JVM\&. When this option is enabled, the
3320 \fB\-XX:+UseParNewGC\fR
3321 option is automatically set and you should not disable it, because the following combination of options has been deprecated in JDK 8:
3322 \fB\-XX:+UseConcMarkSweepGC \-XX:\-UseParNewGC\fR\&.
3323 .RE
3324 .PP
3325 \-XX:+UseG1GC
3326 .RS 4
3327 Enables the use of the garbage\-first (G1) garbage collector\&. It is a server\-style garbage collector, targeted for multiprocessor machines with a large amount of RAM\&. It meets GC pause time goals with high probability, while maintaining good throughput\&. The G1 collector is recommended for applications requiring large heaps (sizes of around 6 GB or larger) with limited GC latency requirements (stable and predictable pause time below 0\&.5 seconds)\&.
3328 .sp
3329 By default, this option is disabled and the collector is chosen automatically based on the configuration of the machine and type of the JVM\&.
3330 .RE
3331 .PP
3332 \-XX:+UseGCOverheadLimit
3333 .RS 4
3334 Enables the use of a policy that limits the proportion of time spent by the JVM on GC before an
3335 \fBOutOfMemoryError\fR
3336 exception is thrown\&. This option is enabled, by default and the parallel GC will throw an
3337 \fBOutOfMemoryError\fR
3338 if more than 98% of the total time is spent on garbage collection and less than 2% of the heap is recovered\&. When the heap is small, this feature can be used to prevent applications from running for long periods of time with little or no progress\&. To disable this option, specify
3339 \fB\-XX:\-UseGCOverheadLimit\fR\&.
3340 .RE
3341 .PP
3342 \-XX:+UseNUMA
3343 .RS 4
3344 Enables performance optimization of an application on a machine with nonuniform memory architecture (NUMA) by increasing the application\*(Aqs use of lower latency memory\&. By default, this option is disabled and no optimization for NUMA is made\&. The option is only available when the parallel garbage collector is used (\fB\-XX:+UseParallelGC\fR)\&.
3345 .RE
3346 .PP
3347 \-XX:+UseParallelGC
3348 .RS 4
3349 Enables the use of the parallel scavenge garbage collector (also known as the throughput collector) to improve the performance of your application by leveraging multiple processors\&.
3350 .sp
3351 By default, this option is disabled and the collector is chosen automatically based on the configuration of the machine and type of the JVM\&. If it is enabled, then the
3352 \fB\-XX:+UseParallelOldGC\fR
3353 option is automatically enabled, unless you explicitly disable it\&.
3354 .RE
3355 .PP
3356 \-XX:+UseParallelOldGC
3357 .RS 4
3358 Enables the use of the parallel garbage collector for full GCs\&. By default, this option is disabled\&. Enabling it automatically enables the
3359 \fB\-XX:+UseParallelGC\fR
3360 option\&.
3361 .RE
3362 .PP
3363 \-XX:+UseParNewGC
3364 .RS 4
3365 Enables the use of parallel threads for collection in the young generation\&. By default, this option is disabled\&. It is automatically enabled when you set the
3366 \fB\-XX:+UseConcMarkSweepGC\fR
3367 option\&. Using the
3368 \fB\-XX:+UseParNewGC\fR
3369 option without the
3370 \fB\-XX:+UseConcMarkSweepGC\fR
3371 option was deprecated in JDK 8\&.
3372 .RE
3373 .PP
3374 \-XX:+UseSerialGC
3375 .RS 4
3376 Enables the use of the serial garbage collector\&. This is generally the best choice for small and simple applications that do not require any special functionality from garbage collection\&. By default, this option is disabled and the collector is chosen automatically based on the configuration of the machine and type of the JVM\&.
3377 .RE
3378 .PP
3379 \-XX:+UseSHM
3380 .RS 4
3381 On Linux, enables the JVM to use shared memory to setup large pages\&.
3382 .sp
3383 For more information, see "Large Pages"\&.
3384 .RE
3385 .PP
3386 \-XX:+UseStringDeduplication
3387 .RS 4
3388 Enables string deduplication\&. By default, this option is disabled\&. To use this option, you must enable the garbage\-first (G1) garbage collector\&. See the
3389 \fB\-XX:+UseG1GC\fR
3390 option\&.
3391 .sp
3392 \fIString deduplication\fR
3393 reduces the memory footprint of
3394 \fBString\fR
3395 objects on the Java heap by taking advantage of the fact that many
3396 \fBString\fR
3397 objects are identical\&. Instead of each
3398 \fBString\fR
3399 object pointing to its own character array, identical
3400 \fBString\fR
3401 objects can point to and share the same character array\&.
3402 .RE
3403 .PP
3404 \-XX:+UseTLAB
3405 .RS 4
3406 Enables the use of thread\-local allocation blocks (TLABs) in the young generation space\&. This option is enabled by default\&. To disable the use of TLABs, specify
3407 \fB\-XX:\-UseTLAB\fR\&.
3408 .RE
3409 .SS "Deprecated and Removed Options"
3410 .PP
3411 These options were included in the previous release, but have since been considered unnecessary\&.
3412 .PP
3413 \-Xincgc
3414 .RS 4
3415 Enables incremental garbage collection\&. This option was deprecated in JDK 8 with no replacement\&.
3416 .RE
3417 .PP
3418 \-Xrun\fIlibname\fR
3419 .RS 4
3420 Loads the specified debugging/profiling library\&. This option was superseded by the
3421 \fB\-agentlib\fR
3422 option\&.
3423 .RE
3424 .PP
3425 \-XX:CMSIncrementalDutyCycle=\fIpercent\fR
3426 .RS 4
3427 Sets the percentage of time (0 to 100) between minor collections that the concurrent collector is allowed to run\&. This option was deprecated in JDK 8 with no replacement, following the deprecation of the
3428 \fB\-XX:+CMSIncrementalMode\fR
3429 option\&.
3430 .RE
3431 .PP
3432 \-XX:CMSIncrementalDutyCycleMin=\fIpercent\fR
3433 .RS 4
3434 Sets the percentage of time (0 to 100) between minor collections that is the lower bound for the duty cycle when
3435 \fB\-XX:+CMSIncrementalPacing\fR
3436 is enabled\&. This option was deprecated in JDK 8 with no replacement, following the deprecation of the
3437 \fB\-XX:+CMSIncrementalMode\fR
3438 option\&.
3439 .RE
3440 .PP
3441 \-XX:+CMSIncrementalMode
3442 .RS 4
3443 Enables the incremental mode for the CMS collector\&. This option was deprecated in JDK 8 with no replacement, along with other options that start with
3444 \fBCMSIncremental\fR\&.
3445 .RE
3446 .PP
3447 \-XX:CMSIncrementalOffset=\fIpercent\fR
3448 .RS 4
3449 Sets the percentage of time (0 to 100) by which the incremental mode duty cycle is shifted to the right within the period between minor collections\&. This option was deprecated in JDK 8 with no replacement, following the deprecation of the
3450 \fB\-XX:+CMSIncrementalMode\fR
3451 option\&.
3452 .RE
3453 .PP
3454 \-XX:+CMSIncrementalPacing
3455 .RS 4
3456 Enables automatic adjustment of the incremental mode duty cycle based on statistics collected while the JVM is running\&. This option was deprecated in JDK 8 with no replacement, following the deprecation of the
3457 \fB\-XX:+CMSIncrementalMode\fR
3458 option\&.
3459 .RE
3460 .PP
3461 \-XX:CMSIncrementalSafetyFactor=\fIpercent\fR
3462 .RS 4
3463 Sets the percentage of time (0 to 100) used to add conservatism when computing the duty cycle\&. This option was deprecated in JDK 8 with no replacement, following the deprecation of the
3464 \fB\-XX:+CMSIncrementalMode\fR
3465 option\&.
3466 .RE
3467 .PP
3468 \-XX:CMSInitiatingPermOccupancyFraction=\fIpercent\fR
3469 .RS 4
3470 Sets the percentage of the permanent generation occupancy (0 to 100) at which to start a GC\&. This option was deprecated in JDK 8 with no replacement\&.
3471 .RE
3472 .PP
3473 \-XX:MaxPermSize=\fIsize\fR
3474 .RS 4
3475 Sets the maximum permanent generation space size (in bytes)\&. This option was deprecated in JDK 8, and superseded by the
3476 \fB\-XX:MaxMetaspaceSize\fR
3477 option\&.
3478 .RE
3479 .PP
3480 \-XX:PermSize=\fIsize\fR
3481 .RS 4
3482 Sets the space (in bytes) allocated to the permanent generation that triggers a garbage collection if it is exceeded\&. This option was deprecated un JDK 8, and superseded by the
3483 \fB\-XX:MetaspaceSize\fR
3484 option\&.
3485 .RE
3486 .PP
3487 \-XX:+UseSplitVerifier
3488 .RS 4
3489 Enables splitting of the verification process\&. By default, this option was enabled in the previous releases, and verification was split into two phases: type referencing (performed by the compiler) and type checking (performed by the JVM runtime)\&. This option was deprecated in JDK 8, and verification is now split by default without a way to disable it\&.
3490 .RE
3491 .PP
3492 \-XX:+UseStringCache
3493 .RS 4
3494 Enables caching of commonly allocated strings\&. This option was removed from JDK 8 with no replacement\&.
3495 .RE
3496 .SH "PERFORMANCE TUNING EXAMPLES"
3497 .PP
3498 The following examples show how to use experimental tuning flags to either optimize throughput or to provide lower response time\&.
3499 .PP
3500 \fBExample 1 \fRTuning for Higher Throughput
3501 .RS 4
3502 .sp
3503 .if n \{\
3504 .RS 4
3505 .\}
3506 .nf
3507 \fBjava \-d64 \-server \-XX:+AggressiveOpts \-XX:+UseLargePages \-Xmn10g  \-Xms26g \-Xmx26g\fR
3508  
3509 .fi
3510 .if n \{\
3511 .RE
3512 .\}
3513 .RE
3514 .PP
3515 \fBExample 2 \fRTuning for Lower Response Time
3516 .RS 4
3517 .sp
3518 .if n \{\
3519 .RS 4
3520 .\}
3521 .nf
3522 \fBjava \-d64 \-XX:+UseG1GC \-Xms26g Xmx26g \-XX:MaxGCPauseMillis=500 \-XX:+PrintGCTimeStamp\fR
3523  
3524 .fi
3525 .if n \{\
3526 .RE
3527 .\}
3528 .RE
3529 .SH "LARGE PAGES"

3530 .PP
3531 Also known as huge pages, large pages are memory pages that are significantly larger than the standard memory page size (which varies depending on the processor and operating system)\&. Large pages optimize processor Translation\-Lookaside Buffers\&.
3532 .PP
3533 A Translation\-Lookaside Buffer (TLB) is a page translation cache that holds the most\-recently used virtual\-to\-physical address translations\&. TLB is a scarce system resource\&. A TLB miss can be costly as the processor must then read from the hierarchical page table, which may require multiple memory accesses\&. By using a larger memory page size, a single TLB entry can represent a larger memory range\&. There will be less pressure on TLB, and memory\-intensive applications may have better performance\&.
3534 .PP
3535 However, large pages page memory can negatively affect system performance\&. For example, when a large mount of memory is pinned by an application, it may create a shortage of regular memory and cause excessive paging in other applications and slow down the entire system\&. Also, a system that has been up for a long time could produce excessive fragmentation, which could make it impossible to reserve enough large page memory\&. When this happens, either the OS or JVM reverts to using regular pages\&.
3536 .SS "Large Pages Support"
3537 .PP
3538 Solaris and Linux support large pages\&.
3539 .sp
3540 .it 1 an-trap
3541 .nr an-no-space-flag 1
3542 .nr an-break-flag 1
3543 .br
3544 .ps +1
3545 \fBSolaris\fR
3546 .RS 4
3547 .PP
3548 Solaris 9 and later include Multiple Page Size Support (MPSS); no additional configuration is necessary\&. See http://www\&.oracle\&.com/technetwork/server\-storage/solaris10/overview/solaris9\-features\-scalability\-135663\&.html\&.
3549 .RE
3550 .sp
3551 .it 1 an-trap
3552 .nr an-no-space-flag 1
3553 .nr an-break-flag 1
3554 .br
3555 .ps +1
3556 \fBLinux\fR
3557 .RS 4
3558 .PP
3559 The 2\&.6 kernel supports large pages\&. Some vendors have backported the code to their 2\&.4\-based releases\&. To check if your system can support large page memory, try the following:
3560 .sp
3561 .if n \{\
3562 .RS 4
3563 .\}
3564 .nf
3565 \fB# cat /proc/meminfo | grep Huge\fR
3566 \fBHugePages_Total: 0\fR
3567 \fBHugePages_Free: 0\fR
3568 \fBHugepagesize: 2048 kB\fR
3569  
3570 .fi
3571 .if n \{\
3572 .RE
3573 .\}
3574 .PP
3575 If the output shows the three "Huge" variables, then your system can support large page memory but it needs to be configured\&. If the command prints nothing, then your system does not support large pages\&. To configure the system to use large page memory, login as
3576 \fBroot\fR, and then follow these steps:






3577 .sp
3578 .RS 4
3579 .ie n \{\
3580 \h'-04' 1.\h'+01'\c
3581 .\}
3582 .el \{\
3583 .sp -1
3584 .IP "  1." 4.2
3585 .\}
3586 If you are using the option
3587 \fB\-XX:+UseSHM\fR
3588 (instead of
3589 \fB\-XX:+UseHugeTLBFS\fR), then increase the
3590 \fBSHMMAX\fR
3591 value\&. It must be larger than the Java heap size\&. On a system with 4 GB of physical RAM (or less), the following will make all the memory sharable:
3592 .sp
3593 .if n \{\
3594 .RS 4
3595 .\}
3596 .nf
3597 \fB# echo 4294967295 > /proc/sys/kernel/shmmax\fR
3598  
3599 .fi
3600 .if n \{\
3601 .RE
3602 .\}
3603 .RE
3604 .sp
3605 .RS 4
3606 .ie n \{\
3607 \h'-04' 2.\h'+01'\c
3608 .\}
3609 .el \{\
3610 .sp -1
3611 .IP "  2." 4.2
3612 .\}
3613 If you are using the option
3614 \fB\-XX:+UseSHM\fR
3615 or
3616 \fB\-XX:+UseHugeTLBFS\fR, then specify the number of large pages\&. In the following example, 3 GB of a 4 GB system are reserved for large pages (assuming a large page size of 2048kB, then 3 GB = 3 * 1024 MB = 3072 MB = 3072 * 1024 kB = 3145728 kB and 3145728 kB / 2048 kB = 1536):
3617 .sp
3618 .if n \{\
3619 .RS 4
3620 .\}
3621 .nf
3622 \fB# echo 1536 > /proc/sys/vm/nr_hugepages\fR
3623  
3624 .fi
3625 .if n \{\
3626 .RE
3627 .\}
3628 .RE
3629 .if n \{\
3630 .sp
3631 .\}
3632 .RS 4
3633 .it 1 an-trap
3634 .nr an-no-space-flag 1
3635 .nr an-break-flag 1
3636 .br
3637 .ps +1
3638 \fBNote\fR
3639 .ps -1
3640 .br
3641 .TS
3642 allbox tab(:);
3643 l.
3644 T{
3645 .sp
3646 .RS 4
3647 .ie n \{\
3648 \h'-04'\(bu\h'+03'\c
3649 .\}
3650 .el \{\
3651 .sp -1
3652 .IP \(bu 2.3
3653 .\}
3654 Note that the values contained in
3655 \fB/proc\fR
3656 will reset after you reboot your system, so may want to set them in an initialization script (for example,
3657 \fBrc\&.local\fR
3658 or
3659 \fBsysctl\&.conf\fR)\&.
3660 .RE
3661 .sp
3662 .RS 4
3663 .ie n \{\
3664 \h'-04'\(bu\h'+03'\c
3665 .\}
3666 .el \{\
3667 .sp -1
3668 .IP \(bu 2.3
3669 .\}
3670 If you configure (or resize) the OS kernel parameters
3671 \fB/proc/sys/kernel/shmmax\fR
3672 or
3673 \fB/proc/sys/vm/nr_hugepages\fR, Java processes may allocate large pages for areas in addition to the Java heap\&. These steps can allocate large pages for the following areas:
3674 .sp
3675 .RS 4
3676 .ie n \{\
3677 \h'-04'\(bu\h'+03'\c
3678 .\}
3679 .el \{\
3680 .sp -1
3681 .IP \(bu 2.3
3682 .\}
3683 Java heap
3684 .RE
3685 .sp
3686 .RS 4
3687 .ie n \{\
3688 \h'-04'\(bu\h'+03'\c
3689 .\}
3690 .el \{\
3691 .sp -1
3692 .IP \(bu 2.3
3693 .\}
3694 Code cache
3695 .RE
3696 .sp
3697 .RS 4
3698 .ie n \{\
3699 \h'-04'\(bu\h'+03'\c
3700 .\}
3701 .el \{\
3702 .sp -1
3703 .IP \(bu 2.3
3704 .\}
3705 The marking bitmap data structure for the parallel GC
3706 .RE
3707 .sp
3708 Consequently, if you configure the
3709 \fBnr_hugepages\fR
3710 parameter to the size of the Java heap, then the JVM can fail in allocating the code cache areas on large pages because these areas are quite large in size\&.
3711 .RE
3712 T}
3713 .TE
3714 .sp 1
3715 .sp .5v
3716 .RE
3717 .RE
3718 .SH "EXIT STATUS"
3719 .PP
3720 The following exit values are typically returned by the launcher when the launcher is called with the wrong arguments, serious errors, or exceptions thrown by the JVM\&. However, a Java application may choose to return any value by using the API call
3721 \fBSystem\&.exit(exitValue)\fR\&. The values are:
3722 .sp
3723 .RS 4
3724 .ie n \{\
3725 \h'-04'\(bu\h'+03'\c
3726 .\}
3727 .el \{\
3728 .sp -1
3729 .IP \(bu 2.3
3730 .\}
3731 \fB0\fR: Successful completion
3732 .RE
3733 .sp
3734 .RS 4
3735 .ie n \{\
3736 \h'-04'\(bu\h'+03'\c
3737 .\}
3738 .el \{\
3739 .sp -1
3740 .IP \(bu 2.3
3741 .\}
3742 \fB>0\fR: An error occurred
3743 .RE
3744 .SH "SEE ALSO"
3745 .sp
3746 .RS 4
3747 .ie n \{\
3748 \h'-04'\(bu\h'+03'\c
3749 .\}
3750 .el \{\
3751 .sp -1
3752 .IP \(bu 2.3
3753 .\}
3754 javac(1)
3755 .RE
3756 .sp
3757 .RS 4
3758 .ie n \{\
3759 \h'-04'\(bu\h'+03'\c
3760 .\}
3761 .el \{\
3762 .sp -1
3763 .IP \(bu 2.3
3764 .\}
3765 jdb(1)
3766 .RE
3767 .sp
3768 .RS 4
3769 .ie n \{\
3770 \h'-04'\(bu\h'+03'\c
3771 .\}
3772 .el \{\
3773 .sp -1
3774 .IP \(bu 2.3
3775 .\}
3776 javah(1)
3777 .RE
3778 .sp
3779 .RS 4
3780 .ie n \{\
3781 \h'-04'\(bu\h'+03'\c
3782 .\}
3783 .el \{\
3784 .sp -1
3785 .IP \(bu 2.3
3786 .\}
3787 jar(1)
3788 .RE
3789 .sp
3790 .RS 4
3791 .ie n \{\
3792 \h'-04'\(bu\h'+03'\c
3793 .\}
3794 .el \{\
3795 .sp -1
3796 .IP \(bu 2.3
3797 .\}
3798 jstat(1)
3799 .RE
3800 .br
3801 'pl 8.5i
3802 'bp