blob: f32570f38d0e181e3caed05b05bed52ee6ef6081 [file] [log] [blame]
rgallardb6435452013-11-25 20:19:02 -08001'\" t
2.\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
3.\"
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: 21 November 2013
27.\" SectDesc: Basic Tools
28.\" Title: java.1
29.\"
30.if n .pl 99999
31.TH java 1 "21 November 2013" "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.\" -----------------------------------------------------------------
duke6e45e102007-12-01 00:00:00 +000051
rgallardb6435452013-11-25 20:19:02 -080052.SH NAME
53java \- 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
67Command-line options separated by spaces\&. See Options\&.
68.TP
69\fIclassname\fR
70The name of the class to be launched\&.
71.TP
72\fIfilename\fR
73The name of the Java Archive (JAR) file to be called\&. Used only with the \f3-jar\fR option\&.
74.TP
75\fIargs\fR
76The arguments passed to the \f3main()\fR method separated by spaces\&.
77.SH DESCRIPTION
78The \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
87The \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
89By 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
91The 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
93Arguments after the class file name or the JAR file name are passed to the \f3main()\fR method\&.
94.SH OPTIONS
95The \f3java\fR command supports a wide range of options that can be divided into the following categories:
96.TP 0.2i
97\(bu
98Standard Options
99.TP 0.2i
100\(bu
101Non-Standard Options
102.TP 0.2i
103\(bu
104Advanced Runtime Options
105.TP 0.2i
106\(bu
107Advanced JIT Compiler Options
108.TP 0.2i
109\(bu
110Advanced Serviceability Options
111.TP 0.2i
112\(bu
113Advanced Garbage Collection Options
114.PP
115Standard 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
117Non-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
119Advanced 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
121To 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
123Boolean 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
125For 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
127These 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
131Loads the specified native agent library\&. After the library name, a comma-separated list of options specific to the library can be used\&.
132
133If 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
135The 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
146The 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
157For more information about the native agent libraries, refer to the following:
158.RS
159.TP 0.2i
160\(bu
161The \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
164Agent 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
170Loads 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
174Selects 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
176For 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
180Sets 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
184Runs 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
188Runs 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
190Currently 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
duke6e45e102007-12-01 00:00:00 +0000192.nf
rgallardb6435452013-11-25 20:19:02 -0800193-disableassertions[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR], -da[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
194.br
duke6e45e102007-12-01 00:00:00 +0000195.fi
rgallardb6435452013-11-25 20:19:02 -0800196Disables assertions\&. By default, assertions are disabled in all packages and classes\&.
duke6e45e102007-12-01 00:00:00 +0000197
rgallardb6435452013-11-25 20:19:02 -0800198With 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
200The \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
202To 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
215Disables assertions in all system classes\&.
216.TP
217.nf
218-enableassertions[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR], -ea[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
219.br
220.fi
221Enables assertions\&. By default, assertions are disabled in all packages and classes\&.
222
223With 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
225The \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
227To 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
240Enables assertions in all system classes\&.
241.TP
242-help, -?
243.br
244Displays usage information for the \f3java\fR command without actually running the JVM\&.
245.TP
246-jar \fIfilename\fR
247.br
248Executes 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
250When 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
252For more information about JAR files, see the following resources:
253.RS
254.TP 0.2i
255\(bu
256jar(1)
257.TP 0.2i
258\(bu
259The Java Archive (JAR) Files guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jar/index\&.html
260.TP 0.2i
261\(bu
262Lesson: 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
268Loads 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
272Includes user-private JREs in the version search\&.
273.TP
274-no-jre-restrict-search
275.br
276Excludes user-private JREs from the version search\&.
277.TP
278-server
279.br
280Selects 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
282For 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
286Displays 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
290Shows 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
303Displays information about each loaded class\&.
304.TP
305-verbose:gc
306.br
307Displays information about each garbage collection (GC) event\&.
308.TP
309-verbose:jni
310.br
311Displays information about the use of native methods and other Java Native Interface (JNI) activity\&.
312.TP
313-version
314.br
315Displays 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
319Specifies 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
321The \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
332Quotation marks are necessary only if there are spaces in the \fIrelease\fR parameter\&.
333
334For 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
336These options are general purpose options that are specific to the Java HotSpot Virtual Machine\&.
337.TP
338-X
339.br
340Displays help for all available \f3-X\fR options\&.
341.TP
342-Xbatch
343.br
344Disables 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
346This option is equivalent to \f3-XX:-BackgroundCompilation\fR\&.
347.TP
348-Xbootclasspath:\fIpath\fR
349.br
350Specifies 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
356Specifies a list of directories, JAR files, and ZIP archives separated by colons (:) to append to the end of the default bootstrap class path\&.
357
358Do 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
362Specifies a list of directories, JAR files, and ZIP archives separated by colons (:) to prepend to the front of the default bootstrap class path\&.
363
364Do 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-Xboundthreads
367.br
368Binds user-level threads to kernel threads\&.
369.TP
370-Xcheck:jni
371.br
372Performs 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\&.
373.TP
374-Xcomp
375.br
rgallard3369a1b2013-12-13 14:21:33 -0800376Forces 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\&.
rgallardb6435452013-11-25 20:19:02 -0800377
378You can also change the number of interpreted method invocations before compilation using the \f3-XX:CompileThreshold\fR option\&.
379.TP
380-Xdebug
381.br
382Does nothing\&. Provided for backward compatibility\&.
383.TP
384-Xdiag
385.br
386Shows additional diagnostic messages\&.
387.TP
388-Xfuture
389.br
390Enables 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\&.
391.TP
rgallardb6435452013-11-25 20:19:02 -0800392-Xint
393.br
394Runs 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\&.
395.TP
396-Xinternalversion
397.br
398Displays more detailed JVM version information than the \f3-version\fR option, and then exits\&.
399.TP
400-Xloggc:\fIfilename\fR
401.br
402Sets 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\&.
403
404Example:
405.sp
406.nf
407\f3\-Xloggc:garbage\-collection\&.log\fP
408.fi
409.nf
410\f3\fP
411.fi
412.sp
413
414.TP
415-Xmaxjitcodesize=\fIsize\fR
416.br
417Specifies 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:
418.sp
419.nf
420\f3\-Xmaxjitcodesize=48m\fP
421.fi
422.nf
423\f3\fP
424.fi
425.sp
426
427
428This option is equivalent to \f3-XX:ReservedCodeCacheSize\fR\&.
429.TP
430-Xmixed
431.br
432Executes all bytecode by the interpreter except for hot methods, which are compiled to native code\&.
433.TP
434-Xmn\fIsize\fR
435.br
436Sets 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\&.
437
438The 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\&.
439
440The following examples show how to set the initial and maximum size of young generation to 256 MB using various units:
441.sp
442.nf
443\f3\-Xmn256m\fP
444.fi
445.nf
446\f3\-Xmn262144k\fP
447.fi
448.nf
449\f3\-Xmn268435456\fP
450.fi
451.nf
452\f3\fP
453.fi
454.sp
455
456
457Instead 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\&.
458.TP
459-Xms\fIsize\fR
460.br
461Sets 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\&.
462
463The following examples show how to set the size of allocated memory to 6 MB using various units:
464.sp
465.nf
466\f3\-Xms6291456\fP
467.fi
468.nf
469\f3\-Xms6144k\fP
470.fi
471.nf
472\f3\-Xms6m\fP
473.fi
474.nf
475\f3\fP
476.fi
477.sp
478
479
480If 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\&.
481.TP
482-Xmx\fIsize\fR
483.br
484Specifies 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\&. For more information, see Garbage Collector Ergonomics at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gc-ergonomics\&.html
485
486The following examples show how to set the maximum allowed size of allocated memory to 80 MB using various units:
487.sp
488.nf
489\f3\-Xmx83886080\fP
490.fi
491.nf
492\f3\-Xmx81920k\fP
493.fi
494.nf
495\f3\-Xmx80m\fP
496.fi
497.nf
498\f3\fP
499.fi
500.sp
501
502
503The \f3-Xmx\fR option is equivalent to \f3-XX:MaxHeapSize\fR\&.
504.TP
505-Xnoclassgc
506.br
507Disables garbage collection (GC) of classes\&. This can save some GC time, which shortens interruptions during the application run\&.
508
509When 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\&.
510.TP
511-Xprof
512.br
513Profiles 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\&.
514.TP
515-Xrs
516.br
517Reduces the use of operating system signals by the JVM\&.
518
519Shutdown 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\&.
520
521The 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\&.
522
523The 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\&.
524
525Applications 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\&.
526
527There are two consequences of specifying \f3-Xrs\fR:
528.RS
529.TP 0.2i
530\(bu
531\f3SIGQUIT\fR thread dumps are not available\&.
532.TP 0.2i
533\(bu
534User code is responsible for causing shutdown hooks to run, for example, by calling \f3System\&.exit()\fR when the JVM is to be terminated\&.
535.RE
536
537.TP
538-Xshare:\fImode\fR
539.br
540Sets the class data sharing mode\&. Possible \fImode\fR arguments for this option include the following:
541.RS
542.TP
543auto
544Use shared class data if possible\&. This is the default value for Java HotSpot 32-Bit Client VM\&.
545.TP
546on
547Require the use of class data sharing\&. Print an error message and exit if class data sharing cannot be used\&.
548.TP
549off
550Do 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\&.
551.TP
552dump
553Manually generate the class data sharing archive\&.
554.RE
555
556.TP
557-XshowSettings:\fIcategory\fR
558.br
559Shows settings and continues\&. Possible \fIcategory\fR arguments for this option include the following:
560.RS
561.TP
562all
563Shows all categories of settings\&. This is the default value\&.
564.TP
565locale
566Shows settings related to locale\&.
567.TP
568properties
569Shows settings related to system properties\&.
570.TP
571vm
572Shows the settings of the JVM\&.
573.RE
574
575.TP
576-Xss\fIsize\fR
577.br
578Sets 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:
579.RS
580.TP 0.2i
581\(bu
582Linux/ARM (32-bit): 320 KB
583.TP 0.2i
584\(bu
585Linux/i386 (32-bit): 320 KB
586.TP 0.2i
587\(bu
588Linux/x64 (64-bit): 1024 KB
589.TP 0.2i
590\(bu
591OS X (64-bit): 1024 KB
592.TP 0.2i
593\(bu
594Oracle Solaris/i386 (32-bit): 320 KB
595.TP 0.2i
596\(bu
597Oracle Solaris/x64 (64-bit): 1024 KB
598.TP 0.2i
599\(bu
600Windows: depends on virtual memory
duke6e45e102007-12-01 00:00:00 +0000601.RE
rgallardb6435452013-11-25 20:19:02 -0800602.RS
603The following examples set the thread stack size to 1024 KB in different units:
604.sp
605.nf
606\f3\-Xss1m\fP
607.fi
608.nf
609\f3\-Xss1024k\fP
610.fi
611.nf
612\f3\-Xss1048576\fP
613.fi
614.nf
615\f3\fP
616.fi
617.sp
duke6e45e102007-12-01 00:00:00 +0000618
duke6e45e102007-12-01 00:00:00 +0000619
rgallardb6435452013-11-25 20:19:02 -0800620This option is equivalent to \f3-XX:ThreadStackSize\fR\&.
621
duke6e45e102007-12-01 00:00:00 +0000622.RE
rgallardb6435452013-11-25 20:19:02 -0800623.TP
624-Xusealtsigs
625.br
626Use alternative signals instead of \f3SIGUSR1\fR and \f3SIGUSR2\fR for JVM internal signals\&. This option is equivalent to \f3-XX:+UseAltSigs\fR\&.
627.TP
628-Xverify:\fImode\fR
629.br
630Sets 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:
631.RS
632.TP
633none
634Do not verify the bytecode\&. This reduces startup time and also reduces the protection provided by Java\&.
635.TP
636remote
637Verify only those classes that are loaded remotely over the network\&. This is the default behavior if you do not specify the \f3-Xverify\fR option\&.
638.TP
639all
640Verify all classes\&.
641.RE
duke6e45e102007-12-01 00:00:00 +0000642
rgallardb6435452013-11-25 20:19:02 -0800643.SS ADVANCED\ RUNTIME\ OPTIONS
644These options control the runtime behavior of the Java HotSpot VM\&.
645.TP
646-XX:+DisableAttachMechanism
bpatel4bf512b2011-05-11 08:30:46 -0700647.br
rgallardb6435452013-11-25 20:19:02 -0800648Enables 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\&.
649.TP
650-XX:ErrorFile=\fIfilename\fR
bpatel4bf512b2011-05-11 08:30:46 -0700651.br
rgallardb6435452013-11-25 20:19:02 -0800652Specifies 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):
653.sp
654.nf
655\f3\-XX:ErrorFile=\&./hs_err_pid%p\&.log\fP
656.fi
657.nf
658\f3\fP
659.fi
660.sp
bpatel4bf512b2011-05-11 08:30:46 -0700661
bpatel4bf512b2011-05-11 08:30:46 -0700662
rgallardb6435452013-11-25 20:19:02 -0800663The following example shows how to set the error log to \f3/var/log/java/java_error\&.log\fR:
664.sp
665.nf
666\f3\-XX:ErrorFile=/var/log/java/java_error\&.log\fP
667.fi
668.nf
669\f3\fP
670.fi
671.sp
672
673
674If 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\&.
675.TP
676-XX:LargePageSizeInBytes=\fIsize\fR
bpatel4bf512b2011-05-11 08:30:46 -0700677.br
rgallardb6435452013-11-25 20:19:02 -0800678Sets 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\&.
679
680The following example illustrates how to set the large page size to 4 megabytes (MB):
681.sp
682.nf
683\f3\-XX:LargePageSizeInBytes=4m\fP
684.fi
685.nf
686\f3\fP
687.fi
688.sp
689
690.TP
691-XX:MaxDirectMemorySize=\fIsize\fR
bpatel4bf512b2011-05-11 08:30:46 -0700692.br
rgallardb6435452013-11-25 20:19:02 -0800693Sets 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\&.
694
695The following examples illustrate how to set the NIO size to 1024 KB in different units:
696.sp
697.nf
698\f3\-XX:MaxDirectMemorySize=1m\fP
699.fi
700.nf
701\f3\-XX:MaxDirectMemorySize=1024k\fP
702.fi
703.nf
704\f3\-XX:MaxDirectMemorySize=1048576\fP
705.fi
706.nf
707\f3\fP
708.fi
709.sp
710
711.TP
712-XX:NativeMemoryTracking=\fImode\fR
bpatel4bf512b2011-05-11 08:30:46 -0700713.br
rgallardb6435452013-11-25 20:19:02 -0800714Specifies the mode for tracking JVM native memory usage\&. Possible \fImode\fR arguments for this option include the following:
715.RS
716.TP
717off
718Do not track JVM native memory usage\&. This is the default behavior if you do not specify the \f3-XX:NativeMemoryTracking\fR option\&.
719.TP
720summary
721Only track memory usage by JVM subsystems, such as Java heap, class, code, and thread\&.
722.TP
723detail
724In addition to tracking memory usage by JVM subsystems, track memory usage by individual \f3CallSite\fR, individual virtual memory region and its committed regions\&.
725.RE
726
727.TP
728-XX:OnError=\fIstring\fR
bpatel4bf512b2011-05-11 08:30:46 -0700729.br
rgallardb6435452013-11-25 20:19:02 -0800730Sets 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\&.
731
732\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):
733.sp
734.nf
735\f3\-XX:OnError="gcore %p;dbx \- %p"\fP
736.fi
737.nf
738\f3\fP
739.fi
740.sp
741
742.TP
743-XX:OnOutOfMemoryError=\fIstring\fR
bpatel4bf512b2011-05-11 08:30:46 -0700744.br
rgallardb6435452013-11-25 20:19:02 -0800745Sets 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\&.
746.TP
747-XX:+PrintCommandLineFlags
bpatel4bf512b2011-05-11 08:30:46 -0700748.br
rgallardb6435452013-11-25 20:19:02 -0800749Enables 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\&.
750.TP
751-XX:+PrintNMTStatistics
bpatel4bf512b2011-05-11 08:30:46 -0700752.br
rgallardb6435452013-11-25 20:19:02 -0800753Enables 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\&.
754.TP
755-XX:+ShowMessageBoxOnError
bpatel4bf512b2011-05-11 08:30:46 -0700756.br
rgallardb6435452013-11-25 20:19:02 -0800757Enables 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\&.
758.TP
759-XX:ThreadStackSize=\fIsize\fR
bpatel4bf512b2011-05-11 08:30:46 -0700760.br
rgallardb6435452013-11-25 20:19:02 -0800761Sets 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:
762.RS
763.TP 0.2i
764\(bu
765Linux/ARM (32-bit): 320 KB
766.TP 0.2i
767\(bu
768Linux/i386 (32-bit): 320 KB
769.TP 0.2i
770\(bu
771Linux/x64 (64-bit): 1024 KB
772.TP 0.2i
773\(bu
774OS X (64-bit): 1024 KB
775.TP 0.2i
776\(bu
777Oracle Solaris/i386 (32-bit): 320 KB
778.TP 0.2i
779\(bu
780Oracle Solaris/x64 (64-bit): 1024 KB
781.TP 0.2i
782\(bu
783Windows: depends on virtual memory
duke6e45e102007-12-01 00:00:00 +0000784.RE
rgallardb6435452013-11-25 20:19:02 -0800785.RS
786The following examples show how to set the thread stack size to 1024 KB in different units:
787.sp
788.nf
789\f3\-XX:ThreadStackSize=1m\fP
790.fi
791.nf
792\f3\-XX:ThreadStackSize=1024k\fP
793.fi
794.nf
795\f3\-XX:ThreadStackSize=1048576\fP
796.fi
797.nf
798\f3\fP
799.fi
800.sp
duke6e45e102007-12-01 00:00:00 +0000801
rgallardb6435452013-11-25 20:19:02 -0800802
803This option is equivalent to \f3-Xss\fR\&.
804
805.RE
806.TP
807-XX:+TraceClassLoading
808.br
809Enables tracing of classes as they are loaded\&. By default, this option is disabled and classes are not traced\&.
810.TP
811-XX:+TraceClassLoadingPreorder
812.br
813Enables tracing of all loaded classes in the order in which they are referenced\&. By default, this option is disabled and classes are not traced\&.
814.TP
815-XX:+TraceClassResolution
816.br
817Enables tracing of constant pool resolutions\&. By default, this option is disabled and constant pool resolutions are not traced\&.
818.TP
819-XX:+TraceClassUnloading
820.br
821Enables tracing of classes as they are unloaded\&. By default, this option is disabled and classes are not traced\&.
822.TP
823-XX:+TraceLoaderConstraints
824.br
825Enables tracing of the loader constraints recording\&. By default, this option is disabled and loader constraints recoding is not traced\&.
826.TP
827-XX:+UseAltSigs
828.br
829Enables 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\&.
830.TP
831-XX:+UseBiasedLocking
832.br
833Enables 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
834
835By default, this option is disabled and biased locking is not used\&.
836.TP
837-XX:+UseCompressedOops
838.br
839Enables the use of compressed pointers\&. 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\&.
840
841By default, this option is disabled and compressed pointers are not used\&.
842.TP
843-XX:+UseLargePages
844.br
845Enables the use of large page memory\&. This option is enabled by default\&. To disable the use of large page memory, specify \f3-XX:-UseLargePages\fR\&.
846
847For more information, see Java Support for Large Memory Pages at http://www\&.oracle\&.com/technetwork/java/javase/tech/largememory-jsp-137182\&.html
848.TP
849-XX:+UseMembar
850.br
851Enables issuing of membars on thread state transitions\&. This option is disabled by default on all platforms except Power PC and ARM servers, where it is enabled\&. To disable issuing of membars on thread state transitions for Power PC and ARM, specify \f3-XX:-UseMembar\fR\&.
852.TP
853-XX:+UsePerfData
854.br
855Enables 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\&.
856.TP
857-XX:+AllowUserSignalHandlers
858.br
859Enables installation of signal handlers by the application\&. By default, this option is disabled and the application is not allowed to install signal handlers\&.
860.SS ADVANCED\ JIT\ COMPILER\ OPTIONS
861These options control the dynamic just-in-time (JIT) compilation performed by the Java HotSpot VM\&.
862.TP
863-XX:+AggressiveOpts
864.br
865Enables 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\&.
866.TP
867-XX:AllocateInstancePrefetchLines=\fIlines\fR
868.br
869Sets the number of lines to prefetch ahead of the instance allocation pointer\&. By default, the number of lines to prefetch is set to 1:
870.sp
871.nf
872\f3\-XX:AllocateInstancePrefetchLines=1\fP
873.fi
874.nf
875\f3\fP
876.fi
877.sp
878
879.TP
880-XX:AllocatePrefetchInstr=\fIinstruction\fR
881.br
882Sets the prefetch instruction to prefetch ahead of the allocation pointer\&. 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:
883.sp
884.nf
885\f3\-XX:AllocatePrefetchInstr=0\fP
886.fi
887.nf
888\f3\fP
889.fi
890.sp
891
892.TP
893-XX:AllocatePrefetchStepSize=\fIsize\fR
894.br
895Sets 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:
896.sp
897.nf
898\f3\-XX:AllocatePrefetchStepSize=16\fP
899.fi
900.nf
901\f3\fP
902.fi
903.sp
904
905.TP
906-XX:+BackgroundCompilation
907.br
908Enables 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)\&.
909.TP
910-XX:CICompilerCount=\fIthreads\fR
911.br
912Sets 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:
913.sp
914.nf
915\f3\-XX:CICompilerCount=2\fP
916.fi
917.nf
918\f3\fP
919.fi
920.sp
921
922.TP
923-XX:CodeCacheMinimumFreeSpace=\fIsize\fR
924.br
925Sets 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:
926.sp
927.nf
928\f3\-XX:CodeCacheMinimumFreeSpace=1024m\fP
929.fi
930.nf
931\f3\fP
932.fi
933.sp
934
935.TP
rgallard3369a1b2013-12-13 14:21:33 -0800936-XX:CompileCommand=\fIcommand\fR,\fImethod\fR[,\fIoption\fR]
rgallardb6435452013-11-25 20:19:02 -0800937.br
rgallard3369a1b2013-12-13 14:21:33 -0800938Specifies 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:
rgallardb6435452013-11-25 20:19:02 -0800939.sp
940.nf
941\f3\-XX:CompileCommand=exclude,java/lang/String\&.indexOf\fP
942.fi
943.nf
944\f3\fP
945.fi
946.sp
duke6e45e102007-12-01 00:00:00 +0000947
duke6e45e102007-12-01 00:00:00 +0000948
rgallard3369a1b2013-12-13 14:21:33 -0800949Note 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:
950.sp
951.nf
952\f3\-XX:CompileCommand=exclude,java\&.lang\&.String::indexOf\fP
953.fi
954.nf
955\f3\fP
956.fi
957.sp
duke6e45e102007-12-01 00:00:00 +0000958
rgallard3369a1b2013-12-13 14:21:33 -0800959
960If 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:
961.sp
962.nf
963\f3\-XX:CompileCommand="exclude,java/lang/String\&.indexOf,(Ljava/lang/String;)I"\fP
964.fi
965.nf
966\f3\fP
967.fi
968.sp
969
970
971You 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:
972.sp
973.nf
974\f3\-XX:CompileCommand=exclude,*\&.indexOf\fP
975.fi
976.nf
977\f3\fP
978.fi
979.sp
980
981
982The 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:
rgallardb6435452013-11-25 20:19:02 -0800983.sp
984.nf
985\f3\-XX:CompileCommand="exclude java/lang/String indexOf"\fP
986.fi
987.nf
988\f3\fP
989.fi
990.sp
991
992
rgallard3369a1b2013-12-13 14:21:33 -0800993Note 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\&.
rgallardb6435452013-11-25 20:19:02 -0800994
rgallard3369a1b2013-12-13 14:21:33 -0800995To 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:
rgallardb6435452013-11-25 20:19:02 -0800996.RS
997.TP
998break
999Set a breakpoint when debugging the JVM to stop at the beginning of compilation of the specified method\&.
1000.TP
1001compileonly
rgallard3369a1b2013-12-13 14:21:33 -08001002Exclude 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\&.
rgallardb6435452013-11-25 20:19:02 -08001003.TP
1004dontinline
1005Prevent inlining of the specified method\&.
1006.TP
1007exclude
1008Exclude the specified method from compilation\&.
1009.TP
1010help
1011Print a help message for the \f3-XX:CompileCommand\fR option\&.
1012.TP
1013inline
1014Attempt to inline the specified method\&.
1015.TP
1016log
1017Exclude 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\&.
1018.TP
rgallard3369a1b2013-12-13 14:21:33 -08001019option
1020This 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:
1021.sp
1022.nf
1023\f3\-XX:CompileCommand=option,java/lang/StringBuffer\&.append,BlockLayoutByFrequency\fP
1024.fi
1025.nf
1026\f3\fP
1027.fi
1028.sp
1029
1030
1031You can specify multiple compilation options, separated by commas or spaces\&.
1032.TP
rgallardb6435452013-11-25 20:19:02 -08001033print
1034Print generated assembler code after compilation of the specified method\&.
1035.TP
1036quiet
1037Do 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:
1038.sp
1039.nf
1040\f3CompilerOracle: exclude java/lang/String\&.indexOf\fP
1041.fi
1042.nf
1043\f3\fP
1044.fi
1045.sp
1046
1047
1048You can suppress this by specifying the \f3-XX:CompileCommand=quiet\fR option before other \f3-XX:CompileCommand\fR options\&.
1049.RE
1050
rgallardb6435452013-11-25 20:19:02 -08001051.TP
1052-XX:CompileCommandFile=\fIfilename\fR
1053.br
rgallard3369a1b2013-12-13 14:21:33 -08001054Sets 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\&.
rgallardb6435452013-11-25 20:19:02 -08001055
rgallard3369a1b2013-12-13 14:21:33 -08001056Each 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:
rgallardb6435452013-11-25 20:19:02 -08001057.sp
1058.nf
1059\f3print java/lang/String toString\fP
1060.fi
1061.nf
1062\f3\fP
1063.fi
1064.sp
1065
1066
rgallard3369a1b2013-12-13 14:21:33 -08001067For more information about specifying the commands for the JIT compiler to perform on methods, see the \f3-XX:CompileCommand\fR option\&.
rgallardb6435452013-11-25 20:19:02 -08001068.TP
1069-XX:CompileOnly=\fImethods\fR
1070.br
1071Sets 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:
1072.sp
1073.nf
1074\f3\-XX:CompileOnly=java/lang/String\&.length,java/util/List\&.size\fP
1075.fi
1076.nf
1077\f3\fP
1078.fi
1079.sp
1080
rgallard3369a1b2013-12-13 14:21:33 -08001081
1082Note 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:
1083.sp
1084.nf
1085\f3\-XX:CompileOnly=java\&.lang\&.String::length,java\&.util\&.List::size\fP
1086.fi
1087.nf
1088\f3\fP
1089.fi
1090.sp
1091
1092
1093Although 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:
1094.sp
1095.nf
1096\f3\-XX:CompileOnly=java/lang/String\fP
1097.fi
1098.nf
1099\f3\-XX:CompileOnly=java/lang\fP
1100.fi
1101.nf
1102\f3\-XX:CompileOnly=\&.length\fP
1103.fi
1104.nf
1105\f3\fP
1106.fi
1107.sp
1108
rgallardb6435452013-11-25 20:19:02 -08001109.TP
1110-XX:CompileThreshold=\fIinvocations\fR
1111.br
1112Sets 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\&. The following example shows how to set the number of interpreted method invocations to 5,000:
1113.sp
1114.nf
1115\f3\-XX:CompileThreshold=5000\fP
1116.fi
1117.nf
1118\f3\fP
1119.fi
1120.sp
1121
1122
1123You can completely disable interpretation of Java methods before compilation by specifying the \f3-Xcomp\fR option\&.
1124.TP
1125-XX:+DoEscapeAnalysis
1126.br
1127Enables the use of escape analysis\&. This option is enabled by default\&. To disable the use of escape analysis, specify \f3-XX:-DoEscapeAnalysis\fR\&.
1128.TP
1129-XX:+FailOverToOldVerifier
1130.br
1131Enables 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\&.
1132.TP
1133-XX:InitialCodeCacheSize=\fIsize\fR
1134.br
1135Sets 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 following example shows how to set the initial code cache size to 32 KB:
1136.sp
1137.nf
1138\f3\-XX:InitialCodeCacheSize=32k\fP
1139.fi
1140.nf
1141\f3\fP
1142.fi
1143.sp
1144
1145.TP
1146-XX:+Inline
1147.br
1148Enables method inlining\&. This option is enabled by default to increase performance\&. To disable method inlining, specify \f3-XX:-Inline\fR\&.
1149.TP
1150-XX:InlineSmallCode=\fIsize\fR
1151.br
1152Sets 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:
1153.sp
1154.nf
1155\f3\-XX:InlineSmallCode=1000\fP
1156.fi
1157.nf
1158\f3\fP
1159.fi
1160.sp
1161
1162.TP
1163-XX:+LogCompilation
1164.br
1165Enables 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\&.
1166
1167By 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\&.
1168
1169You 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\&.
1170.TP
1171-XX:MaxInlineSize=\fIsize\fR
1172.br
1173Sets 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:
1174.sp
1175.nf
1176\f3\-XX:MaxInlineSize=35\fP
1177.fi
1178.nf
1179\f3\fP
1180.fi
1181.sp
1182
1183.TP
1184-XX:MaxNodeLimit=\fInodes\fR
1185.br
1186Sets the maximum number of nodes to be used during single method compilation\&. By default, the maximum number of nodes is set to 65,000:
1187.sp
1188.nf
1189\f3\-XX:MaxNodeLimit=65000\fP
1190.fi
1191.nf
1192\f3\fP
1193.fi
1194.sp
1195
1196.TP
1197-XX:MaxTrivialSize=\fIsize\fR
1198.br
1199Sets 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:
1200.sp
1201.nf
1202\f3\-XX:MaxTrivialSize=6\fP
1203.fi
1204.nf
1205\f3\fP
1206.fi
1207.sp
1208
1209.TP
1210-XX:+OptimizeStringConcat
1211.br
1212Enables 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\&.
1213.TP
1214-XX:+PrintAssembly
1215.br
1216Enables 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\&.
1217
1218By 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\&.
1219.TP
1220-XX:+PrintCompilation
1221.br
1222Enables 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\&.
1223
1224You can also log compilation activity to a file by using the \f3-XX:+LogCompilation\fR option\&.
1225.TP
1226-XX:+PrintInlining
1227.br
1228Enables printing of inlining decisions\&. This enables you to see which methods are getting inlined\&.
1229
1230By 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\&.
1231.TP
1232-XX:+RelaxAccessControlCheck
1233.br
1234Decreases 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\&.
1235.TP
1236-XX:ReservedCodeCacheSize=\fIsize\fR
1237.br
1238Sets 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 is equivalent to \f3-Xmaxjitcodesize\fR\&.
1239.TP
1240-XX:+TieredCompilation
1241.br
1242Enables the use of tiered compilation\&. By default, this option is disabled and tiered compilation is not used\&.
1243.TP
1244-XX:+UseCodeCacheFlushing
1245.br
1246Enables 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\&.
1247.TP
1248-XX:+UseCondCardMark
1249.br
1250Enables 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\&.
1251.TP
1252-XX:+UseSuperWord
1253.br
1254Enables 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\&.
1255.SS ADVANCED\ SERVICEABILITY\ OPTIONS
1256These options provide the ability to gather system information and perform extensive debugging\&.
1257.TP
1258-XX:+ExtendedDTraceProbes
1259.br
1260Enables additional \f3dtrace\fR tool probes that impact the performance\&. By default, this option is disabled and \f3dtrace\fR performs only standard probes\&.
1261.TP
1262-XX:+HeapDumpOnOutOfMemory
1263.br
1264Enables 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\&.
1265.TP
1266-XX:HeapDumpPath=\fIpath\fR
1267.br
1268Sets 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):
1269.sp
1270.nf
1271\f3\-XX:HeapDumpPath=\&./java_pid%p\&.hprof\fP
1272.fi
1273.nf
1274\f3\fP
1275.fi
1276.sp
1277
1278
1279\fI\fRThe following example shows how to set the heap dump file to \f3/var/log/java/java_heapdump\&.hprof\fR:
1280.sp
1281.nf
1282\f3\-XX:HeapDumpPath=/var/log/java/java_heapdump\&.hprof\fP
1283.fi
1284.nf
1285\f3\fP
1286.fi
1287.sp
1288
1289.TP
1290-XX:LogFile=\fIpath\fR
1291.br
1292Sets 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\&.
1293
1294\fI\fRThe following example shows how to set the log file to \f3/var/log/java/hotspot\&.log\fR:
1295.sp
1296.nf
1297\f3\-XX:LogFile=/var/log/java/hotspot\&.log\fP
1298.fi
1299.nf
1300\f3\fP
1301.fi
1302.sp
1303
1304.TP
1305-XX:+PrintClassHistogram
1306.br
1307\fI\fREnables printing of a class instance histogram after a \f3Control+C\fR event (\f3SIGTERM\fR)\&. By default, this option is disabled\&.
1308
1309Setting 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\&.
1310.TP
1311-XX:+PrintConcurrentLocks
1312
1313
1314Enables printing of j\f3ava\&.util\&.concurrent\fR locks after a \f3Control+C\fR event (\f3SIGTERM\fR)\&. By default, this option is disabled\&.
1315
1316Setting 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\&.
1317.TP
1318-XX:+UnlockDiagnosticVMOptions
1319.br
1320Unlocks the options intended for diagnosing the JVM\&. By default, this option is disabled and diagnostic options are not available\&.
1321.SS ADVANCED\ GARBAGE\ COLLECTION\ OPTIONS
1322These options control how garbage collection (GC) is performed by the Java HotSpot VM\&.
1323.TP
1324-XX:+AggressiveHeap
1325.br
1326Enables 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\&.
1327.TP
1328-XX:AllocatePrefetchDistance=\fIsize\fR
1329.br
1330Sets 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\&.
1331
1332Negative 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\&.
1333
1334The following example shows how to set the prefetch distance to 1024 bytes:
1335.sp
1336.nf
1337\f3\-XX:AllocatePrefetchDistance=1024\fP
1338.fi
1339.nf
1340\f3\fP
1341.fi
1342.sp
1343
1344.TP
1345-XX:AllocatePrefetchLines=\fIlines\fR
1346.br
1347Sets 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\&.
1348
1349The following example shows how to set the number of loaded cache lines to 5:
1350.sp
1351.nf
1352\f3\-XX:AllocatePrefetchLines=5\fP
1353.fi
1354.nf
1355\f3\fP
1356.fi
1357.sp
1358
1359.TP
1360-XX:AllocatePrefetchStyle=\fIstyle\fR
1361.br
1362Sets the generated code style for prefetch instructions\&. The \fIstyle\fR argument is an integer from 0 to 3:
1363.RS
1364.TP
13650
1366Do not generate prefetch instructions\&.
1367.TP
13681
1369Execute prefetch instructions after each allocation\&. This is the default parameter\&.
1370.TP
13712
1372Use the thread-local allocation block (TLAB) watermark pointer to determine when prefetch instructions are executed\&.
1373.TP
13743
1375Use BIS instruction on SPARC for allocation prefetch\&.
1376.RE
1377
1378.TP
1379-XX:+AlwaysPreTouch
1380.br
1381Enables 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\&.
1382.TP
1383-XX:+CMSClassUnloadingEnabled
1384.br
1385Enables 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\&.
1386.TP
1387-XX:CMSExpAvgFactor=\fIpercent\fR
1388.br
1389Sets 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%:
1390.sp
1391.nf
1392\f3\-XX:CMSExpAvgFactor=15\fP
1393.fi
1394.nf
1395\f3\fP
1396.fi
1397.sp
1398
1399.TP
rgallardb6435452013-11-25 20:19:02 -08001400-XX:CMSInitiatingOccupancyFraction=\fIpercent\fR
1401.br
1402Sets 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\&.
1403
1404The following example shows how to set the occupancy fraction to 20%:
1405.sp
1406.nf
1407\f3\-XX:CMSInitiatingOccupancyFraction=20\fP
1408.fi
1409.nf
1410\f3\fP
1411.fi
1412.sp
1413
1414.TP
1415-XX:+CMSScavengeBeforeRemark
1416.br
1417Enables scavenging attempts before the CMS remark step\&. By default, this option is disabled\&.
1418.TP
1419-XX:CMSTriggerRatio=\fIpercent\fR
1420.br
1421Sets 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%\&.
1422
1423The following example shows how to set the occupancy fraction to 75%:
1424.sp
1425.nf
1426\f3\-XX:CMSTriggerRatio=75\fP
1427.fi
1428.nf
1429\f3\fP
1430.fi
1431.sp
1432
1433.TP
1434-XX:ConcGCThreads=\fIthreads\fR
1435.br
1436Sets the number of threads used for concurrent GC\&. The default value depends on the number of CPUs available to the JVM\&.
1437
1438For example, to set the number of threads for concurrent GC to 2, specify the following option:
1439.sp
1440.nf
1441\f3\-XX:ConcGCThreads=2\fP
1442.fi
1443.nf
1444\f3\fP
1445.fi
1446.sp
1447
1448.TP
1449-XX:+DisableExplicitGC
1450.br
1451Enables 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\&.
1452.TP
1453-XX:+ExplicitGCInvokesConcurrent
1454.br
1455Enables 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\&.
1456.TP
1457-XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses
1458.br
1459Enables 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\&.
1460.TP
1461-XX:G1HeapRegionSize=\fIsize\fR
1462.br
1463Sets 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\&.
1464
1465The following example shows how to set the size of the subdivisions to 16 MB:
1466.sp
1467.nf
1468\f3\-XX:G1HeapRegionSize=16m\fP
1469.fi
1470.nf
1471\f3\fP
1472.fi
1473.sp
1474
1475.TP
1476-XX:+G1PrintHeapRegions
1477.br
1478Enables the printing of information about which regions are allocated and which are reclaimed by the G1 collector\&. By default, this option is disabled\&.
1479.TP
1480-XX:G1ReservePercent=\fIpercent\fR
1481.br
1482Sets 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%\&.
1483
1484The following example shows how to set the reserved heap to 20%:
1485.sp
1486.nf
1487\f3\-XX:G1ReservePercent=20\fP
1488.fi
1489.nf
1490\f3\fP
1491.fi
1492.sp
1493
1494.TP
1495-XX:InitialHeapSize=\fIsize\fR
1496.br
1497Sets 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\&. For more information, see Garbage Collector Ergonomics at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gc-ergonomics\&.html
1498
1499The following examples show how to set the size of allocated memory to 6 MB using various units:
1500.sp
1501.nf
1502\f3\-XX:InitialHeapSize=6291456\fP
1503.fi
1504.nf
1505\f3\-XX:InitialHeapSize=6144k\fP
1506.fi
1507.nf
1508\f3\-XX:InitialHeapSize=6m\fP
1509.fi
1510.nf
1511\f3\fP
1512.fi
1513.sp
1514
1515
1516If 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\&.
1517.TP
1518-XX:InitialSurvivorRatio=\fIratio\fR
1519.br
1520Sets 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\&.
1521
1522The 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):
1523.sp
1524.nf
1525\f3S=Y/(R+2)\fP
1526.fi
1527.nf
1528\f3\fP
1529.fi
1530.sp
1531
1532
1533The 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\&.
1534
1535By 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\&.
1536
1537The following example shows how to set the initial survivor space ratio to 4:
1538.sp
1539.nf
1540\f3\-XX:InitialSurvivorRatio=4\fP
1541.fi
1542.nf
1543\f3\fP
1544.fi
1545.sp
1546
1547.TP
1548-XX:InitiatingHeapOccupancyPercent=\fIpercent\fR
1549.br
1550Sets 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)\&.
1551
1552By 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%:
1553.sp
1554.nf
1555\f3\-XX:InitiatingHeapOccupancyPercent=75\fP
1556.fi
1557.nf
1558\f3\fP
1559.fi
1560.sp
1561
1562.TP
1563-XX:MaxGCPauseMillis=\fItime\fR
1564.br
1565Sets 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\&.
1566
1567The following example shows how to set the maximum target pause time to 500 ms:
1568.sp
1569.nf
1570\f3\-XX:MaxGCPauseMillis=500\fP
1571.fi
1572.nf
1573\f3\fP
1574.fi
1575.sp
1576
1577.TP
1578-XX:MaxHeapSize=\fIsize\fR
1579.br
1580Sets 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\&. For more information, see Garbage Collector Ergonomics at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gc-ergonomics\&.html
1581
1582The following examples show how to set the maximum allowed size of allocated memory to 80 MB using various units:
1583.sp
1584.nf
1585\f3\-XX:MaxHeapSize=83886080\fP
1586.fi
1587.nf
1588\f3\-XX:MaxHeapSize=81920k\fP
1589.fi
1590.nf
1591\f3\-XX:MaxHeapSize=80m\fP
1592.fi
1593.nf
1594\f3\fP
1595.fi
1596.sp
1597
1598
1599On 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\&.
1600
1601The \f3-XX:MaxHeapSize\fR option is equivalent to \f3-Xmx\fR\&.
1602.TP
1603-XX:MaxHeapFreeRatio=\fIpercent\fR
1604.br
1605Sets 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%\&.
1606
1607The following example shows how to set the maximum free heap ratio to 75%:
1608.sp
1609.nf
1610\f3\-XX:MaxHeapFreeRatio=75\fP
1611.fi
1612.nf
1613\f3\fP
1614.fi
1615.sp
1616
1617.TP
1618-XX:MaxMetaspaceSize=\fIsize\fR
1619.br
1620Sets 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\&.
1621
1622The following example shows how to set the maximum class metadata size to 256 MB:
1623.sp
1624.nf
1625\f3\-XX:MaxMetaspaceSize=256m\fP
1626.fi
1627.nf
1628\f3\fP
1629.fi
1630.sp
1631
1632.TP
1633-XX:MaxNewSize=\fIsize\fR
1634.br
1635Sets the maximum size (in bytes) of the heap for the young generation (nursery)\&. The default value is set ergonomically\&.
1636.TP
1637-XX:MaxTenuringThreshold=\fIthreshold\fR
1638.br
1639Sets 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\&.
1640
1641The following example shows how to set the maximum tenuring threshold to 10:
1642.sp
1643.nf
1644\f3\-XX:MaxTenuringThreshold=10\fP
1645.fi
1646.nf
1647\f3\fP
1648.fi
1649.sp
1650
1651.TP
1652-XX:MetaspaceSize=\fIsize\fR
1653.br
1654Sets 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\&.
1655.TP
1656-XX:MinHeapFreeRatio=\fIpercent\fR
1657.br
1658Sets 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%\&.
1659
1660The following example shows how to set the minimum free heap ratio to 25%:
1661.sp
1662.nf
1663\f3\-XX:MinHeapFreeRatio=25\fP
1664.fi
1665.nf
1666\f3\fP
1667.fi
1668.sp
1669
1670.TP
1671-XX:NewRatio=\fIratio\fR
1672.br
1673Sets 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:
1674.sp
1675.nf
1676\f3\-XX:NewRatio=1\fP
1677.fi
1678.nf
1679\f3\fP
1680.fi
1681.sp
1682
1683.TP
1684-XX:NewSize=\fIsize\fR
1685.br
1686Sets 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\&.
1687
1688The 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\&.
1689
1690The following examples show how to set the initial size of young generation to 256 MB using various units:
1691.sp
1692.nf
1693\f3\-XX:NewSize=256m\fP
1694.fi
1695.nf
1696\f3\-XX:NewSize=262144k\fP
1697.fi
1698.nf
1699\f3\-XX:NewSize=268435456\fP
1700.fi
1701.nf
1702\f3\fP
1703.fi
1704.sp
1705
1706
1707The \f3-XX:NewSize\fR option is equivalent to \f3-Xmn\fR\&.
1708.TP
1709-XX:ParallelGCThreads=\fIthreads\fR
1710.br
1711Sets 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\&.
1712
1713For example, to set the number of threads for parallel GC to 2, specify the following option:
1714.sp
1715.nf
1716\f3\-XX:ParallelGCThreads=2\fP
1717.fi
1718.nf
1719\f3\fP
1720.fi
1721.sp
1722
1723.TP
1724-XX:+ParallelRefProcEnabled
1725.br
1726Enables parallel reference processing\&. By default, this option is disabled\&.
1727.TP
1728-XX:+PrintAdaptiveSizePolicy
1729.br
1730Enables printing of information about adaptive generation sizing\&. By default, this option is disabled\&.
1731.TP
1732-XX:+PrintGC
1733.br
1734Enables printing of messages at every GC\&. By default, this option is disabled\&.
1735.TP
1736-XX:+PrintGCApplicationConcurrentTime
1737.br
1738Enables printing of how much time elapsed since the last pause (for example, a GC pause)\&. By default, this option is disabled\&.
1739.TP
1740-XX:+PrintGCApplicationStoppedTime
1741.br
1742Enables printing of how much time the pause (for example, a GC pause) lasted\&. By default, this option is disabled\&.
1743.TP
1744-XX+PrintGCDateStamp
1745.br
1746Enables printing of a date stamp at every GC\&. By default, this option is disabled\&.
1747.TP
1748-XX:+PrintGCDetails
1749.br
1750Enables printing of detailed messages at every GC\&. By default, this option is disabled\&.
1751.TP
1752-XX:+PrintGCTaskTimeStamps
1753.br
1754Enables printing of time stamps for every individual GC worker thread task\&. By default, this option is disabled\&.
1755.TP
1756-XX:+PrintGCTimeStamp
1757.br
1758Enables printing of time stamps at every GC\&. By default, this option is disabled\&.
1759.TP
1760-XX:+PrintTenuringDistribution
1761.br
1762Enables printing of tenuring age information\&. The following is an example of the output:
1763.sp
1764.nf
1765\f3Desired survivor size 48286924 bytes, new threshold 10 (max 10)\fP
1766.fi
1767.nf
1768\f3\- age 1: 28992024 bytes, 28992024 total\fP
1769.fi
1770.nf
1771\f3\- age 2: 1366864 bytes, 30358888 total\fP
1772.fi
1773.nf
1774\f3\- age 3: 1425912 bytes, 31784800 total\fP
1775.fi
1776.nf
1777\f3\&.\&.\&.\fP
1778.fi
1779.nf
1780\f3\fP
1781.fi
1782.sp
1783
1784
1785Age 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\&.
1786
1787In 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\&.
1788
1789By default, this option is disabled\&.
1790.TP
1791-XX:+ScavengeBeforeFullGC
1792.br
1793Enables 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\&.
1794.TP
1795-XX:SoftRefLRUPolicyMSPerMB=\fItime\fR
1796.br
1797Sets 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\&.
1798
1799The following example shows how to set the value to 2\&.5 seconds:
1800.sp
1801.nf
1802\f3\-XX:SoftRefLRUPolicyMSPerMB=2500\fP
1803.fi
1804.nf
1805\f3\fP
1806.fi
1807.sp
1808
1809.TP
1810-XX:SurvivorRatio=\fIratio\fR
1811.br
1812Sets 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:
1813.sp
1814.nf
1815\f3\-XX:SurvivorRatio=4\fP
1816.fi
1817.nf
1818\f3\fP
1819.fi
1820.sp
1821
1822.TP
1823-XX:TargetSurvivorRatio=\fIpercent\fR
1824.br
1825Sets the desired percentage of survivor space (0 to 100) used after young garbage collection\&. By default, this option is set to 50%\&.
1826
1827The following example shows how to set the target survivor space ratio to 30%:
1828.sp
1829.nf
1830\f3\-XX:TargetSurvivorRatio=30\fP
1831.fi
1832.nf
1833\f3\fP
1834.fi
1835.sp
1836
1837.TP
1838-XX:TLABSize=\fIsize\fR
1839.br
1840Sets 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\&.
1841
1842The following example shows how to set the initial TLAB size to 512 KB:
1843.sp
1844.nf
1845\f3\-XX:TLABSize=512k\fP
1846.fi
1847.nf
1848\f3\fP
1849.fi
1850.sp
1851
1852.TP
1853-XX:+UseAdaptiveSizePolicy
1854.br
1855Enables 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)\&.
1856.TP
1857-XX:+UseCMSInitiatingOccupancyOnly
1858.br
1859Enables 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\&.
1860.TP
1861-XX:+UseConcMarkSweepGC
1862.br
1863Enables 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\&.
1864
rgallard1cc205c2014-01-09 16:10:24 -08001865By 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\&.
rgallardb6435452013-11-25 20:19:02 -08001866.TP
1867-XX:+UseG1GC
1868.br
1869Enables the use of the 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)\&.
1870
1871By default, this option is disabled and the collector is chosen automatically based on the configuration of the machine and type of the JVM\&.
1872.TP
1873-XX:+UseGCOverheadLimit
1874.br
1875Enables 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\&.
1876.TP
1877-XX:+UseNUMA
1878.br
1879Enables 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)\&.
1880.TP
1881-XX:+UseParallelGC
1882.br
1883Enables 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\&.
1884
1885By 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\&.
1886.TP
1887-XX:+UseParallelOldGC
1888.br
1889Enables 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\&.
1890.TP
1891-XX:+UseParNewGC
1892.br
rgallard1cc205c2014-01-09 16:10:24 -08001893Enables 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\&.
rgallardb6435452013-11-25 20:19:02 -08001894.TP
1895-XX:+UseSerialGC
1896.br
1897Enables 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\&.
1898.TP
1899-XX:+UseTLAB
1900.br
1901Enables 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\&.
1902.SS DEPRECATED\ AND\ REMOVED\ OPTIONS
1903These options were included in the previous release, but have since been considered unnecessary\&.
1904.TP
rgallard1cc205c2014-01-09 16:10:24 -08001905-Xincgc
1906.br
1907Enables incremental garbage collection\&. This option was deprecated in JDK 8 with no replacement\&.
1908.TP
rgallardb6435452013-11-25 20:19:02 -08001909-Xrun\fIlibname\fR
1910.br
1911Loads the specified debugging/profiling library\&. This option was superseded by the \f3-agentlib\fR option\&.
1912.TP
rgallard1cc205c2014-01-09 16:10:24 -08001913-XX:CMSIncrementalDutyCycle=\fIpercent\fR
1914.br
1915Sets 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\&.
1916.TP
1917-XX:CMSIncrementalDutyCycleMin=\fIpercent\fR
1918.br
1919Sets 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\&.
1920.TP
1921-XX:+CMSIncrementalMode
1922.br
1923Enables 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\&.
1924.TP
1925-XX:CMSIncrementalOffset=\fIpercent\fR
1926.br
1927Sets 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\&.
1928.TP
1929-XX:+CMSIncrementalPacing
1930.br
1931Enables 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\&.
1932.TP
1933-XX:CMSIncrementalSafetyFactor=\fIpercent\fR
1934.br
1935Sets 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\&.
1936.TP
rgallardb6435452013-11-25 20:19:02 -08001937-XX:CMSInitiatingPermOccupancyFraction=\fIpercent\fR
1938.br
1939Sets 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\&.
1940.TP
1941-XX:MaxPermSize=\fIsize\fR
1942.br
1943Sets the maximum permanent generation space size (in bytes)\&. This option was deprecated in JDK 8, and superseded by the \f3-XX:MaxMetaspaceSize\fR option\&.
1944.TP
1945-XX:PermSize=\fIsize\fR
1946.br
1947Sets 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\&.
1948.TP
1949-XX:+UseSplitVerifier
1950.br
1951Enables 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\&.
1952.TP
1953-XX:+UseStringCache
1954.br
1955Enables caching of commonly allocated strings\&. This option was removed from JDK 8 with no replacement\&.
1956.SH PERFORMANCE\ TUNING\ EXAMPLES
1957The following examples show how to use experimental tuning flags to either optimize throughput or to provide lower response time\&.
1958.PP
1959\f3Example 1 Tuning for Higher Throughput\fR
1960.sp
1961.nf
1962\f3java \-d64 \-server \-XX:+AggressiveOpts \-XX:+UseLargePages \-Xmn10g \-Xms26g \-Xmx26g\fP
1963.fi
1964.nf
1965\f3\fP
1966.fi
1967.sp
1968\f3Example 2 Tuning for Lower Response Time\fR
1969.sp
1970.nf
1971\f3java \-d64 \-XX:+UseG1GC \-Xms26g Xmx26g \-XX:MaxGCPauseMillis=500 \-XX:+PrintGCTimeStamp\fP
1972.fi
1973.nf
1974\f3\fP
1975.fi
1976.sp
1977.SH EXIT\ STATUS
1978The 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:
1979.TP 0.2i
1980\(bu
1981\f30\fR: Successful completion
1982.TP 0.2i
1983\(bu
1984\f3>0\fR: An error occurred
1985.SH SEE\ ALSO
1986.TP 0.2i
1987\(bu
1988javac(1)
1989.TP 0.2i
1990\(bu
1991jdb(1)
1992.TP 0.2i
1993\(bu
1994javah(1)
1995.TP 0.2i
1996\(bu
1997jar(1)
1998.RE
1999.br
2000'pl 8.5i
2001'bp