blob: 4615bad506ad70c47d347b9c828b0dc23803c6b9 [file] [log] [blame]
rgallardb6435452013-11-25 20:19:02 -08001'\" t
mfangf2cf0062015-07-15 12:12:46 -07002.\" Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
3.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
rgallardf71f2512015-02-02 10:12:21 -08004.\"
5.\" This code is free software; you can redistribute it and/or modify it
6.\" under the terms of the GNU General Public License version 2 only, as
7.\" published by the Free Software Foundation.
8.\"
9.\" This code is distributed in the hope that it will be useful, but WITHOUT
10.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
mfangf2cf0062015-07-15 12:12:46 -070011.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
rgallardf71f2512015-02-02 10:12:21 -080012.\" version 2 for more details (a copy is included in the LICENSE file that
13.\" accompanied this code).
14.\"
15.\" You should have received a copy of the GNU General Public License version
16.\" 2 along with this work; if not, write to the Free Software Foundation,
17.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18.\"
19.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20.\" or visit www.oracle.com if you need additional information or have any
21.\" questions.
22.\"
23.\" Title: java
24.\" Language: English
25.\" Date: 03 March 2015
26.\" SectDesc: Basic Tools
27.\" Software: JDK 8
28.\" Arch: generic
29.\" Part Number: E38207-04
30.\" Doc ID: JSSON
rgallardb6435452013-11-25 20:19:02 -080031.\"
32.if n .pl 99999
rgallardf71f2512015-02-02 10:12:21 -080033.TH "java" "1" "03 March 2015" "JDK 8" "Basic Tools"
34.\" -----------------------------------------------------------------
35.\" * Define some portability stuff
36.\" -----------------------------------------------------------------
37.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38.\" http://bugs.debian.org/507673
39.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
40.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41.ie \n(.g .ds Aq \(aq
42.el .ds Aq '
43.\" -----------------------------------------------------------------
44.\" * set default formatting
45.\" -----------------------------------------------------------------
46.\" disable hyphenation
47.nh
48.\" disable justification (adjust text to left margin only)
49.ad l
50.\" -----------------------------------------------------------------
51.\" * MAIN CONTENT STARTS HERE *
52.\" -----------------------------------------------------------------
53.SH "NAME"
rgallardb6435452013-11-25 20:19:02 -080054java \- Launches a Java application\&.
rgallardf71f2512015-02-02 10:12:21 -080055.SH "SYNOPSIS"
56.sp
57.if n \{\
58.RS 4
59.\}
60.nf
rgallardb6435452013-11-25 20:19:02 -080061\fBjava\fR [\fIoptions\fR] \fIclassname\fR [\fIargs\fR]
rgallardf71f2512015-02-02 10:12:21 -080062.fi
63.if n \{\
64.RE
65.\}
66.sp
67.if n \{\
68.RS 4
69.\}
70.nf
rgallardb6435452013-11-25 20:19:02 -080071\fBjava\fR [\fIoptions\fR] \fB\-jar\fR \fIfilename\fR [\fIargs\fR]
rgallardf71f2512015-02-02 10:12:21 -080072.fi
73.if n \{\
74.RE
75.\}
rgallard36ba8532014-06-06 15:45:48 -070076.PP
rgallardf71f2512015-02-02 10:12:21 -080077\fIoptions\fR
78.RS 4
79Command\-line options separated by spaces\&. See Options\&.
80.RE
81.PP
82\fIclassname\fR
83.RS 4
84The name of the class to be launched\&.
85.RE
86.PP
87\fIfilename\fR
88.RS 4
89The name of the Java Archive (JAR) file to be called\&. Used only with the
90\fB\-jar\fR
91option\&.
92.RE
93.PP
94\fIargs\fR
95.RS 4
96The arguments passed to the
97\fBmain()\fR
98method separated by spaces\&.
99.RE
100.SH "DESCRIPTION"
101.PP
102The
103\fBjava\fR
104command starts a Java application\&. It does this by starting the Java Runtime Environment (JRE), loading the specified class, and calling that class\*(Aqs
105\fBmain()\fR
106method\&. The method must be declared
107\fIpublic\fR
108and
109\fIstatic\fR, it must not return any value, and it must accept a
110\fBString\fR
111array as a parameter\&. The method declaration has the following form:
112.sp
113.if n \{\
114.RS 4
115.\}
116.nf
117\fBpublic static void main(String[] args)\fR
118
119.fi
120.if n \{\
121.RE
122.\}
123.PP
124The
125\fBjava\fR
126command can be used to launch a JavaFX application by loading a class that either has a
127\fBmain()\fR
128method or that extends
129\fBjavafx\&.application\&.Application\fR\&. In the latter case, the launcher constructs an instance of the
130\fBApplication\fR
131class, calls its
132\fBinit()\fR
133method, and then calls the
134\fBstart(javafx\&.stage\&.Stage)\fR
135method\&.
136.PP
137By default, the first argument that is not an option of the
138\fBjava\fR
139command is the fully qualified name of the class to be called\&. If the
140\fB\-jar\fR
141option is specified, its argument is the name of the JAR file containing class and resource files for the application\&. The startup class must be indicated by the
142\fBMain\-Class\fR
143manifest header in its source code\&.
rgallardb6435452013-11-25 20:19:02 -0800144.PP
145The JRE searches for the startup class (and other classes used by the application) in three sets of locations: the bootstrap class path, the installed extensions, and the user\(cqs class path\&.
146.PP
rgallardf71f2512015-02-02 10:12:21 -0800147Arguments after the class file name or the JAR file name are passed to the
148\fBmain()\fR
149method\&.
150.SH "OPTIONS"
151.PP
152The
153\fBjava\fR
154command supports a wide range of options that can be divided into the following categories:
155.sp
156.RS 4
157.ie n \{\
158\h'-04'\(bu\h'+03'\c
159.\}
160.el \{\
161.sp -1
162.IP \(bu 2.3
163.\}
rgallardb6435452013-11-25 20:19:02 -0800164Standard Options
rgallardf71f2512015-02-02 10:12:21 -0800165.RE
166.sp
167.RS 4
168.ie n \{\
169\h'-04'\(bu\h'+03'\c
170.\}
171.el \{\
172.sp -1
173.IP \(bu 2.3
174.\}
175Non\-Standard Options
176.RE
177.sp
178.RS 4
179.ie n \{\
180\h'-04'\(bu\h'+03'\c
181.\}
182.el \{\
183.sp -1
184.IP \(bu 2.3
185.\}
rgallardb6435452013-11-25 20:19:02 -0800186Advanced Runtime Options
rgallardf71f2512015-02-02 10:12:21 -0800187.RE
188.sp
189.RS 4
190.ie n \{\
191\h'-04'\(bu\h'+03'\c
192.\}
193.el \{\
194.sp -1
195.IP \(bu 2.3
196.\}
rgallardb6435452013-11-25 20:19:02 -0800197Advanced JIT Compiler Options
rgallardf71f2512015-02-02 10:12:21 -0800198.RE
199.sp
200.RS 4
201.ie n \{\
202\h'-04'\(bu\h'+03'\c
203.\}
204.el \{\
205.sp -1
206.IP \(bu 2.3
207.\}
rgallardb6435452013-11-25 20:19:02 -0800208Advanced Serviceability Options
rgallardf71f2512015-02-02 10:12:21 -0800209.RE
210.sp
211.RS 4
212.ie n \{\
213\h'-04'\(bu\h'+03'\c
214.\}
215.el \{\
216.sp -1
217.IP \(bu 2.3
218.\}
rgallardb6435452013-11-25 20:19:02 -0800219Advanced Garbage Collection Options
rgallardf71f2512015-02-02 10:12:21 -0800220.RE
rgallardb6435452013-11-25 20:19:02 -0800221.PP
222Standard options are guaranteed to be supported by all implementations of the Java Virtual Machine (JVM)\&. They are used for common actions, such as checking the version of the JRE, setting the class path, enabling verbose output, and so on\&.
223.PP
rgallardf71f2512015-02-02 10:12:21 -0800224Non\-standard options are general purpose options that are specific to the Java HotSpot Virtual Machine, so they are not guaranteed to be supported by all JVM implementations, and are subject to change\&. These options start with
225\fB\-X\fR\&.
rgallardb6435452013-11-25 20:19:02 -0800226.PP
rgallardf71f2512015-02-02 10:12:21 -0800227Advanced options are not recommended for casual use\&. These are developer options used for tuning specific areas of the Java HotSpot Virtual Machine operation that often have specific system requirements and may require privileged access to system configuration parameters\&. They are also not guaranteed to be supported by all JVM implementations, and are subject to change\&. Advanced options start with
228\fB\-XX\fR\&.
rgallardb6435452013-11-25 20:19:02 -0800229.PP
230To keep track of the options that were deprecated or removed in the latest release, there is a section named Deprecated and Removed Options at the end of the document\&.
231.PP
rgallardf71f2512015-02-02 10:12:21 -0800232Boolean options are used to either enable a feature that is disabled by default or disable a feature that is enabled by default\&. Such options do not require a parameter\&. Boolean
233\fB\-XX\fR
234options are enabled using the plus sign (\fB\-XX:+\fR\fIOptionName\fR) and disabled using the minus sign (\fB\-XX:\-\fR\fIOptionName\fR)\&.
rgallardb6435452013-11-25 20:19:02 -0800235.PP
rgallardf71f2512015-02-02 10:12:21 -0800236For options that require an argument, the argument may be separated from the option name by a space, a colon (:), or an equal sign (=), or the argument may directly follow the option (the exact syntax differs for each option)\&. If you are expected to specify the size in bytes, you can use no suffix, or use the suffix
237\fBk\fR
238or
239\fBK\fR
240for kilobytes (KB),
241\fBm\fR
242or
243\fBM\fR
244for megabytes (MB),
245\fBg\fR
246or
247\fBG\fR
248for gigabytes (GB)\&. For example, to set the size to 8 GB, you can specify either
249\fB8g\fR,
250\fB8192m\fR,
251\fB8388608k\fR, or
252\fB8589934592\fR
253as the argument\&. If you are expected to specify the percentage, use a number from 0 to 1 (for example, specify
254\fB0\&.25\fR
255for 25%)\&.
256.SS "Standard Options"
257.PP
rgallardb6435452013-11-25 20:19:02 -0800258These are the most commonly used options that are supported by all implementations of the JVM\&.
rgallardf71f2512015-02-02 10:12:21 -0800259.PP
260\-agentlib:\fIlibname\fR[=\fIoptions\fR]
261.RS 4
262Loads the specified native agent library\&. After the library name, a comma\-separated list of options specific to the library can be used\&.
263.sp
264If the option
265\fB\-agentlib:foo\fR
266is specified, then the JVM attempts to load the library named
267\fBlibfoo\&.so\fR
268in the location specified by the
269\fBLD_LIBRARY_PATH\fR
270system variable (on OS X this variable is
271\fBDYLD_LIBRARY_PATH\fR)\&.
272.sp
rgallardb6435452013-11-25 20:19:02 -0800273The 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:
rgallardf71f2512015-02-02 10:12:21 -0800274.sp
275.if n \{\
276.RS 4
277.\}
278.nf
279\fB\-agentlib:hprof=cpu=samples,interval=20,depth=3\fR
280
281.fi
282.if n \{\
283.RE
284.\}
rgallardb6435452013-11-25 20:19:02 -0800285The 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:
rgallardf71f2512015-02-02 10:12:21 -0800286.sp
287.if n \{\
288.RS 4
289.\}
290.nf
291\fB\-agentlib:jdwp=transport=dt_socket,server=y,address=8000\fR
292
293.fi
294.if n \{\
295.RE
296.\}
rgallardb6435452013-11-25 20:19:02 -0800297For more information about the native agent libraries, refer to the following:
rgallardf71f2512015-02-02 10:12:21 -0800298.sp
299.RS 4
300.ie n \{\
301\h'-04'\(bu\h'+03'\c
302.\}
303.el \{\
304.sp -1
305.IP \(bu 2.3
306.\}
307The
308\fBjava\&.lang\&.instrument\fR
309package description at http://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package\-summary\&.html
310.RE
311.sp
312.RS 4
313.ie n \{\
314\h'-04'\(bu\h'+03'\c
315.\}
316.el \{\
317.sp -1
318.IP \(bu 2.3
319.\}
rgallardb6435452013-11-25 20:19:02 -0800320Agent Command Line Options in the JVM Tools Interface guide at http://docs\&.oracle\&.com/javase/8/docs/platform/jvmti/jvmti\&.html#starting
rgallardf71f2512015-02-02 10:12:21 -0800321.RE
322.RE
323.PP
324\-agentpath:\fIpathname\fR[=\fIoptions\fR]
325.RS 4
326Loads the native agent library specified by the absolute path name\&. This option is equivalent to
327\fB\-agentlib\fR
328but uses the full path and file name of the library\&.
329.RE
330.PP
331\-client
332.RS 4
333Selects the Java HotSpot Client VM\&. The 64\-bit version of the Java SE Development Kit (JDK) currently ignores this option and instead uses the Server JVM\&.
334.sp
335For default JVM selection, see Server\-Class Machine Detection at
336http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/server\-class\&.html
337.RE
338.PP
339\-D\fIproperty\fR=\fIvalue\fR
340.RS 4
341Sets a system property value\&. The
342\fIproperty\fR
343variable is a string with no spaces that represents the name of the property\&. The
344\fIvalue\fR
345variable is a string that represents the value of the property\&. If
346\fIvalue\fR
347is a string with spaces, then enclose it in quotation marks (for example
348\fB\-Dfoo="foo bar"\fR)\&.
349.RE
350.PP
351\-d32
352.RS 4
353Runs the application in a 32\-bit environment\&. If a 32\-bit environment is not installed or is not supported, then an error will be reported\&. By default, the application is run in a 32\-bit environment unless a 64\-bit system is used\&.
354.RE
355.PP
356\-d64
357.RS 4
358Runs the application in a 64\-bit environment\&. If a 64\-bit environment is not installed or is not supported, then an error will be reported\&. By default, the application is run in a 32\-bit environment unless a 64\-bit system is used\&.
359.sp
360Currently only the Java HotSpot Server VM supports 64\-bit operation, and the
361\fB\-server\fR
362option is implicit with the use of
363\fB\-d64\fR\&. The
364\fB\-client\fR
365option is ignored with the use of
366\fB\-d64\fR\&. This is subject to change in a future release\&.
367.RE
368.PP
369\-disableassertions[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
rgallardb6435452013-11-25 20:19:02 -0800370.br
rgallardf71f2512015-02-02 10:12:21 -0800371\-da[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
372.RS 4
rgallardb6435452013-11-25 20:19:02 -0800373Disables assertions\&. By default, assertions are disabled in all packages and classes\&.
rgallardf71f2512015-02-02 10:12:21 -0800374.sp
375With no arguments,
376\fB\-disableassertions\fR
377(\fB\-da\fR) disables assertions in all packages and classes\&. With the
378\fIpackagename\fR
379argument ending in
380\fB\&.\&.\&.\fR, the switch disables assertions in the specified package and any subpackages\&. If the argument is simply
381\fB\&.\&.\&.\fR, then the switch disables assertions in the unnamed package in the current working directory\&. With the
382\fIclassname\fR
383argument, the switch disables assertions in the specified class\&.
384.sp
385The
386\fB\-disableassertions\fR
387(\fB\-da\fR) option applies to all class loaders and to system classes (which do not have a class loader)\&. There is one exception to this rule: if the option is provided with no arguments, then it does not apply to system classes\&. This makes it easy to disable assertions in all classes except for system classes\&. The
388\fB\-disablesystemassertions\fR
389option enables you to disable assertions in all system classes\&.
390.sp
391To explicitly enable assertions in specific packages or classes, use the
392\fB\-enableassertions\fR
393(\fB\-ea\fR) option\&. Both options can be used at the same time\&. For example, to run the
394\fBMyClass\fR
395application with assertions enabled in package
396\fBcom\&.wombat\&.fruitbat\fR
397(and any subpackages) but disabled in class
398\fBcom\&.wombat\&.fruitbat\&.Brickbat\fR, use the following command:
399.sp
400.if n \{\
401.RS 4
402.\}
rgallard04b0ca42014-10-17 11:33:22 -0700403.nf
rgallardf71f2512015-02-02 10:12:21 -0800404\fBjava \-ea:com\&.wombat\&.fruitbat\&.\&.\&. \-da:com\&.wombat\&.fruitbat\&.Brickbat MyClass\fR
405
rgallard04b0ca42014-10-17 11:33:22 -0700406.fi
rgallardf71f2512015-02-02 10:12:21 -0800407.if n \{\
408.RE
409.\}
410.RE
411.PP
412\-disablesystemassertions
413.br
414\-dsa
415.RS 4
416Disables assertions in all system classes\&.
417.RE
418.PP
419\-enableassertions[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
420.br
421\-ea[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
422.RS 4
rgallardb6435452013-11-25 20:19:02 -0800423Enables assertions\&. By default, assertions are disabled in all packages and classes\&.
rgallardf71f2512015-02-02 10:12:21 -0800424.sp
425With no arguments,
426\fB\-enableassertions\fR
427(\fB\-ea\fR) enables assertions in all packages and classes\&. With the
428\fIpackagename\fR
429argument ending in
430\fB\&.\&.\&.\fR, the switch enables assertions in the specified package and any subpackages\&. If the argument is simply
431\fB\&.\&.\&.\fR, then the switch enables assertions in the unnamed package in the current working directory\&. With the
432\fIclassname\fR
433argument, the switch enables assertions in the specified class\&.
434.sp
435The
436\fB\-enableassertions\fR
437(\fB\-ea\fR) option applies to all class loaders and to system classes (which do not have a class loader)\&. There is one exception to this rule: if the option is provided with no arguments, then it does not apply to system classes\&. This makes it easy to enable assertions in all classes except for system classes\&. The
438\fB\-enablesystemassertions\fR
439option provides a separate switch to enable assertions in all system classes\&.
440.sp
441To explicitly disable assertions in specific packages or classes, use the
442\fB\-disableassertions\fR
443(\fB\-da\fR) option\&. If a single command contains multiple instances of these switches, then they are processed in order before loading any classes\&. For example, to run the
444\fBMyClass\fR
445application with assertions enabled only in package
446\fBcom\&.wombat\&.fruitbat\fR
447(and any subpackages) but disabled in class
448\fBcom\&.wombat\&.fruitbat\&.Brickbat\fR, use the following command:
449.sp
450.if n \{\
451.RS 4
452.\}
453.nf
454\fBjava \-ea:com\&.wombat\&.fruitbat\&.\&.\&. \-da:com\&.wombat\&.fruitbat\&.Brickbat MyClass\fR
455
456.fi
457.if n \{\
458.RE
459.\}
460.RE
461.PP
462\-enablesystemassertions
rgallardb6435452013-11-25 20:19:02 -0800463.br
rgallardf71f2512015-02-02 10:12:21 -0800464\-esa
465.RS 4
rgallardb6435452013-11-25 20:19:02 -0800466Enables assertions in all system classes\&.
rgallardf71f2512015-02-02 10:12:21 -0800467.RE
468.PP
469\-help
rgallardb6435452013-11-25 20:19:02 -0800470.br
rgallardf71f2512015-02-02 10:12:21 -0800471\-?
472.RS 4
473Displays usage information for the
474\fBjava\fR
475command without actually running the JVM\&.
476.RE
477.PP
478\-jar \fIfilename\fR
479.RS 4
480Executes a program encapsulated in a JAR file\&. The
481\fIfilename\fR
482argument is the name of a JAR file with a manifest that contains a line in the form
483\fBMain\-Class:\fR\fIclassname\fR
484that defines the class with the
485\fBpublic static void main(String[] args)\fR
486method that serves as your application\*(Aqs starting point\&.
487.sp
488When you use the
489\fB\-jar\fR
490option, the specified JAR file is the source of all user classes, and other class path settings are ignored\&.
491.sp
rgallardb6435452013-11-25 20:19:02 -0800492For more information about JAR files, see the following resources:
rgallardf71f2512015-02-02 10:12:21 -0800493.sp
494.RS 4
495.ie n \{\
496\h'-04'\(bu\h'+03'\c
497.\}
498.el \{\
499.sp -1
500.IP \(bu 2.3
501.\}
rgallardb6435452013-11-25 20:19:02 -0800502jar(1)
rgallardf71f2512015-02-02 10:12:21 -0800503.RE
504.sp
505.RS 4
506.ie n \{\
507\h'-04'\(bu\h'+03'\c
508.\}
509.el \{\
510.sp -1
511.IP \(bu 2.3
512.\}
rgallardb6435452013-11-25 20:19:02 -0800513The Java Archive (JAR) Files guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jar/index\&.html
rgallardf71f2512015-02-02 10:12:21 -0800514.RE
515.sp
516.RS 4
517.ie n \{\
518\h'-04'\(bu\h'+03'\c
519.\}
520.el \{\
521.sp -1
522.IP \(bu 2.3
523.\}
524Lesson: Packaging Programs in JAR Files at
rgallardb6435452013-11-25 20:19:02 -0800525
rgallardf71f2512015-02-02 10:12:21 -0800526http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.html
527.RE
528.RE
529.PP
530\-javaagent:\fIjarpath\fR[=\fIoptions\fR]
531.RS 4
532Loads the specified Java programming language agent\&. For more information about instrumenting Java applications, see the
533\fBjava\&.lang\&.instrument\fR
534package description in the Java API documentation at http://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package\-summary\&.html
535.RE
536.PP
537\-jre\-restrict\-search
538.RS 4
539Includes user\-private JREs in the version search\&.
540.RE
541.PP
542\-no\-jre\-restrict\-search
543.RS 4
544Excludes user\-private JREs from the version search\&.
545.RE
546.PP
547\-server
548.RS 4
549Selects the Java HotSpot Server VM\&. The 64\-bit version of the JDK supports only the Server VM, so in that case the option is implicit\&.
550.sp
551For default JVM selection, see Server\-Class Machine Detection at
552http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/server\-class\&.html
553.RE
554.PP
555\-showversion
556.RS 4
557Displays version information and continues execution of the application\&. This option is equivalent to the
558\fB\-version\fR
559option except that the latter instructs the JVM to exit after displaying version information\&.
560.RE
561.PP
562\-splash:\fIimgname\fR
563.RS 4
564Shows the splash screen with the image specified by
565\fIimgname\fR\&. For example, to show the
566\fBsplash\&.gif\fR
567file from the
568\fBimages\fR
569directory when starting your application, use the following option:
570.sp
571.if n \{\
572.RS 4
573.\}
574.nf
575\fB\-splash:images/splash\&.gif\fR
576
577.fi
578.if n \{\
579.RE
580.\}
581.RE
582.PP
583\-verbose:class
584.RS 4
rgallardb6435452013-11-25 20:19:02 -0800585Displays information about each loaded class\&.
rgallardf71f2512015-02-02 10:12:21 -0800586.RE
587.PP
588\-verbose:gc
589.RS 4
rgallardb6435452013-11-25 20:19:02 -0800590Displays information about each garbage collection (GC) event\&.
rgallardf71f2512015-02-02 10:12:21 -0800591.RE
592.PP
593\-verbose:jni
594.RS 4
rgallardb6435452013-11-25 20:19:02 -0800595Displays information about the use of native methods and other Java Native Interface (JNI) activity\&.
rgallardf71f2512015-02-02 10:12:21 -0800596.RE
597.PP
598\-version
599.RS 4
600Displays version information and then exits\&. This option is equivalent to the
601\fB\-showversion\fR
602option except that the latter does not instruct the JVM to exit after displaying version information\&.
603.RE
604.PP
605\-version:\fIrelease\fR
606.RS 4
607Specifies the release version to be used for running the application\&. If the version of the
608\fBjava\fR
609command called does not meet this specification and an appropriate implementation is found on the system, then the appropriate implementation will be used\&.
610.sp
611The
612\fIrelease\fR
613argument specifies either the exact version string, or a list of version strings and ranges separated by spaces\&. A
614\fIversion string\fR
615is the developer designation of the version number in the following form:
616\fB1\&.\fR\fIx\fR\fB\&.0_\fR\fIu\fR
617(where
618\fIx\fR
619is the major version number, and
620\fIu\fR
621is the update version number)\&. A
622\fIversion range\fR
623is made up of a version string followed by a plus sign (\fB+\fR) to designate this version or later, or a part of a version string followed by an asterisk (\fB*\fR) to designate any version string with a matching prefix\&. Version strings and ranges can be combined using a space for a logical
624\fIOR\fR
625combination, or an ampersand (\fB&\fR) for a logical
626\fIAND\fR
627combination of two version strings/ranges\&. For example, if running the class or JAR file requires either JRE 6u13 (1\&.6\&.0_13), or any JRE 6 starting from 6u10 (1\&.6\&.0_10), specify the following:
628.sp
629.if n \{\
630.RS 4
631.\}
632.nf
633\fB\-version:"1\&.6\&.0_13 1\&.6* & 1\&.6\&.0_10+"\fR
634
635.fi
636.if n \{\
637.RE
638.\}
639Quotation marks are necessary only if there are spaces in the
640\fIrelease\fR
641parameter\&.
642.sp
rgallardb6435452013-11-25 20:19:02 -0800643For JAR files, the preference is to specify version requirements in the JAR file manifest rather than on the command line\&.
rgallardf71f2512015-02-02 10:12:21 -0800644.RE
645.SS "Non\-Standard Options"
646.PP
rgallardb6435452013-11-25 20:19:02 -0800647These options are general purpose options that are specific to the Java HotSpot Virtual Machine\&.
rgallardf71f2512015-02-02 10:12:21 -0800648.PP
649\-X
650.RS 4
651Displays help for all available
652\fB\-X\fR
653options\&.
654.RE
655.PP
656\-Xbatch
657.RS 4
658Disables background compilation\&. By default, the JVM compiles the method as a background task, running the method in interpreter mode until the background compilation is finished\&. The
659\fB\-Xbatch\fR
660flag disables background compilation so that compilation of all methods proceeds as a foreground task until completed\&.
661.sp
662This option is equivalent to
663\fB\-XX:\-BackgroundCompilation\fR\&.
664.RE
665.PP
666\-Xbootclasspath:\fIpath\fR
667.RS 4
rgallardb6435452013-11-25 20:19:02 -0800668Specifies 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\&.
rgallardf71f2512015-02-02 10:12:21 -0800669.sp
670Do not deploy applications that use this option to override a class in
671\fBrt\&.jar\fR, because this violates the JRE binary code license\&.
672.RE
673.PP
674\-Xbootclasspath/a:\fIpath\fR
675.RS 4
rgallardb6435452013-11-25 20:19:02 -0800676Specifies a list of directories, JAR files, and ZIP archives separated by colons (:) to append to the end of the default bootstrap class path\&.
rgallardf71f2512015-02-02 10:12:21 -0800677.sp
678Do not deploy applications that use this option to override a class in
679\fBrt\&.jar\fR, because this violates the JRE binary code license\&.
680.RE
681.PP
682\-Xbootclasspath/p:\fIpath\fR
683.RS 4
rgallardb6435452013-11-25 20:19:02 -0800684Specifies a list of directories, JAR files, and ZIP archives separated by colons (:) to prepend to the front of the default bootstrap class path\&.
rgallardf71f2512015-02-02 10:12:21 -0800685.sp
686Do not deploy applications that use this option to override a class in
687\fBrt\&.jar\fR, because this violates the JRE binary code license\&.
688.RE
689.PP
690\-Xcheck:jni
691.RS 4
rgallardb6435452013-11-25 20:19:02 -0800692Performs 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\&.
rgallardf71f2512015-02-02 10:12:21 -0800693.RE
694.PP
695\-Xcomp
696.RS 4
697Forces compilation of methods on first invocation\&. By default, the Client VM (\fB\-client\fR) performs 1,000 interpreted method invocations and the Server VM (\fB\-server\fR) performs 10,000 interpreted method invocations to gather information for efficient compilation\&. Specifying the
698\fB\-Xcomp\fR
699option disables interpreted method invocations to increase compilation performance at the expense of efficiency\&.
700.sp
701You can also change the number of interpreted method invocations before compilation using the
702\fB\-XX:CompileThreshold\fR
703option\&.
704.RE
705.PP
706\-Xdebug
707.RS 4
rgallardb6435452013-11-25 20:19:02 -0800708Does nothing\&. Provided for backward compatibility\&.
rgallardf71f2512015-02-02 10:12:21 -0800709.RE
710.PP
711\-Xdiag
712.RS 4
rgallardb6435452013-11-25 20:19:02 -0800713Shows additional diagnostic messages\&.
rgallardf71f2512015-02-02 10:12:21 -0800714.RE
715.PP
716\-Xfuture
717.RS 4
718Enables strict class\-file format checks that enforce close conformance to the class\-file format specification\&. Developers are encouraged to use this flag when developing new code because the stricter checks will become the default in future releases\&.
719.RE
720.PP
721\-Xint
722.RS 4
723Runs 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\&.
724.RE
725.PP
726\-Xinternalversion
727.RS 4
728Displays more detailed JVM version information than the
729\fB\-version\fR
730option, and then exits\&.
731.RE
732.PP
733\-Xloggc:\fIfilename\fR
734.RS 4
735Sets 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
736\fB\-verbose:gc\fR
737with the time elapsed since the first GC event preceding each logged event\&. The
738\fB\-Xloggc\fR
739option overrides
740\fB\-verbose:gc\fR
741if both are given with the same
742\fBjava\fR
743command\&.
744.sp
rgallardb6435452013-11-25 20:19:02 -0800745Example:
rgallardf71f2512015-02-02 10:12:21 -0800746.sp
747.if n \{\
748.RS 4
749.\}
750.nf
751\fB\-Xloggc:garbage\-collection\&.log\fR
752
753.fi
754.if n \{\
755.RE
756.\}
757.RE
758.PP
759\-Xmaxjitcodesize=\fIsize\fR
760.RS 4
761Specifies the maximum code cache size (in bytes) for JIT\-compiled code\&. Append the letter
762\fBk\fR
763or
764\fBK\fR
765to indicate kilobytes,
766\fBm\fR
767or
768\fBM\fR
769to indicate megabytes,
770\fBg\fR
771or
772\fBG\fR
773to indicate gigabytes\&. The default maximum code cache size is 240 MB; if you disable tiered compilation with the option
774\fB\-XX:\-TieredCompilation\fR, then the default size is 48 MB:
775.sp
776.if n \{\
777.RS 4
778.\}
779.nf
780\fB\-Xmaxjitcodesize=240m\fR
781
782.fi
783.if n \{\
784.RE
785.\}
786This option is equivalent to
787\fB\-XX:ReservedCodeCacheSize\fR\&.
788.RE
789.PP
790\-Xmixed
791.RS 4
rgallardb6435452013-11-25 20:19:02 -0800792Executes all bytecode by the interpreter except for hot methods, which are compiled to native code\&.
rgallardf71f2512015-02-02 10:12:21 -0800793.RE
794.PP
795\-Xmn\fIsize\fR
796.RS 4
797Sets the initial and maximum size (in bytes) of the heap for the young generation (nursery)\&. Append the letter
798\fBk\fR
799or
800\fBK\fR
801to indicate kilobytes,
802\fBm\fR
803or
804\fBM\fR
805to indicate megabytes,
806\fBg\fR
807or
808\fBG\fR
809to indicate gigabytes\&.
810.sp
rgallardb6435452013-11-25 20:19:02 -0800811The 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\&.
rgallardf71f2512015-02-02 10:12:21 -0800812.sp
rgallardb6435452013-11-25 20:19:02 -0800813The following examples show how to set the initial and maximum size of young generation to 256 MB using various units:
rgallardf71f2512015-02-02 10:12:21 -0800814.sp
815.if n \{\
816.RS 4
817.\}
818.nf
819\fB\-Xmn256m\fR
820\fB\-Xmn262144k\fR
821\fB\-Xmn268435456\fR
822
823.fi
824.if n \{\
825.RE
826.\}
827Instead of the
828\fB\-Xmn\fR
829option to set both the initial and maximum size of the heap for the young generation, you can use
830\fB\-XX:NewSize\fR
831to set the initial size and
832\fB\-XX:MaxNewSize\fR
833to set the maximum size\&.
834.RE
835.PP
836\-Xms\fIsize\fR
837.RS 4
838Sets the initial size (in bytes) of the heap\&. This value must be a multiple of 1024 and greater than 1 MB\&. Append the letter
839\fBk\fR
840or
841\fBK\fR
842to indicate kilobytes,
843\fBm\fR
844or
845\fBM\fR
846to indicate megabytes,
847\fBg\fR
848or
849\fBG\fR
850to indicate gigabytes\&.
851.sp
rgallardb6435452013-11-25 20:19:02 -0800852The following examples show how to set the size of allocated memory to 6 MB using various units:
rgallardf71f2512015-02-02 10:12:21 -0800853.sp
854.if n \{\
855.RS 4
856.\}
857.nf
858\fB\-Xms6291456\fR
859\fB\-Xms6144k\fR
860\fB\-Xms6m\fR
861
862.fi
863.if n \{\
864.RE
865.\}
866If 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
867\fB\-Xmn\fR
868option or the
869\fB\-XX:NewSize\fR
870option\&.
871.RE
872.PP
873\-Xmx\fIsize\fR
874.RS 4
875Specifies 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
876\fBk\fR
877or
878\fBK\fR
879to indicate kilobytes,
880\fBm\fR
881or
882\fBM\fR
883to indicate megabytes,
884\fBg\fR
885or
886\fBG\fR
887to indicate gigabytes\&. The default value is chosen at runtime based on system configuration\&. For server deployments,
888\fB\-Xms\fR
889and
890\fB\-Xmx\fR
891are often set to the same value\&. See the section "Ergonomics" in
892\fIJava SE HotSpot Virtual Machine Garbage Collection Tuning Guide\fR
893at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gctuning/index\&.html\&.
894.sp
rgallardb6435452013-11-25 20:19:02 -0800895The following examples show how to set the maximum allowed size of allocated memory to 80 MB using various units:
rgallardf71f2512015-02-02 10:12:21 -0800896.sp
897.if n \{\
898.RS 4
899.\}
900.nf
901\fB\-Xmx83886080\fR
902\fB\-Xmx81920k\fR
903\fB\-Xmx80m\fR
904
905.fi
906.if n \{\
907.RE
908.\}
909The
910\fB\-Xmx\fR
911option is equivalent to
912\fB\-XX:MaxHeapSize\fR\&.
913.RE
914.PP
915\-Xnoclassgc
916.RS 4
rgallardb6435452013-11-25 20:19:02 -0800917Disables garbage collection (GC) of classes\&. This can save some GC time, which shortens interruptions during the application run\&.
rgallardf71f2512015-02-02 10:12:21 -0800918.sp
919When you specify
920\fB\-Xnoclassgc\fR
921at 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\&.
922.RE
923.PP
924\-Xprof
925.RS 4
rgallardb6435452013-11-25 20:19:02 -0800926Profiles 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\&.
rgallardf71f2512015-02-02 10:12:21 -0800927.RE
928.PP
929\-Xrs
930.RS 4
rgallardb6435452013-11-25 20:19:02 -0800931Reduces the use of operating system signals by the JVM\&.
rgallardf71f2512015-02-02 10:12:21 -0800932.sp
rgallardb6435452013-11-25 20:19:02 -0800933Shutdown 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\&.
rgallardf71f2512015-02-02 10:12:21 -0800934.sp
935The JVM catches signals to implement shutdown hooks for unexpected termination\&. The JVM uses
936\fBSIGHUP\fR,
937\fBSIGINT\fR, and
938\fBSIGTERM\fR
939to initiate the running of shutdown hooks\&.
940.sp
941The JVM uses a similar mechanism to implement the feature of dumping thread stacks for debugging purposes\&. The JVM uses
942\fBSIGQUIT\fR
943to perform thread dumps\&.
944.sp
945Applications embedding the JVM frequently need to trap signals such as
946\fBSIGINT\fR
947or
948\fBSIGTERM\fR, which can lead to interference with the JVM signal handlers\&. The
949\fB\-Xrs\fR
950option is available to address this issue\&. When
951\fB\-Xrs\fR
952is used, the signal masks for
953\fBSIGINT\fR,
954\fBSIGTERM\fR,
955\fBSIGHUP\fR, and
956\fBSIGQUIT\fR
957are not changed by the JVM, and signal handlers for these signals are not installed\&.
958.sp
959There are two consequences of specifying
960\fB\-Xrs\fR:
961.sp
962.RS 4
963.ie n \{\
964\h'-04'\(bu\h'+03'\c
965.\}
966.el \{\
967.sp -1
968.IP \(bu 2.3
969.\}
970\fBSIGQUIT\fR
971thread dumps are not available\&.
972.RE
973.sp
974.RS 4
975.ie n \{\
976\h'-04'\(bu\h'+03'\c
977.\}
978.el \{\
979.sp -1
980.IP \(bu 2.3
981.\}
982User code is responsible for causing shutdown hooks to run, for example, by calling
983\fBSystem\&.exit()\fR
984when the JVM is to be terminated\&.
985.RE
986.RE
987.PP
988\-Xshare:\fImode\fR
989.RS 4
990Sets the class data sharing (CDS) mode\&. Possible
991\fImode\fR
992arguments for this option include the following:
993.PP
rgallardb6435452013-11-25 20:19:02 -0800994auto
rgallardf71f2512015-02-02 10:12:21 -0800995.RS 4
996Use CDS if possible\&. This is the default value for Java HotSpot 32\-Bit Client VM\&.
997.RE
998.PP
rgallardb6435452013-11-25 20:19:02 -0800999on
rgallardf71f2512015-02-02 10:12:21 -08001000.RS 4
1001Require the use of CDS\&. Print an error message and exit if class data sharing cannot be used\&.
1002.RE
1003.PP
rgallardb6435452013-11-25 20:19:02 -08001004off
rgallardf71f2512015-02-02 10:12:21 -08001005.RS 4
1006Do not use CDS\&. This is the default value for Java HotSpot 32\-Bit Server VM, Java HotSpot 64\-Bit Client VM, and Java HotSpot 64\-Bit Server VM\&.
1007.RE
1008.PP
rgallardb6435452013-11-25 20:19:02 -08001009dump
rgallardf71f2512015-02-02 10:12:21 -08001010.RS 4
1011Manually generate the CDS archive\&. Specify the application class path as described in "Setting the Class Path "\&.
1012.sp
1013You should regenerate the CDS archive with each new JDK release\&.
1014.RE
1015.RE
1016.PP
1017\-XshowSettings:\fIcategory\fR
1018.RS 4
1019Shows settings and continues\&. Possible
1020\fIcategory\fR
1021arguments for this option include the following:
1022.PP
rgallardb6435452013-11-25 20:19:02 -08001023all
rgallardf71f2512015-02-02 10:12:21 -08001024.RS 4
rgallardb6435452013-11-25 20:19:02 -08001025Shows all categories of settings\&. This is the default value\&.
rgallardf71f2512015-02-02 10:12:21 -08001026.RE
1027.PP
rgallardb6435452013-11-25 20:19:02 -08001028locale
rgallardf71f2512015-02-02 10:12:21 -08001029.RS 4
rgallardb6435452013-11-25 20:19:02 -08001030Shows settings related to locale\&.
rgallardf71f2512015-02-02 10:12:21 -08001031.RE
1032.PP
rgallardb6435452013-11-25 20:19:02 -08001033properties
rgallardf71f2512015-02-02 10:12:21 -08001034.RS 4
rgallardb6435452013-11-25 20:19:02 -08001035Shows settings related to system properties\&.
rgallardf71f2512015-02-02 10:12:21 -08001036.RE
1037.PP
rgallardb6435452013-11-25 20:19:02 -08001038vm
rgallardf71f2512015-02-02 10:12:21 -08001039.RS 4
rgallardb6435452013-11-25 20:19:02 -08001040Shows the settings of the JVM\&.
rgallardf71f2512015-02-02 10:12:21 -08001041.RE
1042.RE
1043.PP
1044\-Xss\fIsize\fR
1045.RS 4
1046Sets the thread stack size (in bytes)\&. Append the letter
1047\fBk\fR
1048or
1049\fBK\fR
1050to indicate KB,
1051\fBm\fR
1052or
1053\fBM\fR
1054to indicate MB,
1055\fBg\fR
1056or
1057\fBG\fR
1058to indicate GB\&. The default value depends on the platform:
1059.sp
1060.RS 4
1061.ie n \{\
1062\h'-04'\(bu\h'+03'\c
1063.\}
1064.el \{\
1065.sp -1
1066.IP \(bu 2.3
1067.\}
1068Linux/ARM (32\-bit): 320 KB
1069.RE
1070.sp
1071.RS 4
1072.ie n \{\
1073\h'-04'\(bu\h'+03'\c
1074.\}
1075.el \{\
1076.sp -1
1077.IP \(bu 2.3
1078.\}
1079Linux/i386 (32\-bit): 320 KB
1080.RE
1081.sp
1082.RS 4
1083.ie n \{\
1084\h'-04'\(bu\h'+03'\c
1085.\}
1086.el \{\
1087.sp -1
1088.IP \(bu 2.3
1089.\}
1090Linux/x64 (64\-bit): 1024 KB
1091.RE
1092.sp
1093.RS 4
1094.ie n \{\
1095\h'-04'\(bu\h'+03'\c
1096.\}
1097.el \{\
1098.sp -1
1099.IP \(bu 2.3
1100.\}
1101OS X (64\-bit): 1024 KB
1102.RE
1103.sp
1104.RS 4
1105.ie n \{\
1106\h'-04'\(bu\h'+03'\c
1107.\}
1108.el \{\
1109.sp -1
1110.IP \(bu 2.3
1111.\}
1112Oracle Solaris/i386 (32\-bit): 320 KB
1113.RE
1114.sp
1115.RS 4
1116.ie n \{\
1117\h'-04'\(bu\h'+03'\c
1118.\}
1119.el \{\
1120.sp -1
1121.IP \(bu 2.3
1122.\}
1123Oracle Solaris/x64 (64\-bit): 1024 KB
1124.RE
1125.sp
rgallardb6435452013-11-25 20:19:02 -08001126The following examples set the thread stack size to 1024 KB in different units:
rgallardf71f2512015-02-02 10:12:21 -08001127.sp
1128.if n \{\
1129.RS 4
1130.\}
1131.nf
1132\fB\-Xss1m\fR
1133\fB\-Xss1024k\fR
1134\fB\-Xss1048576\fR
1135
1136.fi
1137.if n \{\
1138.RE
1139.\}
1140This option is equivalent to
1141\fB\-XX:ThreadStackSize\fR\&.
1142.RE
1143.PP
1144\-Xusealtsigs
1145.RS 4
1146Use alternative signals instead of
1147\fBSIGUSR1\fR
1148and
1149\fBSIGUSR2\fR
1150for JVM internal signals\&. This option is equivalent to
1151\fB\-XX:+UseAltSigs\fR\&.
1152.RE
1153.PP
1154\-Xverify:\fImode\fR
1155.RS 4
1156Sets the mode of the bytecode verifier\&. Bytecode verification helps to troubleshoot some problems, but it also adds overhead to the running application\&. Possible
1157\fImode\fR
1158arguments for this option include the following:
1159.PP
rgallardb6435452013-11-25 20:19:02 -08001160none
rgallardf71f2512015-02-02 10:12:21 -08001161.RS 4
rgallardb6435452013-11-25 20:19:02 -08001162Do not verify the bytecode\&. This reduces startup time and also reduces the protection provided by Java\&.
rgallardf71f2512015-02-02 10:12:21 -08001163.RE
1164.PP
rgallardb6435452013-11-25 20:19:02 -08001165remote
rgallardf71f2512015-02-02 10:12:21 -08001166.RS 4
1167Verify those classes that are not loaded by the bootstrap class loader\&. This is the default behavior if you do not specify the
1168\fB\-Xverify\fR
1169option\&.
1170.RE
1171.PP
rgallardb6435452013-11-25 20:19:02 -08001172all
rgallardf71f2512015-02-02 10:12:21 -08001173.RS 4
rgallardb6435452013-11-25 20:19:02 -08001174Verify all classes\&.
rgallardf71f2512015-02-02 10:12:21 -08001175.RE
1176.RE
1177.SS "Advanced Runtime Options"
1178.PP
rgallardb6435452013-11-25 20:19:02 -08001179These options control the runtime behavior of the Java HotSpot VM\&.
rgallardf71f2512015-02-02 10:12:21 -08001180.PP
1181\-XX:+CheckEndorsedAndExtDirs
1182.RS 4
1183Enables the option to prevent the
1184\fBjava\fR
1185command from running a Java application if it uses the endorsed\-standards override mechanism or the extension mechanism\&. This option checks if an application is using one of these mechanisms by checking the following:
1186.sp
1187.RS 4
1188.ie n \{\
1189\h'-04'\(bu\h'+03'\c
1190.\}
1191.el \{\
1192.sp -1
1193.IP \(bu 2.3
1194.\}
1195The
1196\fBjava\&.ext\&.dirs\fR
1197or
1198\fBjava\&.endorsed\&.dirs\fR
1199system property is set\&.
1200.RE
1201.sp
1202.RS 4
1203.ie n \{\
1204\h'-04'\(bu\h'+03'\c
1205.\}
1206.el \{\
1207.sp -1
1208.IP \(bu 2.3
1209.\}
1210The
1211\fBlib/endorsed\fR
1212directory exists and is not empty\&.
1213.RE
1214.sp
1215.RS 4
1216.ie n \{\
1217\h'-04'\(bu\h'+03'\c
1218.\}
1219.el \{\
1220.sp -1
1221.IP \(bu 2.3
1222.\}
1223The
1224\fBlib/ext\fR
1225directory contains any JAR files other than those of the JDK\&.
1226.RE
1227.sp
1228.RS 4
1229.ie n \{\
1230\h'-04'\(bu\h'+03'\c
1231.\}
1232.el \{\
1233.sp -1
1234.IP \(bu 2.3
1235.\}
1236The system\-wide platform\-specific extension directory contains any JAR files\&.
1237.RE
1238.RE
1239.PP
1240\-XX:+DisableAttachMechanism
1241.RS 4
1242Enables 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
1243\fBjcmd\fR,
1244\fBjstack\fR,
1245\fBjmap\fR, and
1246\fBjinfo\fR\&.
1247.RE
1248.PP
1249\-XX:ErrorFile=\fIfilename\fR
1250.RS 4
1251Specifies 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
1252\fBhs_err_pid\fR\fIpid\fR\fB\&.log\fR
1253where
1254\fIpid\fR
1255is 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
1256\fB%p\fR):
1257.sp
1258.if n \{\
1259.RS 4
1260.\}
1261.nf
1262\fB\-XX:ErrorFile=\&./hs_err_pid%p\&.log\fR
1263
1264.fi
1265.if n \{\
1266.RE
1267.\}
1268The following example shows how to set the error log to
1269\fB/var/log/java/java_error\&.log\fR:
1270.sp
1271.if n \{\
1272.RS 4
1273.\}
1274.nf
1275\fB\-XX:ErrorFile=/var/log/java/java_error\&.log\fR
1276
1277.fi
1278.if n \{\
1279.RE
1280.\}
1281If 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
1282\fB/tmp\fR\&.
1283.RE
1284.PP
1285\-XX:+FailOverToOldVerifier
1286.RS 4
rgallard36ba8532014-06-06 15:45:48 -07001287Enables 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\&.
rgallardf71f2512015-02-02 10:12:21 -08001288.RE
1289.PP
1290\-XX:LargePageSizeInBytes=\fIsize\fR
1291.RS 4
1292On Solaris, sets the maximum size (in bytes) for large pages used for Java heap\&. The
1293\fIsize\fR
1294argument must be a power of 2 (2, 4, 8, 16, \&.\&.\&.)\&. Append the letter
1295\fBk\fR
1296or
1297\fBK\fR
1298to indicate kilobytes,
1299\fBm\fR
1300or
1301\fBM\fR
1302to indicate megabytes,
1303\fBg\fR
1304or
1305\fBG\fR
1306to indicate gigabytes\&. By default, the size is set to 0, meaning that the JVM chooses the size for large pages automatically\&.
1307.sp
rgallardb6435452013-11-25 20:19:02 -08001308The following example illustrates how to set the large page size to 4 megabytes (MB):
rgallardf71f2512015-02-02 10:12:21 -08001309.sp
1310.if n \{\
1311.RS 4
1312.\}
1313.nf
1314\fB\-XX:LargePageSizeInBytes=4m\fR
1315
1316.fi
1317.if n \{\
1318.RE
1319.\}
1320.RE
1321.PP
1322\-XX:MaxDirectMemorySize=\fIsize\fR
1323.RS 4
1324Sets the maximum total size (in bytes) of the New I/O (the
1325\fBjava\&.nio\fR
1326package) direct\-buffer allocations\&. Append the letter
1327\fBk\fR
1328or
1329\fBK\fR
1330to indicate kilobytes,
1331\fBm\fR
1332or
1333\fBM\fR
1334to indicate megabytes,
1335\fBg\fR
1336or
1337\fBG\fR
1338to indicate gigabytes\&. By default, the size is set to 0, meaning that the JVM chooses the size for NIO direct\-buffer allocations automatically\&.
1339.sp
rgallardb6435452013-11-25 20:19:02 -08001340The following examples illustrate how to set the NIO size to 1024 KB in different units:
rgallardf71f2512015-02-02 10:12:21 -08001341.sp
1342.if n \{\
1343.RS 4
1344.\}
1345.nf
1346\fB\-XX:MaxDirectMemorySize=1m\fR
1347\fB\-XX:MaxDirectMemorySize=1024k\fR
1348\fB\-XX:MaxDirectMemorySize=1048576\fR
1349
1350.fi
1351.if n \{\
1352.RE
1353.\}
1354.RE
1355.PP
1356\-XX:NativeMemoryTracking=\fImode\fR
1357.RS 4
1358Specifies the mode for tracking JVM native memory usage\&. Possible
1359\fImode\fR
1360arguments for this option include the following:
1361.PP
rgallardb6435452013-11-25 20:19:02 -08001362off
rgallardf71f2512015-02-02 10:12:21 -08001363.RS 4
1364Do not track JVM native memory usage\&. This is the default behavior if you do not specify the
1365\fB\-XX:NativeMemoryTracking\fR
1366option\&.
1367.RE
1368.PP
rgallardb6435452013-11-25 20:19:02 -08001369summary
rgallardf71f2512015-02-02 10:12:21 -08001370.RS 4
rgallardb6435452013-11-25 20:19:02 -08001371Only track memory usage by JVM subsystems, such as Java heap, class, code, and thread\&.
rgallardf71f2512015-02-02 10:12:21 -08001372.RE
1373.PP
rgallardb6435452013-11-25 20:19:02 -08001374detail
rgallardf71f2512015-02-02 10:12:21 -08001375.RS 4
1376In addition to tracking memory usage by JVM subsystems, track memory usage by individual
1377\fBCallSite\fR, individual virtual memory region and its committed regions\&.
1378.RE
1379.RE
1380.PP
1381\-XX:ObjectAlignmentInBytes=\fIalignment\fR
1382.RS 4
rgallard04b0ca42014-10-17 11:33:22 -07001383Sets the memory alignment of Java objects (in bytes)\&. By default, the value is set to 8 bytes\&. The specified value should be a power of two, and must be within the range of 8 and 256 (inclusive)\&. This option makes it possible to use compressed pointers with large Java heap sizes\&.
rgallardf71f2512015-02-02 10:12:21 -08001384.sp
rgallard04b0ca42014-10-17 11:33:22 -07001385The heap size limit in bytes is calculated as:
rgallardf71f2512015-02-02 10:12:21 -08001386.sp
1387\fB4GB * ObjectAlignmentInBytes\fR
1388.sp
rgallard04b0ca42014-10-17 11:33:22 -07001389Note: As the alignment value increases, the unused space between objects will also increase\&. As a result, you may not realize any benefits from using compressed pointers with large Java heap sizes\&.
rgallardf71f2512015-02-02 10:12:21 -08001390.RE
1391.PP
1392\-XX:OnError=\fIstring\fR
1393.RS 4
1394Sets 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\&.
1395.sp
1396The following example shows how the
1397\fB\-XX:OnError\fR
1398option can be used to run the
1399\fBgcore\fR
1400command to create the core image, and the debugger is started to attach to the process in case of an irrecoverable error (the
1401\fB%p\fR
1402designates the current process):
1403.sp
1404.if n \{\
1405.RS 4
1406.\}
1407.nf
1408\fB\-XX:OnError="gcore %p;dbx \- %p"\fR
1409
1410.fi
1411.if n \{\
1412.RE
1413.\}
1414.RE
1415.PP
1416\-XX:OnOutOfMemoryError=\fIstring\fR
1417.RS 4
1418Sets a custom command or a series of semicolon\-separated commands to run when an
1419\fBOutOfMemoryError\fR
1420exception 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
1421\fB\-XX:OnError\fR
1422option\&.
1423.RE
1424.PP
1425\-XX:+PerfDataSaveToFile
1426.RS 4
1427If enabled, saves
1428jstat(1) binary data when the Java application exits\&. This binary data is saved in a file named
1429\fBhsperfdata_\fR\fI<pid>\fR, where
1430\fI<pid>\fR
1431is the process identifier of the Java application you ran\&. Use
1432\fBjstat\fR
1433to display the performance data contained in this file as follows:
1434.sp
1435.if n \{\
1436.RS 4
1437.\}
1438.nf
1439\fBjstat \-class file:///\fR\fB\fI<path>\fR\fR\fB/hsperfdata_\fR\fB\fI<pid>\fR\fR
1440\fBjstat \-gc file:///\fR\fB\fI<path>\fR\fR\fB/hsperfdata_\fR\fB\fI<pid>\fR\fR
1441.fi
1442.if n \{\
1443.RE
1444.\}
1445.RE
1446.PP
1447\-XX:+PrintCommandLineFlags
1448.RS 4
rgallardb6435452013-11-25 20:19:02 -08001449Enables 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\&.
rgallardf71f2512015-02-02 10:12:21 -08001450.RE
1451.PP
1452\-XX:+PrintNMTStatistics
1453.RS 4
1454Enables printing of collected native memory tracking data at JVM exit when native memory tracking is enabled (see
1455\fB\-XX:NativeMemoryTracking\fR)\&. By default, this option is disabled and native memory tracking data is not printed\&.
1456.RE
1457.PP
1458\-XX:+RelaxAccessControlCheck
1459.RS 4
rgallard36ba8532014-06-06 15:45:48 -07001460Decreases 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\&.
rgallardf71f2512015-02-02 10:12:21 -08001461.RE
1462.PP
1463\-XX:+ShowMessageBoxOnError
1464.RS 4
rgallardb6435452013-11-25 20:19:02 -08001465Enables 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\&.
rgallardf71f2512015-02-02 10:12:21 -08001466.RE
1467.PP
1468\-XX:ThreadStackSize=\fIsize\fR
1469.RS 4
1470Sets the thread stack size (in bytes)\&. Append the letter
1471\fBk\fR
1472or
1473\fBK\fR
1474to indicate kilobytes,
1475\fBm\fR
1476or
1477\fBM\fR
1478to indicate megabytes,
1479\fBg\fR
1480or
1481\fBG\fR
1482to indicate gigabytes\&. The default value depends on the platform:
1483.sp
1484.RS 4
1485.ie n \{\
1486\h'-04'\(bu\h'+03'\c
1487.\}
1488.el \{\
1489.sp -1
1490.IP \(bu 2.3
1491.\}
1492Linux/ARM (32\-bit): 320 KB
1493.RE
1494.sp
1495.RS 4
1496.ie n \{\
1497\h'-04'\(bu\h'+03'\c
1498.\}
1499.el \{\
1500.sp -1
1501.IP \(bu 2.3
1502.\}
1503Linux/i386 (32\-bit): 320 KB
1504.RE
1505.sp
1506.RS 4
1507.ie n \{\
1508\h'-04'\(bu\h'+03'\c
1509.\}
1510.el \{\
1511.sp -1
1512.IP \(bu 2.3
1513.\}
1514Linux/x64 (64\-bit): 1024 KB
1515.RE
1516.sp
1517.RS 4
1518.ie n \{\
1519\h'-04'\(bu\h'+03'\c
1520.\}
1521.el \{\
1522.sp -1
1523.IP \(bu 2.3
1524.\}
1525OS X (64\-bit): 1024 KB
1526.RE
1527.sp
1528.RS 4
1529.ie n \{\
1530\h'-04'\(bu\h'+03'\c
1531.\}
1532.el \{\
1533.sp -1
1534.IP \(bu 2.3
1535.\}
1536Oracle Solaris/i386 (32\-bit): 320 KB
1537.RE
1538.sp
1539.RS 4
1540.ie n \{\
1541\h'-04'\(bu\h'+03'\c
1542.\}
1543.el \{\
1544.sp -1
1545.IP \(bu 2.3
1546.\}
1547Oracle Solaris/x64 (64\-bit): 1024 KB
1548.RE
1549.sp
rgallardb6435452013-11-25 20:19:02 -08001550The following examples show how to set the thread stack size to 1024 KB in different units:
rgallardf71f2512015-02-02 10:12:21 -08001551.sp
1552.if n \{\
1553.RS 4
1554.\}
1555.nf
1556\fB\-XX:ThreadStackSize=1m\fR
1557\fB\-XX:ThreadStackSize=1024k\fR
1558\fB\-XX:ThreadStackSize=1048576\fR
1559
1560.fi
1561.if n \{\
1562.RE
1563.\}
1564This option is equivalent to
1565\fB\-Xss\fR\&.
1566.RE
1567.PP
1568\-XX:+TraceClassLoading
1569.RS 4
rgallardb6435452013-11-25 20:19:02 -08001570Enables tracing of classes as they are loaded\&. By default, this option is disabled and classes are not traced\&.
rgallardf71f2512015-02-02 10:12:21 -08001571.RE
1572.PP
1573\-XX:+TraceClassLoadingPreorder
1574.RS 4
rgallardb6435452013-11-25 20:19:02 -08001575Enables tracing of all loaded classes in the order in which they are referenced\&. By default, this option is disabled and classes are not traced\&.
rgallardf71f2512015-02-02 10:12:21 -08001576.RE
1577.PP
1578\-XX:+TraceClassResolution
1579.RS 4
rgallardb6435452013-11-25 20:19:02 -08001580Enables tracing of constant pool resolutions\&. By default, this option is disabled and constant pool resolutions are not traced\&.
rgallardf71f2512015-02-02 10:12:21 -08001581.RE
1582.PP
1583\-XX:+TraceClassUnloading
1584.RS 4
rgallardb6435452013-11-25 20:19:02 -08001585Enables tracing of classes as they are unloaded\&. By default, this option is disabled and classes are not traced\&.
rgallardf71f2512015-02-02 10:12:21 -08001586.RE
1587.PP
1588\-XX:+TraceLoaderConstraints
1589.RS 4
rgallard36ba8532014-06-06 15:45:48 -07001590Enables tracing of the loader constraints recording\&. By default, this option is disabled and loader constraints recording is not traced\&.
rgallardf71f2512015-02-02 10:12:21 -08001591.RE
1592.PP
1593\-XX:+UseAltSigs
1594.RS 4
1595Enables the use of alternative signals instead of
1596\fBSIGUSR1\fR
1597and
1598\fBSIGUSR2\fR
1599for JVM internal signals\&. By default, this option is disabled and alternative signals are not used\&. This option is equivalent to
1600\fB\-Xusealtsigs\fR\&.
1601.RE
1602.PP
1603\-XX:\-UseBiasedLocking
1604.RS 4
1605Disables 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
1606.sp
rgallard36ba8532014-06-06 15:45:48 -07001607By default, this option is enabled\&.
rgallardf71f2512015-02-02 10:12:21 -08001608.RE
1609.PP
1610\-XX:\-UseCompressedOops
1611.RS 4
1612Disables the use of compressed pointers\&. By default, this option is enabled, and compressed pointers are used when Java heap sizes are less than 32 GB\&. When this option is enabled, object references are represented as 32\-bit offsets instead of 64\-bit pointers, which typically increases performance when running the application with Java heap sizes less than 32 GB\&. This option works only for 64\-bit JVMs\&.
1613.sp
1614It is also possible to use compressed pointers when Java heap sizes are greater than 32GB\&. See the
1615\fB\-XX:ObjectAlignmentInBytes\fR
1616option\&.
1617.RE
1618.PP
1619\-XX:+UseHugeTLBFS
1620.RS 4
1621This option for Linux is the equivalent of specifying
1622\fB\-XX:+UseLargePages\fR\&. This option is disabled by default\&. This option pre\-allocates all large pages up\-front, when memory is reserved; consequently the JVM cannot dynamically grow or shrink large pages memory areas; see
1623\fB\-XX:UseTransparentHugePages\fR
1624if you want this behavior\&.
1625.sp
1626For more information, see "Large Pages"\&.
1627.RE
1628.PP
1629\-XX:+UseLargePages
1630.RS 4
rgallard04b0ca42014-10-17 11:33:22 -07001631Enables the use of large page memory\&. By default, this option is disabled and large page memory is not used\&.
rgallardf71f2512015-02-02 10:12:21 -08001632.sp
1633For more information, see "Large Pages"\&.
1634.RE
1635.PP
1636\-XX:+UseMembar
1637.RS 4
rgallard36ba8532014-06-06 15:45:48 -07001638Enables issuing of membars on thread state transitions\&. This option is disabled by default on all platforms except ARM servers, where it is enabled\&. (It is recommended that you do not disable this option on ARM servers\&.)
rgallardf71f2512015-02-02 10:12:21 -08001639.RE
1640.PP
1641\-XX:+UsePerfData
1642.RS 4
1643Enables the
1644\fBperfdata\fR
1645feature\&. This option is enabled by default to allow JVM monitoring and performance testing\&. Disabling it suppresses the creation of the
1646\fBhsperfdata_userid\fR
1647directories\&. To disable the
1648\fBperfdata\fR
1649feature, specify
1650\fB\-XX:\-UsePerfData\fR\&.
1651.RE
1652.PP
1653\-XX:+UseTransparentHugePages
1654.RS 4
rgallard04b0ca42014-10-17 11:33:22 -07001655On Linux, enables the use of large pages that can dynamically grow or shrink\&. This option is disabled by default\&. You may encounter performance problems with transparent huge pages as the OS moves other pages around to create huge pages; this option is made available for experimentation\&.
rgallardf71f2512015-02-02 10:12:21 -08001656.sp
1657For more information, see "Large Pages"\&.
1658.RE
1659.PP
1660\-XX:+AllowUserSignalHandlers
1661.RS 4
rgallardb6435452013-11-25 20:19:02 -08001662Enables installation of signal handlers by the application\&. By default, this option is disabled and the application is not allowed to install signal handlers\&.
rgallardf71f2512015-02-02 10:12:21 -08001663.RE
1664.SS "Advanced JIT Compiler Options"
1665.PP
1666These options control the dynamic just\-in\-time (JIT) compilation performed by the Java HotSpot VM\&.
1667.PP
1668\-XX:+AggressiveOpts
1669.RS 4
rgallardb6435452013-11-25 20:19:02 -08001670Enables 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\&.
rgallardf71f2512015-02-02 10:12:21 -08001671.RE
1672.PP
1673\-XX:AllocateInstancePrefetchLines=\fIlines\fR
1674.RS 4
rgallardb6435452013-11-25 20:19:02 -08001675Sets the number of lines to prefetch ahead of the instance allocation pointer\&. By default, the number of lines to prefetch is set to 1:
rgallardf71f2512015-02-02 10:12:21 -08001676.sp
1677.if n \{\
1678.RS 4
1679.\}
1680.nf
1681\fB\-XX:AllocateInstancePrefetchLines=1\fR
1682
1683.fi
1684.if n \{\
1685.RE
1686.\}
rgallard36ba8532014-06-06 15:45:48 -07001687Only the Java HotSpot Server VM supports this option\&.
rgallardf71f2512015-02-02 10:12:21 -08001688.RE
1689.PP
1690\-XX:AllocatePrefetchDistance=\fIsize\fR
1691.RS 4
rgallardb6435452013-11-25 20:19:02 -08001692Sets 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\&.
rgallardf71f2512015-02-02 10:12:21 -08001693.sp
1694Negative values denote that prefetch distance is chosen based on the platform\&. Positive values are bytes to prefetch\&. Append the letter
1695\fBk\fR
1696or
1697\fBK\fR
1698to indicate kilobytes,
1699\fBm\fR
1700or
1701\fBM\fR
1702to indicate megabytes,
1703\fBg\fR
1704or
1705\fBG\fR
1706to indicate gigabytes\&. The default value is set to \-1\&.
1707.sp
rgallardb6435452013-11-25 20:19:02 -08001708The following example shows how to set the prefetch distance to 1024 bytes:
rgallardf71f2512015-02-02 10:12:21 -08001709.sp
1710.if n \{\
1711.RS 4
1712.\}
1713.nf
1714\fB\-XX:AllocatePrefetchDistance=1024\fR
1715
1716.fi
1717.if n \{\
1718.RE
1719.\}
rgallard36ba8532014-06-06 15:45:48 -07001720Only the Java HotSpot Server VM supports this option\&.
rgallardf71f2512015-02-02 10:12:21 -08001721.RE
1722.PP
1723\-XX:AllocatePrefetchInstr=\fIinstruction\fR
1724.RS 4
rgallard36ba8532014-06-06 15:45:48 -07001725Sets the prefetch instruction to prefetch ahead of the allocation pointer\&. Only the Java HotSpot Server VM supports this option\&. Possible values are from 0 to 3\&. The actual instructions behind the values depend on the platform\&. By default, the prefetch instruction is set to 0:
rgallardf71f2512015-02-02 10:12:21 -08001726.sp
1727.if n \{\
1728.RS 4
1729.\}
1730.nf
1731\fB\-XX:AllocatePrefetchInstr=0\fR
1732
1733.fi
1734.if n \{\
1735.RE
1736.\}
rgallard36ba8532014-06-06 15:45:48 -07001737Only the Java HotSpot Server VM supports this option\&.
rgallardf71f2512015-02-02 10:12:21 -08001738.RE
1739.PP
1740\-XX:AllocatePrefetchLines=\fIlines\fR
1741.RS 4
rgallardb6435452013-11-25 20:19:02 -08001742Sets 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\&.
rgallardf71f2512015-02-02 10:12:21 -08001743.sp
rgallardb6435452013-11-25 20:19:02 -08001744The following example shows how to set the number of loaded cache lines to 5:
rgallardf71f2512015-02-02 10:12:21 -08001745.sp
1746.if n \{\
1747.RS 4
1748.\}
1749.nf
1750\fB\-XX:AllocatePrefetchLines=5\fR
1751
1752.fi
1753.if n \{\
1754.RE
1755.\}
rgallard36ba8532014-06-06 15:45:48 -07001756Only the Java HotSpot Server VM supports this option\&.
rgallardf71f2512015-02-02 10:12:21 -08001757.RE
1758.PP
1759\-XX:AllocatePrefetchStepSize=\fIsize\fR
1760.RS 4
1761Sets the step size (in bytes) for sequential prefetch instructions\&. Append the letter
1762\fBk\fR
1763or
1764\fBK\fR
1765to indicate kilobytes,
1766\fBm\fR
1767or
1768\fBM\fR
1769to indicate megabytes,
1770\fBg\fR
1771or
1772\fBG\fR
1773to indicate gigabytes\&. By default, the step size is set to 16 bytes:
1774.sp
1775.if n \{\
1776.RS 4
1777.\}
1778.nf
1779\fB\-XX:AllocatePrefetchStepSize=16\fR
1780
1781.fi
1782.if n \{\
1783.RE
1784.\}
rgallard36ba8532014-06-06 15:45:48 -07001785Only the Java HotSpot Server VM supports this option\&.
rgallardf71f2512015-02-02 10:12:21 -08001786.RE
1787.PP
1788\-XX:AllocatePrefetchStyle=\fIstyle\fR
1789.RS 4
1790Sets the generated code style for prefetch instructions\&. The
1791\fIstyle\fR
1792argument is an integer from 0 to 3:
1793.PP
rgallardb6435452013-11-25 20:19:02 -080017940
rgallardf71f2512015-02-02 10:12:21 -08001795.RS 4
rgallardb6435452013-11-25 20:19:02 -08001796Do not generate prefetch instructions\&.
rgallardf71f2512015-02-02 10:12:21 -08001797.RE
1798.PP
rgallardb6435452013-11-25 20:19:02 -080017991
rgallardf71f2512015-02-02 10:12:21 -08001800.RS 4
rgallardb6435452013-11-25 20:19:02 -08001801Execute prefetch instructions after each allocation\&. This is the default parameter\&.
rgallardf71f2512015-02-02 10:12:21 -08001802.RE
1803.PP
rgallardb6435452013-11-25 20:19:02 -080018042
rgallardf71f2512015-02-02 10:12:21 -08001805.RS 4
1806Use the thread\-local allocation block (TLAB) watermark pointer to determine when prefetch instructions are executed\&.
1807.RE
1808.PP
rgallardb6435452013-11-25 20:19:02 -080018093
rgallardf71f2512015-02-02 10:12:21 -08001810.RS 4
rgallardb6435452013-11-25 20:19:02 -08001811Use BIS instruction on SPARC for allocation prefetch\&.
rgallardf71f2512015-02-02 10:12:21 -08001812.RE
1813.sp
rgallard36ba8532014-06-06 15:45:48 -07001814Only the Java HotSpot Server VM supports this option\&.
rgallardf71f2512015-02-02 10:12:21 -08001815.RE
1816.PP
1817\-XX:+BackgroundCompilation
1818.RS 4
1819Enables background compilation\&. This option is enabled by default\&. To disable background compilation, specify
1820\fB\-XX:\-BackgroundCompilation\fR
1821(this is equivalent to specifying
1822\fB\-Xbatch\fR)\&.
1823.RE
1824.PP
1825\-XX:CICompilerCount=\fIthreads\fR
1826.RS 4
rgallard36ba8532014-06-06 15:45:48 -07001827Sets 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:
rgallardf71f2512015-02-02 10:12:21 -08001828.sp
1829.if n \{\
1830.RS 4
1831.\}
1832.nf
1833\fB\-XX:CICompilerCount=2\fR
1834
1835.fi
1836.if n \{\
1837.RE
1838.\}
1839.RE
1840.PP
1841\-XX:CodeCacheMinimumFreeSpace=\fIsize\fR
1842.RS 4
1843Sets the minimum free space (in bytes) required for compilation\&. Append the letter
1844\fBk\fR
1845or
1846\fBK\fR
1847to indicate kilobytes,
1848\fBm\fR
1849or
1850\fBM\fR
1851to indicate megabytes,
1852\fBg\fR
1853or
1854\fBG\fR
1855to 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:
1856.sp
1857.if n \{\
1858.RS 4
1859.\}
1860.nf
1861\fB\-XX:CodeCacheMinimumFreeSpace=1024m\fR
1862
1863.fi
1864.if n \{\
1865.RE
1866.\}
1867.RE
1868.PP
1869\-XX:CompileCommand=\fIcommand\fR,\fImethod\fR[,\fIoption\fR]
1870.RS 4
1871Specifies a command to perform on a method\&. For example, to exclude the
1872\fBindexOf()\fR
1873method of the
1874\fBString\fR
1875class from being compiled, use the following:
1876.sp
1877.if n \{\
1878.RS 4
1879.\}
1880.nf
1881\fB\-XX:CompileCommand=exclude,java/lang/String\&.indexOf\fR
1882
1883.fi
1884.if n \{\
1885.RE
1886.\}
1887Note that the full class name is specified, including all packages and subpackages separated by a slash (\fB/\fR)\&. For easier cut and paste operations, it is also possible to use the method name format produced by the
1888\fB\-XX:+PrintCompilation\fR
1889and
1890\fB\-XX:+LogCompilation\fR
1891options:
1892.sp
1893.if n \{\
1894.RS 4
1895.\}
1896.nf
1897\fB\-XX:CompileCommand=exclude,java\&.lang\&.String::indexOf\fR
1898
1899.fi
1900.if n \{\
1901.RE
1902.\}
1903If 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
1904\fBindexOf(String)\fR
1905method of the
1906\fBString\fR
1907class from being compiled, use the following:
1908.sp
1909.if n \{\
1910.RS 4
1911.\}
1912.nf
1913\fB\-XX:CompileCommand="exclude,java/lang/String\&.indexOf,(Ljava/lang/String;)I"\fR
1914
1915.fi
1916.if n \{\
1917.RE
1918.\}
1919You can also use the asterisk (*) as a wildcard for class and method names\&. For example, to exclude all
1920\fBindexOf()\fR
1921methods in all classes from being compiled, use the following:
1922.sp
1923.if n \{\
1924.RS 4
1925.\}
1926.nf
1927\fB\-XX:CompileCommand=exclude,*\&.indexOf\fR
1928
1929.fi
1930.if n \{\
1931.RE
1932.\}
1933The commas and periods are aliases for spaces, making it easier to pass compiler commands through a shell\&. You can pass arguments to
1934\fB\-XX:CompileCommand\fR
1935using spaces as separators by enclosing the argument in quotation marks:
1936.sp
1937.if n \{\
1938.RS 4
1939.\}
1940.nf
1941\fB\-XX:CompileCommand="exclude java/lang/String indexOf"\fR
1942
1943.fi
1944.if n \{\
1945.RE
1946.\}
1947Note that after parsing the commands passed on the command line using the
1948\fB\-XX:CompileCommand\fR
1949options, the JIT compiler then reads commands from the
1950\fB\&.hotspot_compiler\fR
1951file\&. You can add commands to this file or specify a different file using the
1952\fB\-XX:CompileCommandFile\fR
1953option\&.
1954.sp
1955To add several commands, either specify the
1956\fB\-XX:CompileCommand\fR
1957option multiple times, or separate each argument with the newline separator (\fB\en\fR)\&. The following commands are available:
1958.PP
rgallard36ba8532014-06-06 15:45:48 -07001959break
rgallardf71f2512015-02-02 10:12:21 -08001960.RS 4
rgallard36ba8532014-06-06 15:45:48 -07001961Set a breakpoint when debugging the JVM to stop at the beginning of compilation of the specified method\&.
rgallardf71f2512015-02-02 10:12:21 -08001962.RE
1963.PP
rgallard36ba8532014-06-06 15:45:48 -07001964compileonly
rgallardf71f2512015-02-02 10:12:21 -08001965.RS 4
1966Exclude all methods from compilation except for the specified method\&. As an alternative, you can use the
1967\fB\-XX:CompileOnly\fR
1968option, which allows to specify several methods\&.
1969.RE
1970.PP
rgallard36ba8532014-06-06 15:45:48 -07001971dontinline
rgallardf71f2512015-02-02 10:12:21 -08001972.RS 4
rgallard36ba8532014-06-06 15:45:48 -07001973Prevent inlining of the specified method\&.
rgallardf71f2512015-02-02 10:12:21 -08001974.RE
1975.PP
rgallard36ba8532014-06-06 15:45:48 -07001976exclude
rgallardf71f2512015-02-02 10:12:21 -08001977.RS 4
rgallard36ba8532014-06-06 15:45:48 -07001978Exclude the specified method from compilation\&.
rgallardf71f2512015-02-02 10:12:21 -08001979.RE
1980.PP
rgallard36ba8532014-06-06 15:45:48 -07001981help
rgallardf71f2512015-02-02 10:12:21 -08001982.RS 4
1983Print a help message for the
1984\fB\-XX:CompileCommand\fR
1985option\&.
1986.RE
1987.PP
rgallard36ba8532014-06-06 15:45:48 -07001988inline
rgallardf71f2512015-02-02 10:12:21 -08001989.RS 4
rgallard36ba8532014-06-06 15:45:48 -07001990Attempt to inline the specified method\&.
rgallardf71f2512015-02-02 10:12:21 -08001991.RE
1992.PP
rgallard36ba8532014-06-06 15:45:48 -07001993log
rgallardf71f2512015-02-02 10:12:21 -08001994.RS 4
1995Exclude compilation logging (with the
1996\fB\-XX:+LogCompilation\fR
1997option) for all methods except for the specified method\&. By default, logging is performed for all compiled methods\&.
1998.RE
1999.PP
rgallard36ba8532014-06-06 15:45:48 -07002000option
rgallardf71f2512015-02-02 10:12:21 -08002001.RS 4
2002This 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
2003\fBBlockLayoutByFrequency\fR
2004option for the
2005\fBappend()\fR
2006method of the
2007\fBStringBuffer\fR
2008class, use the following:
2009.sp
2010.if n \{\
2011.RS 4
2012.\}
2013.nf
2014\fB\-XX:CompileCommand=option,java/lang/StringBuffer\&.append,BlockLayoutByFrequency\fR
2015
2016.fi
2017.if n \{\
2018.RE
2019.\}
rgallard36ba8532014-06-06 15:45:48 -07002020You can specify multiple compilation options, separated by commas or spaces\&.
rgallardf71f2512015-02-02 10:12:21 -08002021.RE
2022.PP
rgallard36ba8532014-06-06 15:45:48 -07002023print
rgallardf71f2512015-02-02 10:12:21 -08002024.RS 4
rgallard36ba8532014-06-06 15:45:48 -07002025Print generated assembler code after compilation of the specified method\&.
rgallardf71f2512015-02-02 10:12:21 -08002026.RE
2027.PP
rgallard36ba8532014-06-06 15:45:48 -07002028quiet
rgallardf71f2512015-02-02 10:12:21 -08002029.RS 4
2030Do not print the compile commands\&. By default, the commands that you specify with the \-\fBXX:CompileCommand\fR
2031option are printed; for example, if you exclude from compilation the
2032\fBindexOf()\fR
2033method of the
2034\fBString\fR
2035class, then the following will be printed to standard output:
2036.sp
2037.if n \{\
2038.RS 4
2039.\}
2040.nf
2041\fBCompilerOracle: exclude java/lang/String\&.indexOf\fR
2042
2043.fi
2044.if n \{\
2045.RE
2046.\}
2047You can suppress this by specifying the
2048\fB\-XX:CompileCommand=quiet\fR
2049option before other
2050\fB\-XX:CompileCommand\fR
2051options\&.
2052.RE
2053.RE
2054.PP
2055\-XX:CompileCommandFile=\fIfilename\fR
2056.RS 4
2057Sets the file from which JIT compiler commands are read\&. By default, the
2058\fB\&.hotspot_compiler\fR
2059file is used to store commands performed by the JIT compiler\&.
2060.sp
2061Each 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
2062\fBtoString()\fR
2063method of the
2064\fBString\fR
2065class:
2066.sp
2067.if n \{\
2068.RS 4
2069.\}
2070.nf
2071\fBprint java/lang/String toString\fR
2072
2073.fi
2074.if n \{\
2075.RE
2076.\}
2077For more information about specifying the commands for the JIT compiler to perform on methods, see the
2078\fB\-XX:CompileCommand\fR
2079option\&.
2080.RE
2081.PP
2082\-XX:CompileOnly=\fImethods\fR
2083.RS 4
2084Sets 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
2085\fBlength()\fR
2086method of the
2087\fBString\fR
2088class and the
2089\fBsize()\fR
2090method of the
2091\fBList\fR
2092class, use the following:
2093.sp
2094.if n \{\
2095.RS 4
2096.\}
2097.nf
2098\fB\-XX:CompileOnly=java/lang/String\&.length,java/util/List\&.size\fR
2099
2100.fi
2101.if n \{\
2102.RE
2103.\}
2104Note that the full class name is specified, including all packages and subpackages separated by a slash (\fB/\fR)\&. For easier cut and paste operations, it is also possible to use the method name format produced by the
2105\fB\-XX:+PrintCompilation\fR
2106and
2107\fB\-XX:+LogCompilation\fR
2108options:
2109.sp
2110.if n \{\
2111.RS 4
2112.\}
2113.nf
2114\fB\-XX:CompileOnly=java\&.lang\&.String::length,java\&.util\&.List::size\fR
2115
2116.fi
2117.if n \{\
2118.RE
2119.\}
rgallard36ba8532014-06-06 15:45:48 -07002120Although 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:
rgallardf71f2512015-02-02 10:12:21 -08002121.sp
2122.if n \{\
2123.RS 4
2124.\}
2125.nf
2126\fB\-XX:CompileOnly=java/lang/String\fR
2127\fB\-XX:CompileOnly=java/lang\fR
2128\fB\-XX:CompileOnly=\&.length\fR
2129
2130.fi
2131.if n \{\
2132.RE
2133.\}
2134.RE
2135.PP
2136\-XX:CompileThreshold=\fIinvocations\fR
2137.RS 4
2138Sets the number of interpreted method invocations before compilation\&. By default, in the server JVM, the JIT compiler performs 10,000 interpreted method invocations to gather information for efficient compilation\&. For the client JVM, the default setting is 1,500 invocations\&. This option is ignored when tiered compilation is enabled; see the option
2139\fB\-XX:+TieredCompilation\fR\&. The following example shows how to set the number of interpreted method invocations to 5,000:
2140.sp
2141.if n \{\
2142.RS 4
2143.\}
2144.nf
2145\fB\-XX:CompileThreshold=5000\fR
2146
2147.fi
2148.if n \{\
2149.RE
2150.\}
2151You can completely disable interpretation of Java methods before compilation by specifying the
2152\fB\-Xcomp\fR
2153option\&.
2154.RE
2155.PP
2156\-XX:+DoEscapeAnalysis
2157.RS 4
2158Enables the use of escape analysis\&. This option is enabled by default\&. To disable the use of escape analysis, specify
2159\fB\-XX:\-DoEscapeAnalysis\fR\&. Only the Java HotSpot Server VM supports this option\&.
2160.RE
2161.PP
2162\-XX:InitialCodeCacheSize=\fIsize\fR
2163.RS 4
2164Sets the initial code cache size (in bytes)\&. Append the letter
2165\fBk\fR
2166or
2167\fBK\fR
2168to indicate kilobytes,
2169\fBm\fR
2170or
2171\fBM\fR
2172to indicate megabytes,
2173\fBg\fR
2174or
2175\fBG\fR
2176to indicate gigabytes\&. The default value is set to 500 KB\&. The initial code cache size should be not less than the system\*(Aqs minimal memory page size\&. The following example shows how to set the initial code cache size to 32 KB:
2177.sp
2178.if n \{\
2179.RS 4
2180.\}
2181.nf
2182\fB\-XX:InitialCodeCacheSize=32k\fR
2183
2184.fi
2185.if n \{\
2186.RE
2187.\}
2188.RE
2189.PP
2190\-XX:+Inline
2191.RS 4
2192Enables method inlining\&. This option is enabled by default to increase performance\&. To disable method inlining, specify
2193\fB\-XX:\-Inline\fR\&.
2194.RE
2195.PP
2196\-XX:InlineSmallCode=\fIsize\fR
2197.RS 4
2198Sets the maximum code size (in bytes) for compiled methods that should be inlined\&. Append the letter
2199\fBk\fR
2200or
2201\fBK\fR
2202to indicate kilobytes,
2203\fBm\fR
2204or
2205\fBM\fR
2206to indicate megabytes,
2207\fBg\fR
2208or
2209\fBG\fR
2210to 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:
2211.sp
2212.if n \{\
2213.RS 4
2214.\}
2215.nf
2216\fB\-XX:InlineSmallCode=1000\fR
2217
2218.fi
2219.if n \{\
2220.RE
2221.\}
2222.RE
2223.PP
2224\-XX:+LogCompilation
2225.RS 4
2226Enables logging of compilation activity to a file named
2227\fBhotspot\&.log\fR
2228in the current working directory\&. You can specify a different log file path and name using the
2229\fB\-XX:LogFile\fR
2230option\&.
2231.sp
2232By default, this option is disabled and compilation activity is not logged\&. The
2233\fB\-XX:+LogCompilation\fR
2234option has to be used together with the
2235\fB\-XX:UnlockDiagnosticVMOptions\fR
2236option that unlocks diagnostic JVM options\&.
2237.sp
2238You can enable verbose diagnostic output with a message printed to the console every time a method is compiled by using the
2239\fB\-XX:+PrintCompilation\fR
2240option\&.
2241.RE
2242.PP
2243\-XX:MaxInlineSize=\fIsize\fR
2244.RS 4
2245Sets the maximum bytecode size (in bytes) of a method to be inlined\&. Append the letter
2246\fBk\fR
2247or
2248\fBK\fR
2249to indicate kilobytes,
2250\fBm\fR
2251or
2252\fBM\fR
2253to indicate megabytes,
2254\fBg\fR
2255or
2256\fBG\fR
2257to indicate gigabytes\&. By default, the maximum bytecode size is set to 35 bytes:
2258.sp
2259.if n \{\
2260.RS 4
2261.\}
2262.nf
2263\fB\-XX:MaxInlineSize=35\fR
2264
2265.fi
2266.if n \{\
2267.RE
2268.\}
2269.RE
2270.PP
2271\-XX:MaxNodeLimit=\fInodes\fR
2272.RS 4
rgallard36ba8532014-06-06 15:45:48 -07002273Sets the maximum number of nodes to be used during single method compilation\&. By default, the maximum number of nodes is set to 65,000:
rgallardf71f2512015-02-02 10:12:21 -08002274.sp
2275.if n \{\
2276.RS 4
2277.\}
2278.nf
2279\fB\-XX:MaxNodeLimit=65000\fR
2280
2281.fi
2282.if n \{\
2283.RE
2284.\}
2285.RE
2286.PP
2287\-XX:MaxTrivialSize=\fIsize\fR
2288.RS 4
2289Sets the maximum bytecode size (in bytes) of a trivial method to be inlined\&. Append the letter
2290\fBk\fR
2291or
2292\fBK\fR
2293to indicate kilobytes,
2294\fBm\fR
2295or
2296\fBM\fR
2297to indicate megabytes,
2298\fBg\fR
2299or
2300\fBG\fR
2301to indicate gigabytes\&. By default, the maximum bytecode size of a trivial method is set to 6 bytes:
2302.sp
2303.if n \{\
2304.RS 4
2305.\}
2306.nf
2307\fB\-XX:MaxTrivialSize=6\fR
2308
2309.fi
2310.if n \{\
2311.RE
2312.\}
2313.RE
2314.PP
2315\-XX:+OptimizeStringConcat
2316.RS 4
2317Enables the optimization of
2318\fBString\fR
2319concatenation operations\&. This option is enabled by default\&. To disable the optimization of
2320\fBString\fR
2321concatenation operations, specify
2322\fB\-XX:\-OptimizeStringConcat\fR\&. Only the Java HotSpot Server VM supports this option\&.
2323.RE
2324.PP
2325\-XX:+PrintAssembly
2326.RS 4
2327Enables printing of assembly code for bytecoded and native methods by using the external
2328\fBdisassembler\&.so\fR
2329library\&. This enables you to see the generated code, which may help you to diagnose performance issues\&.
2330.sp
2331By default, this option is disabled and assembly code is not printed\&. The
2332\fB\-XX:+PrintAssembly\fR
2333option has to be used together with the
2334\fB\-XX:UnlockDiagnosticVMOptions\fR
2335option that unlocks diagnostic JVM options\&.
2336.RE
2337.PP
2338\-XX:+PrintCompilation
2339.RS 4
rgallard36ba8532014-06-06 15:45:48 -07002340Enables 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\&.
rgallardf71f2512015-02-02 10:12:21 -08002341.sp
2342You can also log compilation activity to a file by using the
2343\fB\-XX:+LogCompilation\fR
2344option\&.
2345.RE
2346.PP
2347\-XX:+PrintInlining
2348.RS 4
rgallard36ba8532014-06-06 15:45:48 -07002349Enables printing of inlining decisions\&. This enables you to see which methods are getting inlined\&.
rgallardf71f2512015-02-02 10:12:21 -08002350.sp
2351By default, this option is disabled and inlining information is not printed\&. The
2352\fB\-XX:+PrintInlining\fR
2353option has to be used together with the
2354\fB\-XX:+UnlockDiagnosticVMOptions\fR
2355option that unlocks diagnostic JVM options\&.
2356.RE
2357.PP
2358\-XX:ReservedCodeCacheSize=\fIsize\fR
2359.RS 4
2360Sets the maximum code cache size (in bytes) for JIT\-compiled code\&. Append the letter
2361\fBk\fR
2362or
2363\fBK\fR
2364to indicate kilobytes,
2365\fBm\fR
2366or
2367\fBM\fR
2368to indicate megabytes,
2369\fBg\fR
2370or
2371\fBG\fR
2372to indicate gigabytes\&. The default maximum code cache size is 240 MB; if you disable tiered compilation with the option
2373\fB\-XX:\-TieredCompilation\fR, then the default size is 48 MB\&. This option has a limit of 2 GB; otherwise, an error is generated\&. The maximum code cache size should not be less than the initial code cache size; see the option
2374\fB\-XX:InitialCodeCacheSize\fR\&. This option is equivalent to
2375\fB\-Xmaxjitcodesize\fR\&.
2376.RE
2377.PP
2378\-XX:RTMAbortRatio=\fIabort_ratio\fR
2379.RS 4
2380The RTM abort ratio is specified as a percentage (%) of all executed RTM transactions\&. If a number of aborted transactions becomes greater than this ratio, then the compiled code will be deoptimized\&. This ratio is used when the
2381\fB\-XX:+UseRTMDeopt\fR
2382option is enabled\&. The default value of this option is 50\&. This means that the compiled code will be deoptimized if 50% of all transactions are aborted\&.
2383.RE
2384.PP
2385\-XX:RTMRetryCount=\fInumber_of_retries\fR
2386.RS 4
2387RTM locking code will be retried, when it is aborted or busy, the number of times specified by this option before falling back to the normal locking mechanism\&. The default value for this option is 5\&. The
2388\fB\-XX:UseRTMLocking\fR
2389option must be enabled\&.
2390.RE
2391.PP
2392\-XX:\-TieredCompilation
2393.RS 4
2394Disables the use of tiered compilation\&. By default, this option is enabled\&. Only the Java HotSpot Server VM supports this option\&.
2395.RE
2396.PP
2397\-XX:+UseAES
2398.RS 4
2399Enables hardware\-based AES intrinsics for Intel, AMD, and SPARC hardware\&. Intel Westmere (2010 and newer), AMD Bulldozer (2011 and newer), and SPARC (T4 and newer) are the supported hardware\&. UseAES is used in conjunction with UseAESIntrinsics\&.
2400.RE
2401.PP
2402\-XX:+UseAESIntrinsics
2403.RS 4
2404UseAES and UseAESIntrinsics flags are enabled by default and are supported only for Java HotSpot Server VM 32\-bit and 64\-bit\&. To disable hardware\-based AES intrinsics, specify
2405\fB\-XX:\-UseAES \-XX:\-UseAESIntrinsics\fR\&. For example, to enable hardware AES, use the following flags:
2406.sp
2407.if n \{\
2408.RS 4
2409.\}
2410.nf
2411\fB\-XX:+UseAES \-XX:+UseAESIntrinsics\fR
2412
2413.fi
2414.if n \{\
2415.RE
2416.\}
2417To support UseAES and UseAESIntrinsics flags for 32\-bit and 64\-bit use
2418\fB\-server\fR
2419option to choose Java HotSpot Server VM\&. These flags are not supported on Client VM\&.
2420.RE
2421.PP
2422\-XX:+UseCodeCacheFlushing
2423.RS 4
2424Enables 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
2425\fB\-XX:\-UseCodeCacheFlushing\fR\&.
2426.RE
2427.PP
2428\-XX:+UseCondCardMark
2429.RS 4
rgallard36ba8532014-06-06 15:45:48 -07002430Enables checking of whether the card is already marked before updating the card table\&. This option is disabled by default and should only be used on machines with multiple sockets, where it will increase performance of Java applications that rely heavily on concurrent operations\&. Only the Java HotSpot Server VM supports this option\&.
rgallardf71f2512015-02-02 10:12:21 -08002431.RE
2432.PP
2433\-XX:+UseRTMDeopt
2434.RS 4
2435Auto\-tunes RTM locking depending on the abort ratio\&. This ratio is specified by
2436\fB\-XX:RTMAbortRatio\fR
2437option\&. If the number of aborted transactions exceeds the abort ratio, then the method containing the lock will be deoptimized and recompiled with all locks as normal locks\&. This option is disabled by default\&. The
2438\fB\-XX:+UseRTMLocking\fR
2439option must be enabled\&.
2440.RE
2441.PP
2442\-XX:+UseRTMLocking
2443.RS 4
rgallard04b0ca42014-10-17 11:33:22 -07002444Generate Restricted Transactional Memory (RTM) locking code for all inflated locks, with the normal locking mechanism as the fallback handler\&. This option is disabled by default\&. Options related to RTM are only available for the Java HotSpot Server VM on x86 CPUs that support Transactional Synchronization Extensions (TSX)\&.
rgallardf71f2512015-02-02 10:12:21 -08002445.sp
2446RTM is part of Intel\*(Aqs TSX, which is an x86 instruction set extension and facilitates the creation of multithreaded applications\&. RTM introduces the new instructions
2447\fBXBEGIN\fR,
2448\fBXABORT\fR,
2449\fBXEND\fR, and
2450\fBXTEST\fR\&. The
2451\fBXBEGIN\fR
2452and
2453\fBXEND\fR
2454instructions enclose a set of instructions to run as a transaction\&. If no conflict is found when running the transaction, the memory and register modifications are committed together at the
2455\fBXEND\fR
2456instruction\&. The
2457\fBXABORT\fR
2458instruction can be used to explicitly abort a transaction and the
2459\fBXEND\fR
2460instruction to check if a set of instructions are being run in a transaction\&.
2461.sp
2462A lock on a transaction is inflated when another thread tries to access the same transaction, thereby blocking the thread that did not originally request access to the transaction\&. RTM requires that a fallback set of operations be specified in case a transaction aborts or fails\&. An RTM lock is a lock that has been delegated to the TSX\*(Aqs system\&.
2463.sp
2464RTM improves performance for highly contended locks with low conflict in a critical region (which is code that must not be accessed by more than one thread concurrently)\&. RTM also improves the performance of coarse\-grain locking, which typically does not perform well in multithreaded applications\&. (Coarse\-grain locking is the strategy of holding locks for long periods to minimize the overhead of taking and releasing locks, while fine\-grained locking is the strategy of trying to achieve maximum parallelism by locking only when necessary and unlocking as soon as possible\&.) Also, for lightly contended locks that are used by different threads, RTM can reduce false cache line sharing, also known as cache line ping\-pong\&. This occurs when multiple threads from different processors are accessing different resources, but the resources share the same cache line\&. As a result, the processors repeatedly invalidate the cache lines of other processors, which forces them to read from main memory instead of their cache\&.
2465.RE
2466.PP
2467\-XX:+UseSHA
2468.RS 4
2469Enables hardware\-based intrinsics for SHA crypto hash functions for SPARC hardware\&.
2470\fBUseSHA\fR
2471is used in conjunction with the
2472\fBUseSHA1Intrinsics\fR,
2473\fBUseSHA256Intrinsics\fR, and
2474\fBUseSHA512Intrinsics\fR
2475options\&.
2476.sp
2477The
2478\fBUseSHA\fR
2479and
2480\fBUseSHA*Intrinsics\fR
2481flags are enabled by default, and are supported only for Java HotSpot Server VM 64\-bit on SPARC T4 and newer\&.
2482.sp
2483This feature is only applicable when using the
2484\fBsun\&.security\&.provider\&.Sun\fR
2485provider for SHA operations\&.
2486.sp
2487To disable all hardware\-based SHA intrinsics, specify
2488\fB\-XX:\-UseSHA\fR\&. To disable only a particular SHA intrinsic, use the appropriate corresponding option\&. For example:
2489\fB\-XX:\-UseSHA256Intrinsics\fR\&.
2490.RE
2491.PP
2492\-XX:+UseSHA1Intrinsics
2493.RS 4
2494Enables intrinsics for SHA\-1 crypto hash function\&.
2495.RE
2496.PP
2497\-XX:+UseSHA256Intrinsics
2498.RS 4
2499Enables intrinsics for SHA\-224 and SHA\-256 crypto hash functions\&.
2500.RE
2501.PP
2502\-XX:+UseSHA512Intrinsics
2503.RS 4
2504Enables intrinsics for SHA\-384 and SHA\-512 crypto hash functions\&.
2505.RE
2506.PP
2507\-XX:+UseSuperWord
2508.RS 4
2509Enables 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
2510\fB\-XX:\-UseSuperWord\fR\&. Only the Java HotSpot Server VM supports this option\&.
2511.RE
2512.SS "Advanced Serviceability Options"
2513.PP
rgallard36ba8532014-06-06 15:45:48 -07002514These options provide the ability to gather system information and perform extensive debugging\&.
rgallardf71f2512015-02-02 10:12:21 -08002515.PP
2516\-XX:+ExtendedDTraceProbes
2517.RS 4
2518Enables additional
2519\fBdtrace\fR
2520tool probes that impact the performance\&. By default, this option is disabled and
2521\fBdtrace\fR
2522performs only standard probes\&.
2523.RE
2524.PP
2525\-XX:+HeapDumpOnOutOfMemory
2526.RS 4
2527Enables the dumping of the Java heap to a file in the current directory by using the heap profiler (HPROF) when a
2528\fBjava\&.lang\&.OutOfMemoryError\fR
2529exception is thrown\&. You can explicitly set the heap dump file path and name using the
2530\fB\-XX:HeapDumpPath\fR
2531option\&. By default, this option is disabled and the heap is not dumped when an
2532\fBOutOfMemoryError\fR
2533exception is thrown\&.
2534.RE
2535.PP
2536\-XX:HeapDumpPath=\fIpath\fR
2537.RS 4
2538Sets the path and file name for writing the heap dump provided by the heap profiler (HPROF) when the
2539\fB\-XX:+HeapDumpOnOutOfMemoryError\fR
2540option is set\&. By default, the file is created in the current working directory, and it is named
2541\fBjava_pid\fR\fIpid\fR\fB\&.hprof\fR
2542where
2543\fIpid\fR
2544is the identifier of the process that caused the error\&. The following example shows how to set the default file explicitly (\fB%p\fR
2545represents the current process identificator):
2546.sp
2547.if n \{\
2548.RS 4
2549.\}
2550.nf
2551\fB\-XX:HeapDumpPath=\&./java_pid%p\&.hprof\fR
2552
2553.fi
2554.if n \{\
2555.RE
2556.\}
2557The following example shows how to set the heap dump file to
2558\fB/var/log/java/java_heapdump\&.hprof\fR:
2559.sp
2560.if n \{\
2561.RS 4
2562.\}
2563.nf
2564\fB\-XX:HeapDumpPath=/var/log/java/java_heapdump\&.hprof\fR
2565
2566.fi
2567.if n \{\
2568.RE
2569.\}
2570.RE
2571.PP
2572\-XX:LogFile=\fIpath\fR
2573.RS 4
2574Sets 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
2575\fBhotspot\&.log\fR\&.
2576.sp
2577The following example shows how to set the log file to
2578\fB/var/log/java/hotspot\&.log\fR:
2579.sp
2580.if n \{\
2581.RS 4
2582.\}
2583.nf
2584\fB\-XX:LogFile=/var/log/java/hotspot\&.log\fR
2585
2586.fi
2587.if n \{\
2588.RE
2589.\}
2590.RE
2591.PP
2592\-XX:+PrintClassHistogram
2593.RS 4
2594Enables printing of a class instance histogram after a
2595\fBControl+C\fR
2596event (\fBSIGTERM\fR)\&. By default, this option is disabled\&.
2597.sp
2598Setting this option is equivalent to running the
2599\fBjmap \-histo\fR
2600command, or the
2601\fBjcmd \fR\fIpid\fR\fB GC\&.class_histogram\fR
2602command, where
2603\fIpid\fR
2604is the current Java process identifier\&.
2605.RE
2606.PP
2607\-XX:+PrintConcurrentLocks
2608.RS 4
2609Enables printing of locks after a event\&. By default, this option is disabled\&.
2610.sp
2611Enables printing of
2612\fBjava\&.util\&.concurrent\fR
2613locks after a
2614\fBControl+C\fR
2615event (\fBSIGTERM\fR)\&. By default, this option is disabled\&.
2616.sp
2617Setting this option is equivalent to running the
2618\fBjstack \-l\fR
2619command or the
2620\fBjcmd \fR\fIpid\fR\fB Thread\&.print \-l\fR
2621command, where
2622\fIpid\fR
2623is the current Java process identifier\&.
2624.RE
2625.PP
2626\-XX:+UnlockDiagnosticVMOptions
2627.RS 4
rgallard36ba8532014-06-06 15:45:48 -07002628Unlocks the options intended for diagnosing the JVM\&. By default, this option is disabled and diagnostic options are not available\&.
rgallardf71f2512015-02-02 10:12:21 -08002629.RE
2630.SS "Advanced Garbage Collection Options"
2631.PP
rgallard36ba8532014-06-06 15:45:48 -07002632These options control how garbage collection (GC) is performed by the Java HotSpot VM\&.
rgallardf71f2512015-02-02 10:12:21 -08002633.PP
2634\-XX:+AggressiveHeap
2635.RS 4
2636Enables 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\&.
2637.RE
2638.PP
2639\-XX:+AlwaysPreTouch
2640.RS 4
2641Enables touching of every page on the Java heap during JVM initialization\&. This gets all pages into the memory before entering the
2642\fBmain()\fR
2643method\&. 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\&.
2644.RE
2645.PP
2646\-XX:+CMSClassUnloadingEnabled
2647.RS 4
2648Enables 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
2649\fB\-XX:\-CMSClassUnloadingEnabled\fR\&.
2650.RE
2651.PP
2652\-XX:CMSExpAvgFactor=\fIpercent\fR
2653.RS 4
rgallardb6435452013-11-25 20:19:02 -08002654Sets 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%:
rgallardf71f2512015-02-02 10:12:21 -08002655.sp
2656.if n \{\
2657.RS 4
2658.\}
2659.nf
2660\fB\-XX:CMSExpAvgFactor=15\fR
2661
2662.fi
2663.if n \{\
2664.RE
2665.\}
2666.RE
2667.PP
2668\-XX:CMSInitiatingOccupancyFraction=\fIpercent\fR
2669.RS 4
2670Sets 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
2671\fB\-XX:CMSTriggerRatio\fR
2672is used to define the value of the initiating occupancy fraction\&.
2673.sp
rgallardb6435452013-11-25 20:19:02 -08002674The following example shows how to set the occupancy fraction to 20%:
rgallardf71f2512015-02-02 10:12:21 -08002675.sp
2676.if n \{\
2677.RS 4
2678.\}
2679.nf
2680\fB\-XX:CMSInitiatingOccupancyFraction=20\fR
2681
2682.fi
2683.if n \{\
2684.RE
2685.\}
2686.RE
2687.PP
2688\-XX:+CMSScavengeBeforeRemark
2689.RS 4
rgallardb6435452013-11-25 20:19:02 -08002690Enables scavenging attempts before the CMS remark step\&. By default, this option is disabled\&.
rgallardf71f2512015-02-02 10:12:21 -08002691.RE
2692.PP
2693\-XX:CMSTriggerRatio=\fIpercent\fR
2694.RS 4
2695Sets the percentage (0 to 100) of the value specified by
2696\fB\-XX:MinHeapFreeRatio\fR
2697that is allocated before a CMS collection cycle commences\&. The default value is set to 80%\&.
2698.sp
rgallardb6435452013-11-25 20:19:02 -08002699The following example shows how to set the occupancy fraction to 75%:
rgallardf71f2512015-02-02 10:12:21 -08002700.sp
2701.if n \{\
2702.RS 4
2703.\}
2704.nf
2705\fB\-XX:CMSTriggerRatio=75\fR
2706
2707.fi
2708.if n \{\
2709.RE
2710.\}
2711.RE
2712.PP
2713\-XX:ConcGCThreads=\fIthreads\fR
2714.RS 4
rgallardb6435452013-11-25 20:19:02 -08002715Sets the number of threads used for concurrent GC\&. The default value depends on the number of CPUs available to the JVM\&.
rgallardf71f2512015-02-02 10:12:21 -08002716.sp
rgallardb6435452013-11-25 20:19:02 -08002717For example, to set the number of threads for concurrent GC to 2, specify the following option:
rgallardf71f2512015-02-02 10:12:21 -08002718.sp
2719.if n \{\
2720.RS 4
2721.\}
2722.nf
2723\fB\-XX:ConcGCThreads=2\fR
2724
2725.fi
2726.if n \{\
2727.RE
2728.\}
2729.RE
2730.PP
2731\-XX:+DisableExplicitGC
2732.RS 4
2733Enables the option that disables processing of calls to
2734\fBSystem\&.gc()\fR\&. This option is disabled by default, meaning that calls to
2735\fBSystem\&.gc()\fR
2736are processed\&. If processing of calls to
2737\fBSystem\&.gc()\fR
2738is disabled, the JVM still performs GC when necessary\&.
2739.RE
2740.PP
2741\-XX:+ExplicitGCInvokesConcurrent
2742.RS 4
2743Enables invoking of concurrent GC by using the
2744\fBSystem\&.gc()\fR
2745request\&. This option is disabled by default and can be enabled only together with the
2746\fB\-XX:+UseConcMarkSweepGC\fR
2747option\&.
2748.RE
2749.PP
2750\-XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses
2751.RS 4
2752Enables invoking of concurrent GC by using the
2753\fBSystem\&.gc()\fR
2754request and unloading of classes during the concurrent GC cycle\&. This option is disabled by default and can be enabled only together with the
2755\fB\-XX:+UseConcMarkSweepGC\fR
2756option\&.
2757.RE
2758.PP
2759\-XX:G1HeapRegionSize=\fIsize\fR
2760.RS 4
2761Sets 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\&.
2762.sp
rgallardb6435452013-11-25 20:19:02 -08002763The following example shows how to set the size of the subdivisions to 16 MB:
rgallardf71f2512015-02-02 10:12:21 -08002764.sp
2765.if n \{\
2766.RS 4
2767.\}
2768.nf
2769\fB\-XX:G1HeapRegionSize=16m\fR
2770
2771.fi
2772.if n \{\
2773.RE
2774.\}
2775.RE
2776.PP
2777\-XX:+G1PrintHeapRegions
2778.RS 4
rgallardb6435452013-11-25 20:19:02 -08002779Enables the printing of information about which regions are allocated and which are reclaimed by the G1 collector\&. By default, this option is disabled\&.
rgallardf71f2512015-02-02 10:12:21 -08002780.RE
2781.PP
2782\-XX:G1ReservePercent=\fIpercent\fR
2783.RS 4
rgallardb6435452013-11-25 20:19:02 -08002784Sets 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%\&.
rgallardf71f2512015-02-02 10:12:21 -08002785.sp
rgallardb6435452013-11-25 20:19:02 -08002786The following example shows how to set the reserved heap to 20%:
rgallardf71f2512015-02-02 10:12:21 -08002787.sp
2788.if n \{\
2789.RS 4
2790.\}
2791.nf
2792\fB\-XX:G1ReservePercent=20\fR
2793
2794.fi
2795.if n \{\
2796.RE
2797.\}
2798.RE
2799.PP
2800\-XX:InitialHeapSize=\fIsize\fR
2801.RS 4
2802Sets 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
2803\fBk\fR
2804or
2805\fBK\fR
2806to indicate kilobytes,
2807\fBm\fR
2808or
2809\fBM\fR
2810to indicate megabytes,
2811\fBg\fR
2812or
2813\fBG\fR
2814to indicate gigabytes\&. The default value is chosen at runtime based on system configuration\&. See the section "Ergonomics" in
2815\fIJava SE HotSpot Virtual Machine Garbage Collection Tuning Guide\fR
2816at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gctuning/index\&.html\&.
2817.sp
rgallardb6435452013-11-25 20:19:02 -08002818The following examples show how to set the size of allocated memory to 6 MB using various units:
rgallardf71f2512015-02-02 10:12:21 -08002819.sp
2820.if n \{\
2821.RS 4
2822.\}
2823.nf
2824\fB\-XX:InitialHeapSize=6291456\fR
2825\fB\-XX:InitialHeapSize=6144k\fR
2826\fB\-XX:InitialHeapSize=6m\fR
2827
2828.fi
2829.if n \{\
2830.RE
2831.\}
2832If 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
2833\fB\-XX:NewSize\fR
2834option\&.
2835.RE
2836.PP
2837\-XX:InitialSurvivorRatio=\fIratio\fR
2838.RS 4
2839Sets the initial survivor space ratio used by the throughput garbage collector (which is enabled by the
2840\fB\-XX:+UseParallelGC\fR
2841and/or \-\fBXX:+UseParallelOldGC\fR
2842options)\&. Adaptive sizing is enabled by default with the throughput garbage collector by using the
2843\fB\-XX:+UseParallelGC\fR
2844and
2845\fB\-XX:+UseParallelOldGC\fR
2846options, and survivor space is resized according to the application behavior, starting with the initial value\&. If adaptive sizing is disabled (using the
2847\fB\-XX:\-UseAdaptiveSizePolicy\fR
2848option), then the
2849\fB\-XX:SurvivorRatio\fR
2850option should be used to set the size of the survivor space for the entire execution of the application\&.
2851.sp
rgallardb6435452013-11-25 20:19:02 -08002852The 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):
rgallardf71f2512015-02-02 10:12:21 -08002853.sp
2854.if n \{\
2855.RS 4
2856.\}
2857.nf
2858\fBS=Y/(R+2)\fR
2859
2860.fi
2861.if n \{\
2862.RE
2863.\}
rgallardb6435452013-11-25 20:19:02 -08002864The 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\&.
rgallardf71f2512015-02-02 10:12:21 -08002865.sp
rgallardb6435452013-11-25 20:19:02 -08002866By 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\&.
rgallardf71f2512015-02-02 10:12:21 -08002867.sp
rgallardb6435452013-11-25 20:19:02 -08002868The following example shows how to set the initial survivor space ratio to 4:
rgallardf71f2512015-02-02 10:12:21 -08002869.sp
2870.if n \{\
2871.RS 4
2872.\}
2873.nf
2874\fB\-XX:InitialSurvivorRatio=4\fR
2875
2876.fi
2877.if n \{\
2878.RE
2879.\}
2880.RE
2881.PP
2882\-XX:InitiatingHeapOccupancyPercent=\fIpercent\fR
2883.RS 4
rgallardb6435452013-11-25 20:19:02 -08002884Sets 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)\&.
rgallardf71f2512015-02-02 10:12:21 -08002885.sp
rgallardb6435452013-11-25 20:19:02 -08002886By 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%:
rgallardf71f2512015-02-02 10:12:21 -08002887.sp
2888.if n \{\
2889.RS 4
2890.\}
2891.nf
2892\fB\-XX:InitiatingHeapOccupancyPercent=75\fR
2893
2894.fi
2895.if n \{\
2896.RE
2897.\}
2898.RE
2899.PP
2900\-XX:MaxGCPauseMillis=\fItime\fR
2901.RS 4
rgallardb6435452013-11-25 20:19:02 -08002902Sets 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\&.
rgallardf71f2512015-02-02 10:12:21 -08002903.sp
rgallardb6435452013-11-25 20:19:02 -08002904The following example shows how to set the maximum target pause time to 500 ms:
rgallardf71f2512015-02-02 10:12:21 -08002905.sp
2906.if n \{\
2907.RS 4
2908.\}
2909.nf
2910\fB\-XX:MaxGCPauseMillis=500\fR
2911
2912.fi
2913.if n \{\
2914.RE
2915.\}
2916.RE
2917.PP
2918\-XX:MaxHeapSize=\fIsize\fR
2919.RS 4
2920Sets 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
2921\fBk\fR
2922or
2923\fBK\fR
2924to indicate kilobytes,
2925\fBm\fR
2926or
2927\fBM\fR
2928to indicate megabytes,
2929\fBg\fR
2930or
2931\fBG\fR
2932to indicate gigabytes\&. The default value is chosen at runtime based on system configuration\&. For server deployments,
2933\fB\-XX:InitialHeapSize\fR
2934and
2935\fB\-XX:MaxHeapSize\fR
2936are often set to the same value\&. See the section "Ergonomics" in
2937\fIJava SE HotSpot Virtual Machine Garbage Collection Tuning Guide\fR
2938at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gctuning/index\&.html\&.
2939.sp
rgallardb6435452013-11-25 20:19:02 -08002940The following examples show how to set the maximum allowed size of allocated memory to 80 MB using various units:
rgallardf71f2512015-02-02 10:12:21 -08002941.sp
2942.if n \{\
2943.RS 4
2944.\}
2945.nf
2946\fB\-XX:MaxHeapSize=83886080\fR
2947\fB\-XX:MaxHeapSize=81920k\fR
2948\fB\-XX:MaxHeapSize=80m\fR
2949
2950.fi
2951.if n \{\
2952.RE
2953.\}
rgallardb6435452013-11-25 20:19:02 -08002954On 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\&.
rgallardf71f2512015-02-02 10:12:21 -08002955.sp
2956The
2957\fB\-XX:MaxHeapSize\fR
2958option is equivalent to
2959\fB\-Xmx\fR\&.
2960.RE
2961.PP
2962\-XX:MaxHeapFreeRatio=\fIpercent\fR
2963.RS 4
rgallardb6435452013-11-25 20:19:02 -08002964Sets 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%\&.
rgallardf71f2512015-02-02 10:12:21 -08002965.sp
rgallardb6435452013-11-25 20:19:02 -08002966The following example shows how to set the maximum free heap ratio to 75%:
rgallardf71f2512015-02-02 10:12:21 -08002967.sp
2968.if n \{\
2969.RS 4
2970.\}
2971.nf
2972\fB\-XX:MaxHeapFreeRatio=75\fR
2973
2974.fi
2975.if n \{\
2976.RE
2977.\}
2978.RE
2979.PP
2980\-XX:MaxMetaspaceSize=\fIsize\fR
2981.RS 4
rgallardb6435452013-11-25 20:19:02 -08002982Sets 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\&.
rgallardf71f2512015-02-02 10:12:21 -08002983.sp
rgallardb6435452013-11-25 20:19:02 -08002984The following example shows how to set the maximum class metadata size to 256 MB:
rgallardf71f2512015-02-02 10:12:21 -08002985.sp
2986.if n \{\
2987.RS 4
2988.\}
2989.nf
2990\fB\-XX:MaxMetaspaceSize=256m\fR
2991
2992.fi
2993.if n \{\
2994.RE
2995.\}
2996.RE
2997.PP
2998\-XX:MaxNewSize=\fIsize\fR
2999.RS 4
rgallardb6435452013-11-25 20:19:02 -08003000Sets the maximum size (in bytes) of the heap for the young generation (nursery)\&. The default value is set ergonomically\&.
rgallardf71f2512015-02-02 10:12:21 -08003001.RE
3002.PP
3003\-XX:MaxTenuringThreshold=\fIthreshold\fR
3004.RS 4
rgallardb6435452013-11-25 20:19:02 -08003005Sets 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\&.
rgallardf71f2512015-02-02 10:12:21 -08003006.sp
rgallardb6435452013-11-25 20:19:02 -08003007The following example shows how to set the maximum tenuring threshold to 10:
rgallardf71f2512015-02-02 10:12:21 -08003008.sp
3009.if n \{\
3010.RS 4
3011.\}
3012.nf
3013\fB\-XX:MaxTenuringThreshold=10\fR
3014
3015.fi
3016.if n \{\
3017.RE
3018.\}
3019.RE
3020.PP
3021\-XX:MetaspaceSize=\fIsize\fR
3022.RS 4
rgallardb6435452013-11-25 20:19:02 -08003023Sets 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\&.
rgallardf71f2512015-02-02 10:12:21 -08003024.RE
3025.PP
3026\-XX:MinHeapFreeRatio=\fIpercent\fR
3027.RS 4
rgallardb6435452013-11-25 20:19:02 -08003028Sets 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%\&.
rgallardf71f2512015-02-02 10:12:21 -08003029.sp
rgallardb6435452013-11-25 20:19:02 -08003030The following example shows how to set the minimum free heap ratio to 25%:
rgallardf71f2512015-02-02 10:12:21 -08003031.sp
3032.if n \{\
3033.RS 4
3034.\}
3035.nf
3036\fB\-XX:MinHeapFreeRatio=25\fR
3037
3038.fi
3039.if n \{\
3040.RE
3041.\}
3042.RE
3043.PP
3044\-XX:NewRatio=\fIratio\fR
3045.RS 4
rgallardb6435452013-11-25 20:19:02 -08003046Sets 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:
rgallardf71f2512015-02-02 10:12:21 -08003047.sp
3048.if n \{\
3049.RS 4
3050.\}
3051.nf
3052\fB\-XX:NewRatio=1\fR
3053
3054.fi
3055.if n \{\
3056.RE
3057.\}
3058.RE
3059.PP
3060\-XX:NewSize=\fIsize\fR
3061.RS 4
3062Sets the initial size (in bytes) of the heap for the young generation (nursery)\&. Append the letter
3063\fBk\fR
3064or
3065\fBK\fR
3066to indicate kilobytes,
3067\fBm\fR
3068or
3069\fBM\fR
3070to indicate megabytes,
3071\fBg\fR
3072or
3073\fBG\fR
3074to indicate gigabytes\&.
3075.sp
rgallardb6435452013-11-25 20:19:02 -08003076The 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\&.
rgallardf71f2512015-02-02 10:12:21 -08003077.sp
rgallardb6435452013-11-25 20:19:02 -08003078The following examples show how to set the initial size of young generation to 256 MB using various units:
rgallardf71f2512015-02-02 10:12:21 -08003079.sp
3080.if n \{\
3081.RS 4
3082.\}
3083.nf
3084\fB\-XX:NewSize=256m\fR
3085\fB\-XX:NewSize=262144k\fR
3086\fB\-XX:NewSize=268435456\fR
3087
3088.fi
3089.if n \{\
3090.RE
3091.\}
3092The
3093\fB\-XX:NewSize\fR
3094option is equivalent to
3095\fB\-Xmn\fR\&.
3096.RE
3097.PP
3098\-XX:ParallelGCThreads=\fIthreads\fR
3099.RS 4
rgallardb6435452013-11-25 20:19:02 -08003100Sets 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\&.
rgallardf71f2512015-02-02 10:12:21 -08003101.sp
rgallardb6435452013-11-25 20:19:02 -08003102For example, to set the number of threads for parallel GC to 2, specify the following option:
rgallardf71f2512015-02-02 10:12:21 -08003103.sp
3104.if n \{\
3105.RS 4
3106.\}
3107.nf
3108\fB\-XX:ParallelGCThreads=2\fR
3109
3110.fi
3111.if n \{\
3112.RE
3113.\}
3114.RE
3115.PP
3116\-XX:+ParallelRefProcEnabled
3117.RS 4
rgallardb6435452013-11-25 20:19:02 -08003118Enables parallel reference processing\&. By default, this option is disabled\&.
rgallardf71f2512015-02-02 10:12:21 -08003119.RE
3120.PP
3121\-XX:+PrintAdaptiveSizePolicy
3122.RS 4
rgallardb6435452013-11-25 20:19:02 -08003123Enables printing of information about adaptive generation sizing\&. By default, this option is disabled\&.
rgallardf71f2512015-02-02 10:12:21 -08003124.RE
3125.PP
3126\-XX:+PrintGC
3127.RS 4
rgallardb6435452013-11-25 20:19:02 -08003128Enables printing of messages at every GC\&. By default, this option is disabled\&.
rgallardf71f2512015-02-02 10:12:21 -08003129.RE
3130.PP
3131\-XX:+PrintGCApplicationConcurrentTime
3132.RS 4
rgallardb6435452013-11-25 20:19:02 -08003133Enables printing of how much time elapsed since the last pause (for example, a GC pause)\&. By default, this option is disabled\&.
rgallardf71f2512015-02-02 10:12:21 -08003134.RE
3135.PP
3136\-XX:+PrintGCApplicationStoppedTime
3137.RS 4
rgallardb6435452013-11-25 20:19:02 -08003138Enables printing of how much time the pause (for example, a GC pause) lasted\&. By default, this option is disabled\&.
rgallardf71f2512015-02-02 10:12:21 -08003139.RE
3140.PP
3141\-XX:+PrintGCDateStamps
3142.RS 4
rgallardb6435452013-11-25 20:19:02 -08003143Enables printing of a date stamp at every GC\&. By default, this option is disabled\&.
rgallardf71f2512015-02-02 10:12:21 -08003144.RE
3145.PP
3146\-XX:+PrintGCDetails
3147.RS 4
rgallardb6435452013-11-25 20:19:02 -08003148Enables printing of detailed messages at every GC\&. By default, this option is disabled\&.
rgallardf71f2512015-02-02 10:12:21 -08003149.RE
3150.PP
3151\-XX:+PrintGCTaskTimeStamps
3152.RS 4
rgallardb6435452013-11-25 20:19:02 -08003153Enables printing of time stamps for every individual GC worker thread task\&. By default, this option is disabled\&.
rgallardf71f2512015-02-02 10:12:21 -08003154.RE
3155.PP
3156\-XX:+PrintGCTimeStamps
3157.RS 4
rgallardb6435452013-11-25 20:19:02 -08003158Enables printing of time stamps at every GC\&. By default, this option is disabled\&.
rgallardf71f2512015-02-02 10:12:21 -08003159.RE
3160.PP
3161\-XX:+PrintStringDeduplicationStatistics
3162.RS 4
3163Prints detailed deduplication statistics\&. By default, this option is disabled\&. See the
3164\fB\-XX:+UseStringDeduplication\fR
3165option\&.
3166.RE
3167.PP
3168\-XX:+PrintTenuringDistribution
3169.RS 4
rgallardb6435452013-11-25 20:19:02 -08003170Enables printing of tenuring age information\&. The following is an example of the output:
rgallardf71f2512015-02-02 10:12:21 -08003171.sp
3172.if n \{\
3173.RS 4
3174.\}
3175.nf
3176\fBDesired survivor size 48286924 bytes, new threshold 10 (max 10)\fR
3177\fB\- age 1: 28992024 bytes, 28992024 total\fR
3178\fB\- age 2: 1366864 bytes, 30358888 total\fR
3179\fB\- age 3: 1425912 bytes, 31784800 total\fR
3180\fB\&.\&.\&.\fR
3181
3182.fi
3183.if n \{\
3184.RE
3185.\}
rgallardb6435452013-11-25 20:19:02 -08003186Age 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\&.
rgallardf71f2512015-02-02 10:12:21 -08003187.sp
rgallardb6435452013-11-25 20:19:02 -08003188In 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\&.
rgallardf71f2512015-02-02 10:12:21 -08003189.sp
rgallardb6435452013-11-25 20:19:02 -08003190By default, this option is disabled\&.
rgallardf71f2512015-02-02 10:12:21 -08003191.RE
3192.PP
3193\-XX:+ScavengeBeforeFullGC
3194.RS 4
3195Enables GC of the young generation before each full GC\&. This option is enabled by default\&. Oracle recommends that you
3196\fIdo not\fR
3197disable 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
3198\fB\-XX:\-ScavengeBeforeFullGC\fR\&.
3199.RE
3200.PP
3201\-XX:SoftRefLRUPolicyMSPerMB=\fItime\fR
3202.RS 4
3203Sets 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
3204\fB\-XX:SoftRefLRUPolicyMSPerMB\fR
3205option 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
3206\fB\-Xmx\fR
3207option has a significant effect on how quickly soft references are garbage collected\&.
3208.sp
rgallardb6435452013-11-25 20:19:02 -08003209The following example shows how to set the value to 2\&.5 seconds:
rgallardf71f2512015-02-02 10:12:21 -08003210.sp
3211.if n \{\
3212.RS 4
3213.\}
3214.nf
3215\fB\-XX:SoftRefLRUPolicyMSPerMB=2500\fR
3216
3217.fi
3218.if n \{\
3219.RE
3220.\}
3221.RE
3222.PP
3223\-XX:StringDeduplicationAgeThreshold=\fIthreshold\fR
3224.RS 4
3225\fBString\fR
3226objects reaching the specified age are considered candidates for deduplication\&. An object\*(Aqs age is a measure of how many times it has survived garbage collection\&. This is sometimes referred to as tenuring; see the
3227\fB\-XX:+PrintTenuringDistribution\fR
3228option\&. Note that
3229\fBString\fR
3230objects that are promoted to an old heap region before this age has been reached are always considered candidates for deduplication\&. The default value for this option is
3231\fB3\fR\&. See the
3232\fB\-XX:+UseStringDeduplication\fR
3233option\&.
3234.RE
3235.PP
3236\-XX:SurvivorRatio=\fIratio\fR
3237.RS 4
rgallardb6435452013-11-25 20:19:02 -08003238Sets 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:
rgallardf71f2512015-02-02 10:12:21 -08003239.sp
3240.if n \{\
3241.RS 4
3242.\}
3243.nf
3244\fB\-XX:SurvivorRatio=4\fR
3245
3246.fi
3247.if n \{\
3248.RE
3249.\}
3250.RE
3251.PP
3252\-XX:TargetSurvivorRatio=\fIpercent\fR
3253.RS 4
rgallardb6435452013-11-25 20:19:02 -08003254Sets the desired percentage of survivor space (0 to 100) used after young garbage collection\&. By default, this option is set to 50%\&.
rgallardf71f2512015-02-02 10:12:21 -08003255.sp
rgallardb6435452013-11-25 20:19:02 -08003256The following example shows how to set the target survivor space ratio to 30%:
rgallardf71f2512015-02-02 10:12:21 -08003257.sp
3258.if n \{\
3259.RS 4
3260.\}
3261.nf
3262\fB\-XX:TargetSurvivorRatio=30\fR
3263
3264.fi
3265.if n \{\
3266.RE
3267.\}
3268.RE
3269.PP
3270\-XX:TLABSize=\fIsize\fR
3271.RS 4
3272Sets the initial size (in bytes) of a thread\-local allocation buffer (TLAB)\&. Append the letter
3273\fBk\fR
3274or
3275\fBK\fR
3276to indicate kilobytes,
3277\fBm\fR
3278or
3279\fBM\fR
3280to indicate megabytes,
3281\fBg\fR
3282or
3283\fBG\fR
3284to indicate gigabytes\&. If this option is set to 0, then the JVM chooses the initial size automatically\&.
3285.sp
rgallardb6435452013-11-25 20:19:02 -08003286The following example shows how to set the initial TLAB size to 512 KB:
rgallardf71f2512015-02-02 10:12:21 -08003287.sp
3288.if n \{\
3289.RS 4
3290.\}
3291.nf
3292\fB\-XX:TLABSize=512k\fR
3293
3294.fi
3295.if n \{\
3296.RE
3297.\}
3298.RE
3299.PP
3300\-XX:+UseAdaptiveSizePolicy
3301.RS 4
3302Enables the use of adaptive generation sizing\&. This option is enabled by default\&. To disable adaptive generation sizing, specify
3303\fB\-XX:\-UseAdaptiveSizePolicy\fR
3304and set the size of the memory allocation pool explicitly (see the
3305\fB\-XX:SurvivorRatio\fR
3306option)\&.
3307.RE
3308.PP
3309\-XX:+UseCMSInitiatingOccupancyOnly
3310.RS 4
rgallardb6435452013-11-25 20:19:02 -08003311Enables 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\&.
rgallardf71f2512015-02-02 10:12:21 -08003312.RE
3313.PP
3314\-XX:+UseConcMarkSweepGC
3315.RS 4
3316Enables the use of the CMS garbage collector for the old generation\&. Oracle recommends that you use the CMS garbage collector when application latency requirements cannot be met by the throughput (\fB\-XX:+UseParallelGC\fR) garbage collector\&. The G1 garbage collector (\fB\-XX:+UseG1GC\fR) is another alternative\&.
3317.sp
3318By 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
3319\fB\-XX:+UseParNewGC\fR
3320option is automatically set and you should not disable it, because the following combination of options has been deprecated in JDK 8:
3321\fB\-XX:+UseConcMarkSweepGC \-XX:\-UseParNewGC\fR\&.
3322.RE
3323.PP
3324\-XX:+UseG1GC
3325.RS 4
3326Enables the use of the garbage\-first (G1) garbage collector\&. It is a server\-style garbage collector, targeted for multiprocessor machines with a large amount of RAM\&. It meets GC pause time goals with high probability, while maintaining good throughput\&. The G1 collector is recommended for applications requiring large heaps (sizes of around 6 GB or larger) with limited GC latency requirements (stable and predictable pause time below 0\&.5 seconds)\&.
3327.sp
rgallardb6435452013-11-25 20:19:02 -08003328By default, this option is disabled and the collector is chosen automatically based on the configuration of the machine and type of the JVM\&.
rgallardf71f2512015-02-02 10:12:21 -08003329.RE
3330.PP
3331\-XX:+UseGCOverheadLimit
3332.RS 4
3333Enables the use of a policy that limits the proportion of time spent by the JVM on GC before an
3334\fBOutOfMemoryError\fR
3335exception is thrown\&. This option is enabled, by default and the parallel GC will throw an
3336\fBOutOfMemoryError\fR
3337if 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
3338\fB\-XX:\-UseGCOverheadLimit\fR\&.
3339.RE
3340.PP
3341\-XX:+UseNUMA
3342.RS 4
3343Enables performance optimization of an application on a machine with nonuniform memory architecture (NUMA) by increasing the application\*(Aqs use of lower latency memory\&. By default, this option is disabled and no optimization for NUMA is made\&. The option is only available when the parallel garbage collector is used (\fB\-XX:+UseParallelGC\fR)\&.
3344.RE
3345.PP
3346\-XX:+UseParallelGC
3347.RS 4
rgallardb6435452013-11-25 20:19:02 -08003348Enables 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\&.
rgallardf71f2512015-02-02 10:12:21 -08003349.sp
3350By 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
3351\fB\-XX:+UseParallelOldGC\fR
3352option is automatically enabled, unless you explicitly disable it\&.
3353.RE
3354.PP
3355\-XX:+UseParallelOldGC
3356.RS 4
3357Enables the use of the parallel garbage collector for full GCs\&. By default, this option is disabled\&. Enabling it automatically enables the
3358\fB\-XX:+UseParallelGC\fR
3359option\&.
3360.RE
3361.PP
3362\-XX:+UseParNewGC
3363.RS 4
3364Enables 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
3365\fB\-XX:+UseConcMarkSweepGC\fR
3366option\&. Using the
3367\fB\-XX:+UseParNewGC\fR
3368option without the
3369\fB\-XX:+UseConcMarkSweepGC\fR
3370option was deprecated in JDK 8\&.
3371.RE
3372.PP
3373\-XX:+UseSerialGC
3374.RS 4
rgallardb6435452013-11-25 20:19:02 -08003375Enables 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\&.
rgallardf71f2512015-02-02 10:12:21 -08003376.RE
3377.PP
3378\-XX:+UseSHM
3379.RS 4
rgallard04b0ca42014-10-17 11:33:22 -07003380On Linux, enables the JVM to use shared memory to setup large pages\&.
rgallardf71f2512015-02-02 10:12:21 -08003381.sp
3382For more information, see "Large Pages"\&.
3383.RE
3384.PP
3385\-XX:+UseStringDeduplication
3386.RS 4
3387Enables string deduplication\&. By default, this option is disabled\&. To use this option, you must enable the garbage\-first (G1) garbage collector\&. See the
3388\fB\-XX:+UseG1GC\fR
3389option\&.
3390.sp
3391\fIString deduplication\fR
3392reduces the memory footprint of
3393\fBString\fR
3394objects on the Java heap by taking advantage of the fact that many
3395\fBString\fR
3396objects are identical\&. Instead of each
3397\fBString\fR
3398object pointing to its own character array, identical
3399\fBString\fR
3400objects can point to and share the same character array\&.
3401.RE
3402.PP
3403\-XX:+UseTLAB
3404.RS 4
3405Enables 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
3406\fB\-XX:\-UseTLAB\fR\&.
3407.RE
3408.SS "Deprecated and Removed Options"
3409.PP
rgallardb6435452013-11-25 20:19:02 -08003410These options were included in the previous release, but have since been considered unnecessary\&.
rgallardf71f2512015-02-02 10:12:21 -08003411.PP
3412\-Xincgc
3413.RS 4
rgallard1cc205c2014-01-09 16:10:24 -08003414Enables incremental garbage collection\&. This option was deprecated in JDK 8 with no replacement\&.
rgallardf71f2512015-02-02 10:12:21 -08003415.RE
3416.PP
3417\-Xrun\fIlibname\fR
3418.RS 4
3419Loads the specified debugging/profiling library\&. This option was superseded by the
3420\fB\-agentlib\fR
3421option\&.
3422.RE
3423.PP
3424\-XX:CMSIncrementalDutyCycle=\fIpercent\fR
3425.RS 4
3426Sets 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
3427\fB\-XX:+CMSIncrementalMode\fR
3428option\&.
3429.RE
3430.PP
3431\-XX:CMSIncrementalDutyCycleMin=\fIpercent\fR
3432.RS 4
3433Sets the percentage of time (0 to 100) between minor collections that is the lower bound for the duty cycle when
3434\fB\-XX:+CMSIncrementalPacing\fR
3435is enabled\&. This option was deprecated in JDK 8 with no replacement, following the deprecation of the
3436\fB\-XX:+CMSIncrementalMode\fR
3437option\&.
3438.RE
3439.PP
3440\-XX:+CMSIncrementalMode
3441.RS 4
3442Enables the incremental mode for the CMS collector\&. This option was deprecated in JDK 8 with no replacement, along with other options that start with
3443\fBCMSIncremental\fR\&.
3444.RE
3445.PP
3446\-XX:CMSIncrementalOffset=\fIpercent\fR
3447.RS 4
3448Sets 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
3449\fB\-XX:+CMSIncrementalMode\fR
3450option\&.
3451.RE
3452.PP
3453\-XX:+CMSIncrementalPacing
3454.RS 4
3455Enables 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
3456\fB\-XX:+CMSIncrementalMode\fR
3457option\&.
3458.RE
3459.PP
3460\-XX:CMSIncrementalSafetyFactor=\fIpercent\fR
3461.RS 4
3462Sets 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
3463\fB\-XX:+CMSIncrementalMode\fR
3464option\&.
3465.RE
3466.PP
3467\-XX:CMSInitiatingPermOccupancyFraction=\fIpercent\fR
3468.RS 4
rgallardb6435452013-11-25 20:19:02 -08003469Sets 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\&.
rgallardf71f2512015-02-02 10:12:21 -08003470.RE
3471.PP
3472\-XX:MaxPermSize=\fIsize\fR
3473.RS 4
3474Sets the maximum permanent generation space size (in bytes)\&. This option was deprecated in JDK 8, and superseded by the
3475\fB\-XX:MaxMetaspaceSize\fR
3476option\&.
3477.RE
3478.PP
3479\-XX:PermSize=\fIsize\fR
3480.RS 4
3481Sets 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
3482\fB\-XX:MetaspaceSize\fR
3483option\&.
3484.RE
3485.PP
3486\-XX:+UseSplitVerifier
3487.RS 4
rgallardb6435452013-11-25 20:19:02 -08003488Enables 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\&.
rgallardf71f2512015-02-02 10:12:21 -08003489.RE
3490.PP
3491\-XX:+UseStringCache
3492.RS 4
rgallardb6435452013-11-25 20:19:02 -08003493Enables caching of commonly allocated strings\&. This option was removed from JDK 8 with no replacement\&.
rgallardf71f2512015-02-02 10:12:21 -08003494.RE
3495.SH "PERFORMANCE TUNING EXAMPLES"
3496.PP
rgallardb6435452013-11-25 20:19:02 -08003497The following examples show how to use experimental tuning flags to either optimize throughput or to provide lower response time\&.
3498.PP
rgallardf71f2512015-02-02 10:12:21 -08003499\fBExample 1 \fRTuning for Higher Throughput
3500.RS 4
3501.sp
3502.if n \{\
3503.RS 4
3504.\}
3505.nf
3506\fBjava \-d64 \-server \-XX:+AggressiveOpts \-XX:+UseLargePages \-Xmn10g \-Xms26g \-Xmx26g\fR
3507
3508.fi
3509.if n \{\
3510.RE
3511.\}
3512.RE
rgallard36ba8532014-06-06 15:45:48 -07003513.PP
rgallardf71f2512015-02-02 10:12:21 -08003514\fBExample 2 \fRTuning for Lower Response Time
3515.RS 4
3516.sp
3517.if n \{\
3518.RS 4
3519.\}
3520.nf
3521\fBjava \-d64 \-XX:+UseG1GC \-Xms26g Xmx26g \-XX:MaxGCPauseMillis=500 \-XX:+PrintGCTimeStamp\fR
3522
3523.fi
3524.if n \{\
3525.RE
3526.\}
3527.RE
3528.SH "LARGE PAGES"
3529.PP
3530Also known as huge pages, large pages are memory pages that are significantly larger than the standard memory page size (which varies depending on the processor and operating system)\&. Large pages optimize processor Translation\-Lookaside Buffers\&.
3531.PP
3532A Translation\-Lookaside Buffer (TLB) is a page translation cache that holds the most\-recently used virtual\-to\-physical address translations\&. TLB is a scarce system resource\&. A TLB miss can be costly as the processor must then read from the hierarchical page table, which may require multiple memory accesses\&. By using a larger memory page size, a single TLB entry can represent a larger memory range\&. There will be less pressure on TLB, and memory\-intensive applications may have better performance\&.
rgallard36ba8532014-06-06 15:45:48 -07003533.PP
rgallard04b0ca42014-10-17 11:33:22 -07003534However, large pages page memory can negatively affect system performance\&. For example, when a large mount of memory is pinned by an application, it may create a shortage of regular memory and cause excessive paging in other applications and slow down the entire system\&. Also, a system that has been up for a long time could produce excessive fragmentation, which could make it impossible to reserve enough large page memory\&. When this happens, either the OS or JVM reverts to using regular pages\&.
rgallardf71f2512015-02-02 10:12:21 -08003535.SS "Large Pages Support"
3536.PP
rgallard04b0ca42014-10-17 11:33:22 -07003537Solaris and Linux support large pages\&.
rgallardf71f2512015-02-02 10:12:21 -08003538.sp
3539.it 1 an-trap
3540.nr an-no-space-flag 1
3541.nr an-break-flag 1
3542.br
3543.ps +1
3544\fBSolaris\fR
3545.RS 4
rgallard04b0ca42014-10-17 11:33:22 -07003546.PP
rgallardf71f2512015-02-02 10:12:21 -08003547Solaris 9 and later include Multiple Page Size Support (MPSS); no additional configuration is necessary\&. See http://www\&.oracle\&.com/technetwork/server\-storage/solaris10/overview/solaris9\-features\-scalability\-135663\&.html\&.
3548.RE
3549.sp
3550.it 1 an-trap
3551.nr an-no-space-flag 1
3552.nr an-break-flag 1
3553.br
3554.ps +1
3555\fBLinux\fR
3556.RS 4
rgallard04b0ca42014-10-17 11:33:22 -07003557.PP
rgallardf71f2512015-02-02 10:12:21 -08003558The 2\&.6 kernel supports large pages\&. Some vendors have backported the code to their 2\&.4\-based releases\&. To check if your system can support large page memory, try the following:
3559.sp
3560.if n \{\
3561.RS 4
3562.\}
3563.nf
3564\fB# cat /proc/meminfo | grep Huge\fR
3565\fBHugePages_Total: 0\fR
3566\fBHugePages_Free: 0\fR
3567\fBHugepagesize: 2048 kB\fR
3568
3569.fi
3570.if n \{\
3571.RE
3572.\}
rgallard04b0ca42014-10-17 11:33:22 -07003573.PP
rgallardf71f2512015-02-02 10:12:21 -08003574If the output shows the three "Huge" variables, then your system can support large page memory but it needs to be configured\&. If the command prints nothing, then your system does not support large pages\&. To configure the system to use large page memory, login as
3575\fBroot\fR, and then follow these steps:
3576.sp
3577.RS 4
3578.ie n \{\
3579\h'-04' 1.\h'+01'\c
3580.\}
3581.el \{\
3582.sp -1
3583.IP " 1." 4.2
3584.\}
3585If you are using the option
3586\fB\-XX:+UseSHM\fR
3587(instead of
3588\fB\-XX:+UseHugeTLBFS\fR), then increase the
3589\fBSHMMAX\fR
3590value\&. It must be larger than the Java heap size\&. On a system with 4 GB of physical RAM (or less), the following will make all the memory sharable:
3591.sp
3592.if n \{\
3593.RS 4
3594.\}
3595.nf
3596\fB# echo 4294967295 > /proc/sys/kernel/shmmax\fR
3597
3598.fi
3599.if n \{\
3600.RE
3601.\}
3602.RE
3603.sp
3604.RS 4
3605.ie n \{\
3606\h'-04' 2.\h'+01'\c
3607.\}
3608.el \{\
3609.sp -1
3610.IP " 2." 4.2
3611.\}
3612If you are using the option
3613\fB\-XX:+UseSHM\fR
3614or
3615\fB\-XX:+UseHugeTLBFS\fR, then specify the number of large pages\&. In the following example, 3 GB of a 4 GB system are reserved for large pages (assuming a large page size of 2048kB, then 3 GB = 3 * 1024 MB = 3072 MB = 3072 * 1024 kB = 3145728 kB and 3145728 kB / 2048 kB = 1536):
3616.sp
3617.if n \{\
3618.RS 4
3619.\}
3620.nf
3621\fB# echo 1536 > /proc/sys/vm/nr_hugepages\fR
3622
3623.fi
3624.if n \{\
3625.RE
3626.\}
3627.RE
3628.if n \{\
3629.sp
3630.\}
3631.RS 4
3632.it 1 an-trap
3633.nr an-no-space-flag 1
3634.nr an-break-flag 1
3635.br
3636.ps +1
3637\fBNote\fR
3638.ps -1
3639.br
3640.TS
3641allbox tab(:);
3642l.
3643T{
3644.sp
3645.RS 4
3646.ie n \{\
3647\h'-04'\(bu\h'+03'\c
3648.\}
3649.el \{\
3650.sp -1
3651.IP \(bu 2.3
3652.\}
3653Note that the values contained in
3654\fB/proc\fR
3655will reset after you reboot your system, so may want to set them in an initialization script (for example,
3656\fBrc\&.local\fR
3657or
3658\fBsysctl\&.conf\fR)\&.
3659.RE
3660.sp
3661.RS 4
3662.ie n \{\
3663\h'-04'\(bu\h'+03'\c
3664.\}
3665.el \{\
3666.sp -1
3667.IP \(bu 2.3
3668.\}
3669If you configure (or resize) the OS kernel parameters
3670\fB/proc/sys/kernel/shmmax\fR
3671or
3672\fB/proc/sys/vm/nr_hugepages\fR, Java processes may allocate large pages for areas in addition to the Java heap\&. These steps can allocate large pages for the following areas:
3673.sp
3674.RS 4
3675.ie n \{\
3676\h'-04'\(bu\h'+03'\c
3677.\}
3678.el \{\
3679.sp -1
3680.IP \(bu 2.3
3681.\}
rgallard04b0ca42014-10-17 11:33:22 -07003682Java heap
rgallardf71f2512015-02-02 10:12:21 -08003683.RE
3684.sp
3685.RS 4
3686.ie n \{\
3687\h'-04'\(bu\h'+03'\c
3688.\}
3689.el \{\
3690.sp -1
3691.IP \(bu 2.3
3692.\}
rgallard04b0ca42014-10-17 11:33:22 -07003693Code cache
rgallardf71f2512015-02-02 10:12:21 -08003694.RE
3695.sp
3696.RS 4
3697.ie n \{\
3698\h'-04'\(bu\h'+03'\c
3699.\}
3700.el \{\
3701.sp -1
3702.IP \(bu 2.3
3703.\}
rgallard04b0ca42014-10-17 11:33:22 -07003704The marking bitmap data structure for the parallel GC
rgallardf71f2512015-02-02 10:12:21 -08003705.RE
3706.sp
3707Consequently, if you configure the
3708\fBnr_hugepages\fR
3709parameter to the size of the Java heap, then the JVM can fail in allocating the code cache areas on large pages because these areas are quite large in size\&.
3710.RE
3711T}
3712.TE
3713.sp 1
3714.sp .5v
3715.RE
3716.RE
3717.SH "EXIT STATUS"
rgallard04b0ca42014-10-17 11:33:22 -07003718.PP
rgallardf71f2512015-02-02 10:12:21 -08003719The 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
3720\fBSystem\&.exit(exitValue)\fR\&. The values are:
3721.sp
3722.RS 4
3723.ie n \{\
3724\h'-04'\(bu\h'+03'\c
3725.\}
3726.el \{\
3727.sp -1
3728.IP \(bu 2.3
3729.\}
3730\fB0\fR: Successful completion
3731.RE
3732.sp
3733.RS 4
3734.ie n \{\
3735\h'-04'\(bu\h'+03'\c
3736.\}
3737.el \{\
3738.sp -1
3739.IP \(bu 2.3
3740.\}
3741\fB>0\fR: An error occurred
3742.RE
3743.SH "SEE ALSO"
3744.sp
3745.RS 4
3746.ie n \{\
3747\h'-04'\(bu\h'+03'\c
3748.\}
3749.el \{\
3750.sp -1
3751.IP \(bu 2.3
3752.\}
rgallardb6435452013-11-25 20:19:02 -08003753javac(1)
rgallardf71f2512015-02-02 10:12:21 -08003754.RE
3755.sp
3756.RS 4
3757.ie n \{\
3758\h'-04'\(bu\h'+03'\c
3759.\}
3760.el \{\
3761.sp -1
3762.IP \(bu 2.3
3763.\}
rgallardb6435452013-11-25 20:19:02 -08003764jdb(1)
rgallardf71f2512015-02-02 10:12:21 -08003765.RE
3766.sp
3767.RS 4
3768.ie n \{\
3769\h'-04'\(bu\h'+03'\c
3770.\}
3771.el \{\
3772.sp -1
3773.IP \(bu 2.3
3774.\}
rgallardb6435452013-11-25 20:19:02 -08003775javah(1)
rgallardf71f2512015-02-02 10:12:21 -08003776.RE
3777.sp
3778.RS 4
3779.ie n \{\
3780\h'-04'\(bu\h'+03'\c
3781.\}
3782.el \{\
3783.sp -1
3784.IP \(bu 2.3
3785.\}
rgallardb6435452013-11-25 20:19:02 -08003786jar(1)
rgallardf71f2512015-02-02 10:12:21 -08003787.RE
3788.sp
3789.RS 4
3790.ie n \{\
3791\h'-04'\(bu\h'+03'\c
3792.\}
3793.el \{\
3794.sp -1
3795.IP \(bu 2.3
3796.\}
rgallard04b0ca42014-10-17 11:33:22 -07003797jstat(1)
rgallardf71f2512015-02-02 10:12:21 -08003798.RE
3799.br
3800'pl 8.5i
3801'bp