blob: 09cd1f6855e3c7237e2bc1bebdb0474bee7a53c8 [file] [log] [blame]
rgallardb6435452013-11-25 20:19:02 -08001'\" t
mfangfbb44202015-06-25 16:46:26 -07002.\" Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved. DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
rgallardf71f2512015-02-02 10:12:21 -08003.\"
4.\" This code is free software; you can redistribute it and/or modify it
5.\" under the terms of the GNU General Public License version 2 only, as
6.\" published by the Free Software Foundation.
7.\"
8.\" This code is distributed in the hope that it will be useful, but WITHOUT
9.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11.\" version 2 for more details (a copy is included in the LICENSE file that
12.\" accompanied this code).
13.\"
14.\" You should have received a copy of the GNU General Public License version
15.\" 2 along with this work; if not, write to the Free Software Foundation,
16.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17.\"
18.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19.\" or visit www.oracle.com if you need additional information or have any
20.\" questions.
21.\"
22.\" Title: java
23.\" Language: English
24.\" Date: 03 March 2015
25.\" SectDesc: Basic Tools
26.\" Software: JDK 8
27.\" Arch: generic
28.\" Part Number: E38207-04
29.\" Doc ID: JSSON
rgallardb6435452013-11-25 20:19:02 -080030.\"
31.if n .pl 99999
rgallardf71f2512015-02-02 10:12:21 -080032.TH "java" "1" "03 March 2015" "JDK 8" "Basic Tools"
33.\" -----------------------------------------------------------------
34.\" * Define some portability stuff
35.\" -----------------------------------------------------------------
36.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37.\" http://bugs.debian.org/507673
38.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
39.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40.ie \n(.g .ds Aq \(aq
41.el .ds Aq '
42.\" -----------------------------------------------------------------
43.\" * set default formatting
44.\" -----------------------------------------------------------------
45.\" disable hyphenation
46.nh
47.\" disable justification (adjust text to left margin only)
48.ad l
49.\" -----------------------------------------------------------------
50.\" * MAIN CONTENT STARTS HERE *
51.\" -----------------------------------------------------------------
52.SH "NAME"
rgallardb6435452013-11-25 20:19:02 -080053java \- Launches a Java application\&.
rgallardf71f2512015-02-02 10:12:21 -080054.SH "SYNOPSIS"
55.sp
56.if n \{\
57.RS 4
58.\}
59.nf
rgallardb6435452013-11-25 20:19:02 -080060\fBjava\fR [\fIoptions\fR] \fIclassname\fR [\fIargs\fR]
rgallardf71f2512015-02-02 10:12:21 -080061.fi
62.if n \{\
63.RE
64.\}
65.sp
66.if n \{\
67.RS 4
68.\}
69.nf
rgallardb6435452013-11-25 20:19:02 -080070\fBjava\fR [\fIoptions\fR] \fB\-jar\fR \fIfilename\fR [\fIargs\fR]
rgallardf71f2512015-02-02 10:12:21 -080071.fi
72.if n \{\
73.RE
74.\}
rgallard36ba8532014-06-06 15:45:48 -070075.PP
rgallardf71f2512015-02-02 10:12:21 -080076\fIoptions\fR
77.RS 4
78Command\-line options separated by spaces\&. See Options\&.
79.RE
80.PP
81\fIclassname\fR
82.RS 4
83The name of the class to be launched\&.
84.RE
85.PP
86\fIfilename\fR
87.RS 4
88The name of the Java Archive (JAR) file to be called\&. Used only with the
89\fB\-jar\fR
90option\&.
91.RE
92.PP
93\fIargs\fR
94.RS 4
95The arguments passed to the
96\fBmain()\fR
97method separated by spaces\&.
98.RE
99.SH "DESCRIPTION"
100.PP
101The
102\fBjava\fR
103command starts a Java application\&. It does this by starting the Java Runtime Environment (JRE), loading the specified class, and calling that class\*(Aqs
104\fBmain()\fR
105method\&. The method must be declared
106\fIpublic\fR
107and
108\fIstatic\fR, it must not return any value, and it must accept a
109\fBString\fR
110array as a parameter\&. The method declaration has the following form:
111.sp
112.if n \{\
113.RS 4
114.\}
115.nf
116\fBpublic static void main(String[] args)\fR
117
118.fi
119.if n \{\
120.RE
121.\}
122.PP
123The
124\fBjava\fR
125command can be used to launch a JavaFX application by loading a class that either has a
126\fBmain()\fR
127method or that extends
128\fBjavafx\&.application\&.Application\fR\&. In the latter case, the launcher constructs an instance of the
129\fBApplication\fR
130class, calls its
131\fBinit()\fR
132method, and then calls the
133\fBstart(javafx\&.stage\&.Stage)\fR
134method\&.
135.PP
136By default, the first argument that is not an option of the
137\fBjava\fR
138command is the fully qualified name of the class to be called\&. If the
139\fB\-jar\fR
140option 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
141\fBMain\-Class\fR
142manifest header in its source code\&.
rgallardb6435452013-11-25 20:19:02 -0800143.PP
144The 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\&.
145.PP
rgallardf71f2512015-02-02 10:12:21 -0800146Arguments after the class file name or the JAR file name are passed to the
147\fBmain()\fR
148method\&.
149.SH "OPTIONS"
150.PP
151The
152\fBjava\fR
153command supports a wide range of options that can be divided into the following categories:
154.sp
155.RS 4
156.ie n \{\
157\h'-04'\(bu\h'+03'\c
158.\}
159.el \{\
160.sp -1
161.IP \(bu 2.3
162.\}
rgallardb6435452013-11-25 20:19:02 -0800163Standard Options
rgallardf71f2512015-02-02 10:12:21 -0800164.RE
165.sp
166.RS 4
167.ie n \{\
168\h'-04'\(bu\h'+03'\c
169.\}
170.el \{\
171.sp -1
172.IP \(bu 2.3
173.\}
174Non\-Standard Options
175.RE
176.sp
177.RS 4
178.ie n \{\
179\h'-04'\(bu\h'+03'\c
180.\}
181.el \{\
182.sp -1
183.IP \(bu 2.3
184.\}
rgallardb6435452013-11-25 20:19:02 -0800185Advanced Runtime Options
rgallardf71f2512015-02-02 10:12:21 -0800186.RE
187.sp
188.RS 4
189.ie n \{\
190\h'-04'\(bu\h'+03'\c
191.\}
192.el \{\
193.sp -1
194.IP \(bu 2.3
195.\}
rgallardb6435452013-11-25 20:19:02 -0800196Advanced JIT Compiler Options
rgallardf71f2512015-02-02 10:12:21 -0800197.RE
198.sp
199.RS 4
200.ie n \{\
201\h'-04'\(bu\h'+03'\c
202.\}
203.el \{\
204.sp -1
205.IP \(bu 2.3
206.\}
rgallardb6435452013-11-25 20:19:02 -0800207Advanced Serviceability Options
rgallardf71f2512015-02-02 10:12:21 -0800208.RE
209.sp
210.RS 4
211.ie n \{\
212\h'-04'\(bu\h'+03'\c
213.\}
214.el \{\
215.sp -1
216.IP \(bu 2.3
217.\}
rgallardb6435452013-11-25 20:19:02 -0800218Advanced Garbage Collection Options
rgallardf71f2512015-02-02 10:12:21 -0800219.RE
rgallardb6435452013-11-25 20:19:02 -0800220.PP
221Standard 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\&.
222.PP
rgallardf71f2512015-02-02 10:12:21 -0800223Non\-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
224\fB\-X\fR\&.
rgallardb6435452013-11-25 20:19:02 -0800225.PP
rgallardf71f2512015-02-02 10:12:21 -0800226Advanced 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
227\fB\-XX\fR\&.
rgallardb6435452013-11-25 20:19:02 -0800228.PP
229To 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\&.
230.PP
rgallardf71f2512015-02-02 10:12:21 -0800231Boolean 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
232\fB\-XX\fR
233options 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 -0800234.PP
rgallardf71f2512015-02-02 10:12:21 -0800235For 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
236\fBk\fR
237or
238\fBK\fR
239for kilobytes (KB),
240\fBm\fR
241or
242\fBM\fR
243for megabytes (MB),
244\fBg\fR
245or
246\fBG\fR
247for gigabytes (GB)\&. For example, to set the size to 8 GB, you can specify either
248\fB8g\fR,
249\fB8192m\fR,
250\fB8388608k\fR, or
251\fB8589934592\fR
252as the argument\&. If you are expected to specify the percentage, use a number from 0 to 1 (for example, specify
253\fB0\&.25\fR
254for 25%)\&.
255.SS "Standard Options"
256.PP
rgallardb6435452013-11-25 20:19:02 -0800257These are the most commonly used options that are supported by all implementations of the JVM\&.
rgallardf71f2512015-02-02 10:12:21 -0800258.PP
259\-agentlib:\fIlibname\fR[=\fIoptions\fR]
260.RS 4
261Loads the specified native agent library\&. After the library name, a comma\-separated list of options specific to the library can be used\&.
262.sp
263If the option
264\fB\-agentlib:foo\fR
265is specified, then the JVM attempts to load the library named
266\fBlibfoo\&.so\fR
267in the location specified by the
268\fBLD_LIBRARY_PATH\fR
269system variable (on OS X this variable is
270\fBDYLD_LIBRARY_PATH\fR)\&.
271.sp
rgallardb6435452013-11-25 20:19:02 -0800272The 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 -0800273.sp
274.if n \{\
275.RS 4
276.\}
277.nf
278\fB\-agentlib:hprof=cpu=samples,interval=20,depth=3\fR
279
280.fi
281.if n \{\
282.RE
283.\}
rgallardb6435452013-11-25 20:19:02 -0800284The 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 -0800285.sp
286.if n \{\
287.RS 4
288.\}
289.nf
290\fB\-agentlib:jdwp=transport=dt_socket,server=y,address=8000\fR
291
292.fi
293.if n \{\
294.RE
295.\}
rgallardb6435452013-11-25 20:19:02 -0800296For more information about the native agent libraries, refer to the following:
rgallardf71f2512015-02-02 10:12:21 -0800297.sp
298.RS 4
299.ie n \{\
300\h'-04'\(bu\h'+03'\c
301.\}
302.el \{\
303.sp -1
304.IP \(bu 2.3
305.\}
306The
307\fBjava\&.lang\&.instrument\fR
308package description at http://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package\-summary\&.html
309.RE
310.sp
311.RS 4
312.ie n \{\
313\h'-04'\(bu\h'+03'\c
314.\}
315.el \{\
316.sp -1
317.IP \(bu 2.3
318.\}
rgallardb6435452013-11-25 20:19:02 -0800319Agent 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 -0800320.RE
321.RE
322.PP
323\-agentpath:\fIpathname\fR[=\fIoptions\fR]
324.RS 4
325Loads the native agent library specified by the absolute path name\&. This option is equivalent to
326\fB\-agentlib\fR
327but uses the full path and file name of the library\&.
328.RE
329.PP
330\-client
331.RS 4
332Selects 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\&.
333.sp
334For default JVM selection, see Server\-Class Machine Detection at
335http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/server\-class\&.html
336.RE
337.PP
338\-D\fIproperty\fR=\fIvalue\fR
339.RS 4
340Sets a system property value\&. The
341\fIproperty\fR
342variable is a string with no spaces that represents the name of the property\&. The
343\fIvalue\fR
344variable is a string that represents the value of the property\&. If
345\fIvalue\fR
346is a string with spaces, then enclose it in quotation marks (for example
347\fB\-Dfoo="foo bar"\fR)\&.
348.RE
349.PP
350\-d32
351.RS 4
352Runs 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\&.
353.RE
354.PP
355\-d64
356.RS 4
357Runs 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\&.
358.sp
359Currently only the Java HotSpot Server VM supports 64\-bit operation, and the
360\fB\-server\fR
361option is implicit with the use of
362\fB\-d64\fR\&. The
363\fB\-client\fR
364option is ignored with the use of
365\fB\-d64\fR\&. This is subject to change in a future release\&.
366.RE
367.PP
368\-disableassertions[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
rgallardb6435452013-11-25 20:19:02 -0800369.br
rgallardf71f2512015-02-02 10:12:21 -0800370\-da[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
371.RS 4
rgallardb6435452013-11-25 20:19:02 -0800372Disables assertions\&. By default, assertions are disabled in all packages and classes\&.
rgallardf71f2512015-02-02 10:12:21 -0800373.sp
374With no arguments,
375\fB\-disableassertions\fR
376(\fB\-da\fR) disables assertions in all packages and classes\&. With the
377\fIpackagename\fR
378argument ending in
379\fB\&.\&.\&.\fR, the switch disables assertions in the specified package and any subpackages\&. If the argument is simply
380\fB\&.\&.\&.\fR, then the switch disables assertions in the unnamed package in the current working directory\&. With the
381\fIclassname\fR
382argument, the switch disables assertions in the specified class\&.
383.sp
384The
385\fB\-disableassertions\fR
386(\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
387\fB\-disablesystemassertions\fR
388option enables you to disable assertions in all system classes\&.
389.sp
390To explicitly enable assertions in specific packages or classes, use the
391\fB\-enableassertions\fR
392(\fB\-ea\fR) option\&. Both options can be used at the same time\&. For example, to run the
393\fBMyClass\fR
394application with assertions enabled in package
395\fBcom\&.wombat\&.fruitbat\fR
396(and any subpackages) but disabled in class
397\fBcom\&.wombat\&.fruitbat\&.Brickbat\fR, use the following command:
398.sp
399.if n \{\
400.RS 4
401.\}
rgallard04b0ca42014-10-17 11:33:22 -0700402.nf
rgallardf71f2512015-02-02 10:12:21 -0800403\fBjava \-ea:com\&.wombat\&.fruitbat\&.\&.\&. \-da:com\&.wombat\&.fruitbat\&.Brickbat MyClass\fR
404
rgallard04b0ca42014-10-17 11:33:22 -0700405.fi
rgallardf71f2512015-02-02 10:12:21 -0800406.if n \{\
407.RE
408.\}
409.RE
410.PP
411\-disablesystemassertions
412.br
413\-dsa
414.RS 4
415Disables assertions in all system classes\&.
416.RE
417.PP
418\-enableassertions[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
419.br
420\-ea[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR]
421.RS 4
rgallardb6435452013-11-25 20:19:02 -0800422Enables assertions\&. By default, assertions are disabled in all packages and classes\&.
rgallardf71f2512015-02-02 10:12:21 -0800423.sp
424With no arguments,
425\fB\-enableassertions\fR
426(\fB\-ea\fR) enables assertions in all packages and classes\&. With the
427\fIpackagename\fR
428argument ending in
429\fB\&.\&.\&.\fR, the switch enables assertions in the specified package and any subpackages\&. If the argument is simply
430\fB\&.\&.\&.\fR, then the switch enables assertions in the unnamed package in the current working directory\&. With the
431\fIclassname\fR
432argument, the switch enables assertions in the specified class\&.
433.sp
434The
435\fB\-enableassertions\fR
436(\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
437\fB\-enablesystemassertions\fR
438option provides a separate switch to enable assertions in all system classes\&.
439.sp
440To explicitly disable assertions in specific packages or classes, use the
441\fB\-disableassertions\fR
442(\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
443\fBMyClass\fR
444application with assertions enabled only in package
445\fBcom\&.wombat\&.fruitbat\fR
446(and any subpackages) but disabled in class
447\fBcom\&.wombat\&.fruitbat\&.Brickbat\fR, use the following command:
448.sp
449.if n \{\
450.RS 4
451.\}
452.nf
453\fBjava \-ea:com\&.wombat\&.fruitbat\&.\&.\&. \-da:com\&.wombat\&.fruitbat\&.Brickbat MyClass\fR
454
455.fi
456.if n \{\
457.RE
458.\}
459.RE
460.PP
461\-enablesystemassertions
rgallardb6435452013-11-25 20:19:02 -0800462.br
rgallardf71f2512015-02-02 10:12:21 -0800463\-esa
464.RS 4
rgallardb6435452013-11-25 20:19:02 -0800465Enables assertions in all system classes\&.
rgallardf71f2512015-02-02 10:12:21 -0800466.RE
467.PP
468\-help
rgallardb6435452013-11-25 20:19:02 -0800469.br
rgallardf71f2512015-02-02 10:12:21 -0800470\-?
471.RS 4
472Displays usage information for the
473\fBjava\fR
474command without actually running the JVM\&.
475.RE
476.PP
477\-jar \fIfilename\fR
478.RS 4
479Executes a program encapsulated in a JAR file\&. The
480\fIfilename\fR
481argument is the name of a JAR file with a manifest that contains a line in the form
482\fBMain\-Class:\fR\fIclassname\fR
483that defines the class with the
484\fBpublic static void main(String[] args)\fR
485method that serves as your application\*(Aqs starting point\&.
486.sp
487When you use the
488\fB\-jar\fR
489option, the specified JAR file is the source of all user classes, and other class path settings are ignored\&.
490.sp
rgallardb6435452013-11-25 20:19:02 -0800491For more information about JAR files, see the following resources:
rgallardf71f2512015-02-02 10:12:21 -0800492.sp
493.RS 4
494.ie n \{\
495\h'-04'\(bu\h'+03'\c
496.\}
497.el \{\
498.sp -1
499.IP \(bu 2.3
500.\}
rgallardb6435452013-11-25 20:19:02 -0800501jar(1)
rgallardf71f2512015-02-02 10:12:21 -0800502.RE
503.sp
504.RS 4
505.ie n \{\
506\h'-04'\(bu\h'+03'\c
507.\}
508.el \{\
509.sp -1
510.IP \(bu 2.3
511.\}
rgallardb6435452013-11-25 20:19:02 -0800512The Java Archive (JAR) Files guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jar/index\&.html
rgallardf71f2512015-02-02 10:12:21 -0800513.RE
514.sp
515.RS 4
516.ie n \{\
517\h'-04'\(bu\h'+03'\c
518.\}
519.el \{\
520.sp -1
521.IP \(bu 2.3
522.\}
523Lesson: Packaging Programs in JAR Files at
rgallardb6435452013-11-25 20:19:02 -0800524
rgallardf71f2512015-02-02 10:12:21 -0800525http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.html
526.RE
527.RE
528.PP
529\-javaagent:\fIjarpath\fR[=\fIoptions\fR]
530.RS 4
531Loads the specified Java programming language agent\&. For more information about instrumenting Java applications, see the
532\fBjava\&.lang\&.instrument\fR
533package description in the Java API documentation at http://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package\-summary\&.html
534.RE
535.PP
536\-jre\-restrict\-search
537.RS 4
538Includes user\-private JREs in the version search\&.
539.RE
540.PP
541\-no\-jre\-restrict\-search
542.RS 4
543Excludes user\-private JREs from the version search\&.
544.RE
545.PP
546\-server
547.RS 4
548Selects 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\&.
549.sp
550For default JVM selection, see Server\-Class Machine Detection at
551http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/server\-class\&.html
552.RE
553.PP
554\-showversion
555.RS 4
556Displays version information and continues execution of the application\&. This option is equivalent to the
557\fB\-version\fR
558option except that the latter instructs the JVM to exit after displaying version information\&.
559.RE
560.PP
561\-splash:\fIimgname\fR
562.RS 4
563Shows the splash screen with the image specified by
564\fIimgname\fR\&. For example, to show the
565\fBsplash\&.gif\fR
566file from the
567\fBimages\fR
568directory when starting your application, use the following option:
569.sp
570.if n \{\
571.RS 4
572.\}
573.nf
574\fB\-splash:images/splash\&.gif\fR
575
576.fi
577.if n \{\
578.RE
579.\}
580.RE
581.PP
582\-verbose:class
583.RS 4
rgallardb6435452013-11-25 20:19:02 -0800584Displays information about each loaded class\&.
rgallardf71f2512015-02-02 10:12:21 -0800585.RE
586.PP
587\-verbose:gc
588.RS 4
rgallardb6435452013-11-25 20:19:02 -0800589Displays information about each garbage collection (GC) event\&.
rgallardf71f2512015-02-02 10:12:21 -0800590.RE
591.PP
592\-verbose:jni
593.RS 4
rgallardb6435452013-11-25 20:19:02 -0800594Displays information about the use of native methods and other Java Native Interface (JNI) activity\&.
rgallardf71f2512015-02-02 10:12:21 -0800595.RE
596.PP
597\-version
598.RS 4
599Displays version information and then exits\&. This option is equivalent to the
600\fB\-showversion\fR
601option except that the latter does not instruct the JVM to exit after displaying version information\&.
602.RE
603.PP
604\-version:\fIrelease\fR
605.RS 4
606Specifies the release version to be used for running the application\&. If the version of the
607\fBjava\fR
608command called does not meet this specification and an appropriate implementation is found on the system, then the appropriate implementation will be used\&.
609.sp
610The
611\fIrelease\fR
612argument specifies either the exact version string, or a list of version strings and ranges separated by spaces\&. A
613\fIversion string\fR
614is the developer designation of the version number in the following form:
615\fB1\&.\fR\fIx\fR\fB\&.0_\fR\fIu\fR
616(where
617\fIx\fR
618is the major version number, and
619\fIu\fR
620is the update version number)\&. A
621\fIversion range\fR
622is 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
623\fIOR\fR
624combination, or an ampersand (\fB&\fR) for a logical
625\fIAND\fR
626combination 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:
627.sp
628.if n \{\
629.RS 4
630.\}
631.nf
632\fB\-version:"1\&.6\&.0_13 1\&.6* & 1\&.6\&.0_10+"\fR
633
634.fi
635.if n \{\
636.RE
637.\}
638Quotation marks are necessary only if there are spaces in the
639\fIrelease\fR
640parameter\&.
641.sp
rgallardb6435452013-11-25 20:19:02 -0800642For 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 -0800643.RE
644.SS "Non\-Standard Options"
645.PP
rgallardb6435452013-11-25 20:19:02 -0800646These options are general purpose options that are specific to the Java HotSpot Virtual Machine\&.
rgallardf71f2512015-02-02 10:12:21 -0800647.PP
648\-X
649.RS 4
650Displays help for all available
651\fB\-X\fR
652options\&.
653.RE
654.PP
655\-Xbatch
656.RS 4
657Disables 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
658\fB\-Xbatch\fR
659flag disables background compilation so that compilation of all methods proceeds as a foreground task until completed\&.
660.sp
661This option is equivalent to
662\fB\-XX:\-BackgroundCompilation\fR\&.
663.RE
664.PP
665\-Xbootclasspath:\fIpath\fR
666.RS 4
rgallardb6435452013-11-25 20:19:02 -0800667Specifies 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 -0800668.sp
669Do not deploy applications that use this option to override a class in
670\fBrt\&.jar\fR, because this violates the JRE binary code license\&.
671.RE
672.PP
673\-Xbootclasspath/a:\fIpath\fR
674.RS 4
rgallardb6435452013-11-25 20:19:02 -0800675Specifies 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 -0800676.sp
677Do not deploy applications that use this option to override a class in
678\fBrt\&.jar\fR, because this violates the JRE binary code license\&.
679.RE
680.PP
681\-Xbootclasspath/p:\fIpath\fR
682.RS 4
rgallardb6435452013-11-25 20:19:02 -0800683Specifies 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 -0800684.sp
685Do not deploy applications that use this option to override a class in
686\fBrt\&.jar\fR, because this violates the JRE binary code license\&.
687.RE
688.PP
689\-Xcheck:jni
690.RS 4
rgallardb6435452013-11-25 20:19:02 -0800691Performs 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 -0800692.RE
693.PP
694\-Xcomp
695.RS 4
696Forces 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
697\fB\-Xcomp\fR
698option disables interpreted method invocations to increase compilation performance at the expense of efficiency\&.
699.sp
700You can also change the number of interpreted method invocations before compilation using the
701\fB\-XX:CompileThreshold\fR
702option\&.
703.RE
704.PP
705\-Xdebug
706.RS 4
rgallardb6435452013-11-25 20:19:02 -0800707Does nothing\&. Provided for backward compatibility\&.
rgallardf71f2512015-02-02 10:12:21 -0800708.RE
709.PP
710\-Xdiag
711.RS 4
rgallardb6435452013-11-25 20:19:02 -0800712Shows additional diagnostic messages\&.
rgallardf71f2512015-02-02 10:12:21 -0800713.RE
714.PP
715\-Xfuture
716.RS 4
717Enables 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\&.
718.RE
719.PP
720\-Xint
721.RS 4
722Runs 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\&.
723.RE
724.PP
725\-Xinternalversion
726.RS 4
727Displays more detailed JVM version information than the
728\fB\-version\fR
729option, and then exits\&.
730.RE
731.PP
732\-Xloggc:\fIfilename\fR
733.RS 4
734Sets 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
735\fB\-verbose:gc\fR
736with the time elapsed since the first GC event preceding each logged event\&. The
737\fB\-Xloggc\fR
738option overrides
739\fB\-verbose:gc\fR
740if both are given with the same
741\fBjava\fR
742command\&.
743.sp
rgallardb6435452013-11-25 20:19:02 -0800744Example:
rgallardf71f2512015-02-02 10:12:21 -0800745.sp
746.if n \{\
747.RS 4
748.\}
749.nf
750\fB\-Xloggc:garbage\-collection\&.log\fR
751
752.fi
753.if n \{\
754.RE
755.\}
756.RE
757.PP
758\-Xmaxjitcodesize=\fIsize\fR
759.RS 4
760Specifies the maximum code cache size (in bytes) for JIT\-compiled code\&. Append the letter
761\fBk\fR
762or
763\fBK\fR
764to indicate kilobytes,
765\fBm\fR
766or
767\fBM\fR
768to indicate megabytes,
769\fBg\fR
770or
771\fBG\fR
772to indicate gigabytes\&. The default maximum code cache size is 240 MB; if you disable tiered compilation with the option
773\fB\-XX:\-TieredCompilation\fR, then the default size is 48 MB:
774.sp
775.if n \{\
776.RS 4
777.\}
778.nf
779\fB\-Xmaxjitcodesize=240m\fR
780
781.fi
782.if n \{\
783.RE
784.\}
785This option is equivalent to
786\fB\-XX:ReservedCodeCacheSize\fR\&.
787.RE
788.PP
789\-Xmixed
790.RS 4
rgallardb6435452013-11-25 20:19:02 -0800791Executes all bytecode by the interpreter except for hot methods, which are compiled to native code\&.
rgallardf71f2512015-02-02 10:12:21 -0800792.RE
793.PP
794\-Xmn\fIsize\fR
795.RS 4
796Sets the initial and maximum size (in bytes) of the heap for the young generation (nursery)\&. Append the letter
797\fBk\fR
798or
799\fBK\fR
800to indicate kilobytes,
801\fBm\fR
802or
803\fBM\fR
804to indicate megabytes,
805\fBg\fR
806or
807\fBG\fR
808to indicate gigabytes\&.
809.sp
rgallardb6435452013-11-25 20:19:02 -0800810The 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 -0800811.sp
rgallardb6435452013-11-25 20:19:02 -0800812The 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 -0800813.sp
814.if n \{\
815.RS 4
816.\}
817.nf
818\fB\-Xmn256m\fR
819\fB\-Xmn262144k\fR
820\fB\-Xmn268435456\fR
821
822.fi
823.if n \{\
824.RE
825.\}
826Instead of the
827\fB\-Xmn\fR
828option to set both the initial and maximum size of the heap for the young generation, you can use
829\fB\-XX:NewSize\fR
830to set the initial size and
831\fB\-XX:MaxNewSize\fR
832to set the maximum size\&.
833.RE
834.PP
835\-Xms\fIsize\fR
836.RS 4
837Sets the initial size (in bytes) of the heap\&. This value must be a multiple of 1024 and greater than 1 MB\&. Append the letter
838\fBk\fR
839or
840\fBK\fR
841to indicate kilobytes,
842\fBm\fR
843or
844\fBM\fR
845to indicate megabytes,
846\fBg\fR
847or
848\fBG\fR
849to indicate gigabytes\&.
850.sp
rgallardb6435452013-11-25 20:19:02 -0800851The following examples show how to set the size of allocated memory to 6 MB using various units:
rgallardf71f2512015-02-02 10:12:21 -0800852.sp
853.if n \{\
854.RS 4
855.\}
856.nf
857\fB\-Xms6291456\fR
858\fB\-Xms6144k\fR
859\fB\-Xms6m\fR
860
861.fi
862.if n \{\
863.RE
864.\}
865If 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
866\fB\-Xmn\fR
867option or the
868\fB\-XX:NewSize\fR
869option\&.
870.RE
871.PP
872\-Xmx\fIsize\fR
873.RS 4
874Specifies 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
875\fBk\fR
876or
877\fBK\fR
878to indicate kilobytes,
879\fBm\fR
880or
881\fBM\fR
882to indicate megabytes,
883\fBg\fR
884or
885\fBG\fR
886to indicate gigabytes\&. The default value is chosen at runtime based on system configuration\&. For server deployments,
887\fB\-Xms\fR
888and
889\fB\-Xmx\fR
890are often set to the same value\&. See the section "Ergonomics" in
891\fIJava SE HotSpot Virtual Machine Garbage Collection Tuning Guide\fR
892at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gctuning/index\&.html\&.
893.sp
rgallardb6435452013-11-25 20:19:02 -0800894The 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 -0800895.sp
896.if n \{\
897.RS 4
898.\}
899.nf
900\fB\-Xmx83886080\fR
901\fB\-Xmx81920k\fR
902\fB\-Xmx80m\fR
903
904.fi
905.if n \{\
906.RE
907.\}
908The
909\fB\-Xmx\fR
910option is equivalent to
911\fB\-XX:MaxHeapSize\fR\&.
912.RE
913.PP
914\-Xnoclassgc
915.RS 4
rgallardb6435452013-11-25 20:19:02 -0800916Disables garbage collection (GC) of classes\&. This can save some GC time, which shortens interruptions during the application run\&.
rgallardf71f2512015-02-02 10:12:21 -0800917.sp
918When you specify
919\fB\-Xnoclassgc\fR
920at 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\&.
921.RE
922.PP
923\-Xprof
924.RS 4
rgallardb6435452013-11-25 20:19:02 -0800925Profiles 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 -0800926.RE
927.PP
928\-Xrs
929.RS 4
rgallardb6435452013-11-25 20:19:02 -0800930Reduces the use of operating system signals by the JVM\&.
rgallardf71f2512015-02-02 10:12:21 -0800931.sp
rgallardb6435452013-11-25 20:19:02 -0800932Shutdown 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 -0800933.sp
934The JVM catches signals to implement shutdown hooks for unexpected termination\&. The JVM uses
935\fBSIGHUP\fR,
936\fBSIGINT\fR, and
937\fBSIGTERM\fR
938to initiate the running of shutdown hooks\&.
939.sp
940The JVM uses a similar mechanism to implement the feature of dumping thread stacks for debugging purposes\&. The JVM uses
941\fBSIGQUIT\fR
942to perform thread dumps\&.
943.sp
944Applications embedding the JVM frequently need to trap signals such as
945\fBSIGINT\fR
946or
947\fBSIGTERM\fR, which can lead to interference with the JVM signal handlers\&. The
948\fB\-Xrs\fR
949option is available to address this issue\&. When
950\fB\-Xrs\fR
951is used, the signal masks for
952\fBSIGINT\fR,
953\fBSIGTERM\fR,
954\fBSIGHUP\fR, and
955\fBSIGQUIT\fR
956are not changed by the JVM, and signal handlers for these signals are not installed\&.
957.sp
958There are two consequences of specifying
959\fB\-Xrs\fR:
960.sp
961.RS 4
962.ie n \{\
963\h'-04'\(bu\h'+03'\c
964.\}
965.el \{\
966.sp -1
967.IP \(bu 2.3
968.\}
969\fBSIGQUIT\fR
970thread dumps are not available\&.
971.RE
972.sp
973.RS 4
974.ie n \{\
975\h'-04'\(bu\h'+03'\c
976.\}
977.el \{\
978.sp -1
979.IP \(bu 2.3
980.\}
981User code is responsible for causing shutdown hooks to run, for example, by calling
982\fBSystem\&.exit()\fR
983when the JVM is to be terminated\&.
984.RE
985.RE
986.PP
987\-Xshare:\fImode\fR
988.RS 4
989Sets the class data sharing (CDS) mode\&. Possible
990\fImode\fR
991arguments for this option include the following:
992.PP
rgallardb6435452013-11-25 20:19:02 -0800993auto
rgallardf71f2512015-02-02 10:12:21 -0800994.RS 4
995Use CDS if possible\&. This is the default value for Java HotSpot 32\-Bit Client VM\&.
996.RE
997.PP
rgallardb6435452013-11-25 20:19:02 -0800998on
rgallardf71f2512015-02-02 10:12:21 -0800999.RS 4
1000Require the use of CDS\&. Print an error message and exit if class data sharing cannot be used\&.
1001.RE
1002.PP
rgallardb6435452013-11-25 20:19:02 -08001003off
rgallardf71f2512015-02-02 10:12:21 -08001004.RS 4
1005Do 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\&.
1006.RE
1007.PP
rgallardb6435452013-11-25 20:19:02 -08001008dump
rgallardf71f2512015-02-02 10:12:21 -08001009.RS 4
1010Manually generate the CDS archive\&. Specify the application class path as described in "Setting the Class Path "\&.
1011.sp
1012You should regenerate the CDS archive with each new JDK release\&.
1013.RE
1014.RE
1015.PP
1016\-XshowSettings:\fIcategory\fR
1017.RS 4
1018Shows settings and continues\&. Possible
1019\fIcategory\fR
1020arguments for this option include the following:
1021.PP
rgallardb6435452013-11-25 20:19:02 -08001022all
rgallardf71f2512015-02-02 10:12:21 -08001023.RS 4
rgallardb6435452013-11-25 20:19:02 -08001024Shows all categories of settings\&. This is the default value\&.
rgallardf71f2512015-02-02 10:12:21 -08001025.RE
1026.PP
rgallardb6435452013-11-25 20:19:02 -08001027locale
rgallardf71f2512015-02-02 10:12:21 -08001028.RS 4
rgallardb6435452013-11-25 20:19:02 -08001029Shows settings related to locale\&.
rgallardf71f2512015-02-02 10:12:21 -08001030.RE
1031.PP
rgallardb6435452013-11-25 20:19:02 -08001032properties
rgallardf71f2512015-02-02 10:12:21 -08001033.RS 4
rgallardb6435452013-11-25 20:19:02 -08001034Shows settings related to system properties\&.
rgallardf71f2512015-02-02 10:12:21 -08001035.RE
1036.PP
rgallardb6435452013-11-25 20:19:02 -08001037vm
rgallardf71f2512015-02-02 10:12:21 -08001038.RS 4
rgallardb6435452013-11-25 20:19:02 -08001039Shows the settings of the JVM\&.
rgallardf71f2512015-02-02 10:12:21 -08001040.RE
1041.RE
1042.PP
1043\-Xss\fIsize\fR
1044.RS 4
1045Sets the thread stack size (in bytes)\&. Append the letter
1046\fBk\fR
1047or
1048\fBK\fR
1049to indicate KB,
1050\fBm\fR
1051or
1052\fBM\fR
1053to indicate MB,
1054\fBg\fR
1055or
1056\fBG\fR
1057to indicate GB\&. The default value depends on the platform:
1058.sp
1059.RS 4
1060.ie n \{\
1061\h'-04'\(bu\h'+03'\c
1062.\}
1063.el \{\
1064.sp -1
1065.IP \(bu 2.3
1066.\}
1067Linux/ARM (32\-bit): 320 KB
1068.RE
1069.sp
1070.RS 4
1071.ie n \{\
1072\h'-04'\(bu\h'+03'\c
1073.\}
1074.el \{\
1075.sp -1
1076.IP \(bu 2.3
1077.\}
1078Linux/i386 (32\-bit): 320 KB
1079.RE
1080.sp
1081.RS 4
1082.ie n \{\
1083\h'-04'\(bu\h'+03'\c
1084.\}
1085.el \{\
1086.sp -1
1087.IP \(bu 2.3
1088.\}
1089Linux/x64 (64\-bit): 1024 KB
1090.RE
1091.sp
1092.RS 4
1093.ie n \{\
1094\h'-04'\(bu\h'+03'\c
1095.\}
1096.el \{\
1097.sp -1
1098.IP \(bu 2.3
1099.\}
1100OS X (64\-bit): 1024 KB
1101.RE
1102.sp
1103.RS 4
1104.ie n \{\
1105\h'-04'\(bu\h'+03'\c
1106.\}
1107.el \{\
1108.sp -1
1109.IP \(bu 2.3
1110.\}
1111Oracle Solaris/i386 (32\-bit): 320 KB
1112.RE
1113.sp
1114.RS 4
1115.ie n \{\
1116\h'-04'\(bu\h'+03'\c
1117.\}
1118.el \{\
1119.sp -1
1120.IP \(bu 2.3
1121.\}
1122Oracle Solaris/x64 (64\-bit): 1024 KB
1123.RE
1124.sp
rgallardb6435452013-11-25 20:19:02 -08001125The following examples set the thread stack size to 1024 KB in different units:
rgallardf71f2512015-02-02 10:12:21 -08001126.sp
1127.if n \{\
1128.RS 4
1129.\}
1130.nf
1131\fB\-Xss1m\fR
1132\fB\-Xss1024k\fR
1133\fB\-Xss1048576\fR
1134
1135.fi
1136.if n \{\
1137.RE
1138.\}
1139This option is equivalent to
1140\fB\-XX:ThreadStackSize\fR\&.
1141.RE
1142.PP
1143\-Xusealtsigs
1144.RS 4
1145Use alternative signals instead of
1146\fBSIGUSR1\fR
1147and
1148\fBSIGUSR2\fR
1149for JVM internal signals\&. This option is equivalent to
1150\fB\-XX:+UseAltSigs\fR\&.
1151.RE
1152.PP
1153\-Xverify:\fImode\fR
1154.RS 4
1155Sets the mode of the bytecode verifier\&. Bytecode verification helps to troubleshoot some problems, but it also adds overhead to the running application\&. Possible
1156\fImode\fR
1157arguments for this option include the following:
1158.PP
rgallardb6435452013-11-25 20:19:02 -08001159none
rgallardf71f2512015-02-02 10:12:21 -08001160.RS 4
rgallardb6435452013-11-25 20:19:02 -08001161Do not verify the bytecode\&. This reduces startup time and also reduces the protection provided by Java\&.
rgallardf71f2512015-02-02 10:12:21 -08001162.RE
1163.PP
rgallardb6435452013-11-25 20:19:02 -08001164remote
rgallardf71f2512015-02-02 10:12:21 -08001165.RS 4
1166Verify those classes that are not loaded by the bootstrap class loader\&. This is the default behavior if you do not specify the
1167\fB\-Xverify\fR
1168option\&.
1169.RE
1170.PP
rgallardb6435452013-11-25 20:19:02 -08001171all
rgallardf71f2512015-02-02 10:12:21 -08001172.RS 4
rgallardb6435452013-11-25 20:19:02 -08001173Verify all classes\&.
rgallardf71f2512015-02-02 10:12:21 -08001174.RE
1175.RE
1176.SS "Advanced Runtime Options"
1177.PP
rgallardb6435452013-11-25 20:19:02 -08001178These options control the runtime behavior of the Java HotSpot VM\&.
rgallardf71f2512015-02-02 10:12:21 -08001179.PP
1180\-XX:+CheckEndorsedAndExtDirs
1181.RS 4
1182Enables the option to prevent the
1183\fBjava\fR
1184command 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:
1185.sp
1186.RS 4
1187.ie n \{\
1188\h'-04'\(bu\h'+03'\c
1189.\}
1190.el \{\
1191.sp -1
1192.IP \(bu 2.3
1193.\}
1194The
1195\fBjava\&.ext\&.dirs\fR
1196or
1197\fBjava\&.endorsed\&.dirs\fR
1198system property is set\&.
1199.RE
1200.sp
1201.RS 4
1202.ie n \{\
1203\h'-04'\(bu\h'+03'\c
1204.\}
1205.el \{\
1206.sp -1
1207.IP \(bu 2.3
1208.\}
1209The
1210\fBlib/endorsed\fR
1211directory exists and is not empty\&.
1212.RE
1213.sp
1214.RS 4
1215.ie n \{\
1216\h'-04'\(bu\h'+03'\c
1217.\}
1218.el \{\
1219.sp -1
1220.IP \(bu 2.3
1221.\}
1222The
1223\fBlib/ext\fR
1224directory contains any JAR files other than those of the JDK\&.
1225.RE
1226.sp
1227.RS 4
1228.ie n \{\
1229\h'-04'\(bu\h'+03'\c
1230.\}
1231.el \{\
1232.sp -1
1233.IP \(bu 2.3
1234.\}
1235The system\-wide platform\-specific extension directory contains any JAR files\&.
1236.RE
1237.RE
1238.PP
1239\-XX:+DisableAttachMechanism
1240.RS 4
1241Enables 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
1242\fBjcmd\fR,
1243\fBjstack\fR,
1244\fBjmap\fR, and
1245\fBjinfo\fR\&.
1246.RE
1247.PP
1248\-XX:ErrorFile=\fIfilename\fR
1249.RS 4
1250Specifies 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
1251\fBhs_err_pid\fR\fIpid\fR\fB\&.log\fR
1252where
1253\fIpid\fR
1254is 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
1255\fB%p\fR):
1256.sp
1257.if n \{\
1258.RS 4
1259.\}
1260.nf
1261\fB\-XX:ErrorFile=\&./hs_err_pid%p\&.log\fR
1262
1263.fi
1264.if n \{\
1265.RE
1266.\}
1267The following example shows how to set the error log to
1268\fB/var/log/java/java_error\&.log\fR:
1269.sp
1270.if n \{\
1271.RS 4
1272.\}
1273.nf
1274\fB\-XX:ErrorFile=/var/log/java/java_error\&.log\fR
1275
1276.fi
1277.if n \{\
1278.RE
1279.\}
1280If 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
1281\fB/tmp\fR\&.
1282.RE
1283.PP
1284\-XX:+FailOverToOldVerifier
1285.RS 4
rgallard36ba8532014-06-06 15:45:48 -07001286Enables 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 -08001287.RE
1288.PP
1289\-XX:LargePageSizeInBytes=\fIsize\fR
1290.RS 4
1291On Solaris, sets the maximum size (in bytes) for large pages used for Java heap\&. The
1292\fIsize\fR
1293argument must be a power of 2 (2, 4, 8, 16, \&.\&.\&.)\&. Append the letter
1294\fBk\fR
1295or
1296\fBK\fR
1297to indicate kilobytes,
1298\fBm\fR
1299or
1300\fBM\fR
1301to indicate megabytes,
1302\fBg\fR
1303or
1304\fBG\fR
1305to indicate gigabytes\&. By default, the size is set to 0, meaning that the JVM chooses the size for large pages automatically\&.
1306.sp
rgallardb6435452013-11-25 20:19:02 -08001307The following example illustrates how to set the large page size to 4 megabytes (MB):
rgallardf71f2512015-02-02 10:12:21 -08001308.sp
1309.if n \{\
1310.RS 4
1311.\}
1312.nf
1313\fB\-XX:LargePageSizeInBytes=4m\fR
1314
1315.fi
1316.if n \{\
1317.RE
1318.\}
1319.RE
1320.PP
1321\-XX:MaxDirectMemorySize=\fIsize\fR
1322.RS 4
1323Sets the maximum total size (in bytes) of the New I/O (the
1324\fBjava\&.nio\fR
1325package) direct\-buffer allocations\&. Append the letter
1326\fBk\fR
1327or
1328\fBK\fR
1329to indicate kilobytes,
1330\fBm\fR
1331or
1332\fBM\fR
1333to indicate megabytes,
1334\fBg\fR
1335or
1336\fBG\fR
1337to indicate gigabytes\&. By default, the size is set to 0, meaning that the JVM chooses the size for NIO direct\-buffer allocations automatically\&.
1338.sp
rgallardb6435452013-11-25 20:19:02 -08001339The following examples illustrate how to set the NIO size to 1024 KB in different units:
rgallardf71f2512015-02-02 10:12:21 -08001340.sp
1341.if n \{\
1342.RS 4
1343.\}
1344.nf
1345\fB\-XX:MaxDirectMemorySize=1m\fR
1346\fB\-XX:MaxDirectMemorySize=1024k\fR
1347\fB\-XX:MaxDirectMemorySize=1048576\fR
1348
1349.fi
1350.if n \{\
1351.RE
1352.\}
1353.RE
1354.PP
1355\-XX:NativeMemoryTracking=\fImode\fR
1356.RS 4
1357Specifies the mode for tracking JVM native memory usage\&. Possible
1358\fImode\fR
1359arguments for this option include the following:
1360.PP
rgallardb6435452013-11-25 20:19:02 -08001361off
rgallardf71f2512015-02-02 10:12:21 -08001362.RS 4
1363Do not track JVM native memory usage\&. This is the default behavior if you do not specify the
1364\fB\-XX:NativeMemoryTracking\fR
1365option\&.
1366.RE
1367.PP
rgallardb6435452013-11-25 20:19:02 -08001368summary
rgallardf71f2512015-02-02 10:12:21 -08001369.RS 4
rgallardb6435452013-11-25 20:19:02 -08001370Only track memory usage by JVM subsystems, such as Java heap, class, code, and thread\&.
rgallardf71f2512015-02-02 10:12:21 -08001371.RE
1372.PP
rgallardb6435452013-11-25 20:19:02 -08001373detail
rgallardf71f2512015-02-02 10:12:21 -08001374.RS 4
1375In addition to tracking memory usage by JVM subsystems, track memory usage by individual
1376\fBCallSite\fR, individual virtual memory region and its committed regions\&.
1377.RE
1378.RE
1379.PP
1380\-XX:ObjectAlignmentInBytes=\fIalignment\fR
1381.RS 4
rgallard04b0ca42014-10-17 11:33:22 -07001382Sets 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 -08001383.sp
rgallard04b0ca42014-10-17 11:33:22 -07001384The heap size limit in bytes is calculated as:
rgallardf71f2512015-02-02 10:12:21 -08001385.sp
1386\fB4GB * ObjectAlignmentInBytes\fR
1387.sp
rgallard04b0ca42014-10-17 11:33:22 -07001388Note: 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 -08001389.RE
1390.PP
1391\-XX:OnError=\fIstring\fR
1392.RS 4
1393Sets 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\&.
1394.sp
1395The following example shows how the
1396\fB\-XX:OnError\fR
1397option can be used to run the
1398\fBgcore\fR
1399command to create the core image, and the debugger is started to attach to the process in case of an irrecoverable error (the
1400\fB%p\fR
1401designates the current process):
1402.sp
1403.if n \{\
1404.RS 4
1405.\}
1406.nf
1407\fB\-XX:OnError="gcore %p;dbx \- %p"\fR
1408
1409.fi
1410.if n \{\
1411.RE
1412.\}
1413.RE
1414.PP
1415\-XX:OnOutOfMemoryError=\fIstring\fR
1416.RS 4
1417Sets a custom command or a series of semicolon\-separated commands to run when an
1418\fBOutOfMemoryError\fR
1419exception 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
1420\fB\-XX:OnError\fR
1421option\&.
1422.RE
1423.PP
1424\-XX:+PerfDataSaveToFile
1425.RS 4
1426If enabled, saves
1427jstat(1) binary data when the Java application exits\&. This binary data is saved in a file named
1428\fBhsperfdata_\fR\fI<pid>\fR, where
1429\fI<pid>\fR
1430is the process identifier of the Java application you ran\&. Use
1431\fBjstat\fR
1432to display the performance data contained in this file as follows:
1433.sp
1434.if n \{\
1435.RS 4
1436.\}
1437.nf
1438\fBjstat \-class file:///\fR\fB\fI<path>\fR\fR\fB/hsperfdata_\fR\fB\fI<pid>\fR\fR
1439\fBjstat \-gc file:///\fR\fB\fI<path>\fR\fR\fB/hsperfdata_\fR\fB\fI<pid>\fR\fR
1440.fi
1441.if n \{\
1442.RE
1443.\}
1444.RE
1445.PP
1446\-XX:+PrintCommandLineFlags
1447.RS 4
rgallardb6435452013-11-25 20:19:02 -08001448Enables 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 -08001449.RE
1450.PP
1451\-XX:+PrintNMTStatistics
1452.RS 4
1453Enables printing of collected native memory tracking data at JVM exit when native memory tracking is enabled (see
1454\fB\-XX:NativeMemoryTracking\fR)\&. By default, this option is disabled and native memory tracking data is not printed\&.
1455.RE
1456.PP
1457\-XX:+RelaxAccessControlCheck
1458.RS 4
rgallard36ba8532014-06-06 15:45:48 -07001459Decreases 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 -08001460.RE
1461.PP
1462\-XX:+ShowMessageBoxOnError
1463.RS 4
rgallardb6435452013-11-25 20:19:02 -08001464Enables 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 -08001465.RE
1466.PP
1467\-XX:ThreadStackSize=\fIsize\fR
1468.RS 4
1469Sets the thread stack size (in bytes)\&. Append the letter
1470\fBk\fR
1471or
1472\fBK\fR
1473to indicate kilobytes,
1474\fBm\fR
1475or
1476\fBM\fR
1477to indicate megabytes,
1478\fBg\fR
1479or
1480\fBG\fR
1481to indicate gigabytes\&. The default value depends on the platform:
1482.sp
1483.RS 4
1484.ie n \{\
1485\h'-04'\(bu\h'+03'\c
1486.\}
1487.el \{\
1488.sp -1
1489.IP \(bu 2.3
1490.\}
1491Linux/ARM (32\-bit): 320 KB
1492.RE
1493.sp
1494.RS 4
1495.ie n \{\
1496\h'-04'\(bu\h'+03'\c
1497.\}
1498.el \{\
1499.sp -1
1500.IP \(bu 2.3
1501.\}
1502Linux/i386 (32\-bit): 320 KB
1503.RE
1504.sp
1505.RS 4
1506.ie n \{\
1507\h'-04'\(bu\h'+03'\c
1508.\}
1509.el \{\
1510.sp -1
1511.IP \(bu 2.3
1512.\}
1513Linux/x64 (64\-bit): 1024 KB
1514.RE
1515.sp
1516.RS 4
1517.ie n \{\
1518\h'-04'\(bu\h'+03'\c
1519.\}
1520.el \{\
1521.sp -1
1522.IP \(bu 2.3
1523.\}
1524OS X (64\-bit): 1024 KB
1525.RE
1526.sp
1527.RS 4
1528.ie n \{\
1529\h'-04'\(bu\h'+03'\c
1530.\}
1531.el \{\
1532.sp -1
1533.IP \(bu 2.3
1534.\}
1535Oracle Solaris/i386 (32\-bit): 320 KB
1536.RE
1537.sp
1538.RS 4
1539.ie n \{\
1540\h'-04'\(bu\h'+03'\c
1541.\}
1542.el \{\
1543.sp -1
1544.IP \(bu 2.3
1545.\}
1546Oracle Solaris/x64 (64\-bit): 1024 KB
1547.RE
1548.sp
rgallardb6435452013-11-25 20:19:02 -08001549The following examples show how to set the thread stack size to 1024 KB in different units:
rgallardf71f2512015-02-02 10:12:21 -08001550.sp
1551.if n \{\
1552.RS 4
1553.\}
1554.nf
1555\fB\-XX:ThreadStackSize=1m\fR
1556\fB\-XX:ThreadStackSize=1024k\fR
1557\fB\-XX:ThreadStackSize=1048576\fR
1558
1559.fi
1560.if n \{\
1561.RE
1562.\}
1563This option is equivalent to
1564\fB\-Xss\fR\&.
1565.RE
1566.PP
1567\-XX:+TraceClassLoading
1568.RS 4
rgallardb6435452013-11-25 20:19:02 -08001569Enables tracing of classes as they are loaded\&. By default, this option is disabled and classes are not traced\&.
rgallardf71f2512015-02-02 10:12:21 -08001570.RE
1571.PP
1572\-XX:+TraceClassLoadingPreorder
1573.RS 4
rgallardb6435452013-11-25 20:19:02 -08001574Enables 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 -08001575.RE
1576.PP
1577\-XX:+TraceClassResolution
1578.RS 4
rgallardb6435452013-11-25 20:19:02 -08001579Enables tracing of constant pool resolutions\&. By default, this option is disabled and constant pool resolutions are not traced\&.
rgallardf71f2512015-02-02 10:12:21 -08001580.RE
1581.PP
1582\-XX:+TraceClassUnloading
1583.RS 4
rgallardb6435452013-11-25 20:19:02 -08001584Enables tracing of classes as they are unloaded\&. By default, this option is disabled and classes are not traced\&.
rgallardf71f2512015-02-02 10:12:21 -08001585.RE
1586.PP
1587\-XX:+TraceLoaderConstraints
1588.RS 4
rgallard36ba8532014-06-06 15:45:48 -07001589Enables 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 -08001590.RE
1591.PP
1592\-XX:+UseAltSigs
1593.RS 4
1594Enables the use of alternative signals instead of
1595\fBSIGUSR1\fR
1596and
1597\fBSIGUSR2\fR
1598for JVM internal signals\&. By default, this option is disabled and alternative signals are not used\&. This option is equivalent to
1599\fB\-Xusealtsigs\fR\&.
1600.RE
1601.PP
1602\-XX:\-UseBiasedLocking
1603.RS 4
1604Disables 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
1605.sp
rgallard36ba8532014-06-06 15:45:48 -07001606By default, this option is enabled\&.
rgallardf71f2512015-02-02 10:12:21 -08001607.RE
1608.PP
1609\-XX:\-UseCompressedOops
1610.RS 4
1611Disables 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\&.
1612.sp
1613It is also possible to use compressed pointers when Java heap sizes are greater than 32GB\&. See the
1614\fB\-XX:ObjectAlignmentInBytes\fR
1615option\&.
1616.RE
1617.PP
1618\-XX:+UseHugeTLBFS
1619.RS 4
1620This option for Linux is the equivalent of specifying
1621\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
1622\fB\-XX:UseTransparentHugePages\fR
1623if you want this behavior\&.
1624.sp
1625For more information, see "Large Pages"\&.
1626.RE
1627.PP
1628\-XX:+UseLargePages
1629.RS 4
rgallard04b0ca42014-10-17 11:33:22 -07001630Enables 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 -08001631.sp
1632For more information, see "Large Pages"\&.
1633.RE
1634.PP
1635\-XX:+UseMembar
1636.RS 4
rgallard36ba8532014-06-06 15:45:48 -07001637Enables 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 -08001638.RE
1639.PP
1640\-XX:+UsePerfData
1641.RS 4
1642Enables the
1643\fBperfdata\fR
1644feature\&. This option is enabled by default to allow JVM monitoring and performance testing\&. Disabling it suppresses the creation of the
1645\fBhsperfdata_userid\fR
1646directories\&. To disable the
1647\fBperfdata\fR
1648feature, specify
1649\fB\-XX:\-UsePerfData\fR\&.
1650.RE
1651.PP
1652\-XX:+UseTransparentHugePages
1653.RS 4
rgallard04b0ca42014-10-17 11:33:22 -07001654On 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 -08001655.sp
1656For more information, see "Large Pages"\&.
1657.RE
1658.PP
1659\-XX:+AllowUserSignalHandlers
1660.RS 4
rgallardb6435452013-11-25 20:19:02 -08001661Enables 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 -08001662.RE
1663.SS "Advanced JIT Compiler Options"
1664.PP
1665These options control the dynamic just\-in\-time (JIT) compilation performed by the Java HotSpot VM\&.
1666.PP
1667\-XX:+AggressiveOpts
1668.RS 4
rgallardb6435452013-11-25 20:19:02 -08001669Enables 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 -08001670.RE
1671.PP
1672\-XX:AllocateInstancePrefetchLines=\fIlines\fR
1673.RS 4
rgallardb6435452013-11-25 20:19:02 -08001674Sets 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 -08001675.sp
1676.if n \{\
1677.RS 4
1678.\}
1679.nf
1680\fB\-XX:AllocateInstancePrefetchLines=1\fR
1681
1682.fi
1683.if n \{\
1684.RE
1685.\}
rgallard36ba8532014-06-06 15:45:48 -07001686Only the Java HotSpot Server VM supports this option\&.
rgallardf71f2512015-02-02 10:12:21 -08001687.RE
1688.PP
1689\-XX:AllocatePrefetchDistance=\fIsize\fR
1690.RS 4
rgallardb6435452013-11-25 20:19:02 -08001691Sets 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 -08001692.sp
1693Negative values denote that prefetch distance is chosen based on the platform\&. Positive values are bytes to prefetch\&. Append the letter
1694\fBk\fR
1695or
1696\fBK\fR
1697to indicate kilobytes,
1698\fBm\fR
1699or
1700\fBM\fR
1701to indicate megabytes,
1702\fBg\fR
1703or
1704\fBG\fR
1705to indicate gigabytes\&. The default value is set to \-1\&.
1706.sp
rgallardb6435452013-11-25 20:19:02 -08001707The following example shows how to set the prefetch distance to 1024 bytes:
rgallardf71f2512015-02-02 10:12:21 -08001708.sp
1709.if n \{\
1710.RS 4
1711.\}
1712.nf
1713\fB\-XX:AllocatePrefetchDistance=1024\fR
1714
1715.fi
1716.if n \{\
1717.RE
1718.\}
rgallard36ba8532014-06-06 15:45:48 -07001719Only the Java HotSpot Server VM supports this option\&.
rgallardf71f2512015-02-02 10:12:21 -08001720.RE
1721.PP
1722\-XX:AllocatePrefetchInstr=\fIinstruction\fR
1723.RS 4
rgallard36ba8532014-06-06 15:45:48 -07001724Sets 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 -08001725.sp
1726.if n \{\
1727.RS 4
1728.\}
1729.nf
1730\fB\-XX:AllocatePrefetchInstr=0\fR
1731
1732.fi
1733.if n \{\
1734.RE
1735.\}
rgallard36ba8532014-06-06 15:45:48 -07001736Only the Java HotSpot Server VM supports this option\&.
rgallardf71f2512015-02-02 10:12:21 -08001737.RE
1738.PP
1739\-XX:AllocatePrefetchLines=\fIlines\fR
1740.RS 4
rgallardb6435452013-11-25 20:19:02 -08001741Sets 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 -08001742.sp
rgallardb6435452013-11-25 20:19:02 -08001743The following example shows how to set the number of loaded cache lines to 5:
rgallardf71f2512015-02-02 10:12:21 -08001744.sp
1745.if n \{\
1746.RS 4
1747.\}
1748.nf
1749\fB\-XX:AllocatePrefetchLines=5\fR
1750
1751.fi
1752.if n \{\
1753.RE
1754.\}
rgallard36ba8532014-06-06 15:45:48 -07001755Only the Java HotSpot Server VM supports this option\&.
rgallardf71f2512015-02-02 10:12:21 -08001756.RE
1757.PP
1758\-XX:AllocatePrefetchStepSize=\fIsize\fR
1759.RS 4
1760Sets the step size (in bytes) for sequential prefetch instructions\&. Append the letter
1761\fBk\fR
1762or
1763\fBK\fR
1764to indicate kilobytes,
1765\fBm\fR
1766or
1767\fBM\fR
1768to indicate megabytes,
1769\fBg\fR
1770or
1771\fBG\fR
1772to indicate gigabytes\&. By default, the step size is set to 16 bytes:
1773.sp
1774.if n \{\
1775.RS 4
1776.\}
1777.nf
1778\fB\-XX:AllocatePrefetchStepSize=16\fR
1779
1780.fi
1781.if n \{\
1782.RE
1783.\}
rgallard36ba8532014-06-06 15:45:48 -07001784Only the Java HotSpot Server VM supports this option\&.
rgallardf71f2512015-02-02 10:12:21 -08001785.RE
1786.PP
1787\-XX:AllocatePrefetchStyle=\fIstyle\fR
1788.RS 4
1789Sets the generated code style for prefetch instructions\&. The
1790\fIstyle\fR
1791argument is an integer from 0 to 3:
1792.PP
rgallardb6435452013-11-25 20:19:02 -080017930
rgallardf71f2512015-02-02 10:12:21 -08001794.RS 4
rgallardb6435452013-11-25 20:19:02 -08001795Do not generate prefetch instructions\&.
rgallardf71f2512015-02-02 10:12:21 -08001796.RE
1797.PP
rgallardb6435452013-11-25 20:19:02 -080017981
rgallardf71f2512015-02-02 10:12:21 -08001799.RS 4
rgallardb6435452013-11-25 20:19:02 -08001800Execute prefetch instructions after each allocation\&. This is the default parameter\&.
rgallardf71f2512015-02-02 10:12:21 -08001801.RE
1802.PP
rgallardb6435452013-11-25 20:19:02 -080018032
rgallardf71f2512015-02-02 10:12:21 -08001804.RS 4
1805Use the thread\-local allocation block (TLAB) watermark pointer to determine when prefetch instructions are executed\&.
1806.RE
1807.PP
rgallardb6435452013-11-25 20:19:02 -080018083
rgallardf71f2512015-02-02 10:12:21 -08001809.RS 4
rgallardb6435452013-11-25 20:19:02 -08001810Use BIS instruction on SPARC for allocation prefetch\&.
rgallardf71f2512015-02-02 10:12:21 -08001811.RE
1812.sp
rgallard36ba8532014-06-06 15:45:48 -07001813Only the Java HotSpot Server VM supports this option\&.
rgallardf71f2512015-02-02 10:12:21 -08001814.RE
1815.PP
1816\-XX:+BackgroundCompilation
1817.RS 4
1818Enables background compilation\&. This option is enabled by default\&. To disable background compilation, specify
1819\fB\-XX:\-BackgroundCompilation\fR
1820(this is equivalent to specifying
1821\fB\-Xbatch\fR)\&.
1822.RE
1823.PP
1824\-XX:CICompilerCount=\fIthreads\fR
1825.RS 4
rgallard36ba8532014-06-06 15:45:48 -07001826Sets 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 -08001827.sp
1828.if n \{\
1829.RS 4
1830.\}
1831.nf
1832\fB\-XX:CICompilerCount=2\fR
1833
1834.fi
1835.if n \{\
1836.RE
1837.\}
1838.RE
1839.PP
1840\-XX:CodeCacheMinimumFreeSpace=\fIsize\fR
1841.RS 4
1842Sets the minimum free space (in bytes) required for compilation\&. Append the letter
1843\fBk\fR
1844or
1845\fBK\fR
1846to indicate kilobytes,
1847\fBm\fR
1848or
1849\fBM\fR
1850to indicate megabytes,
1851\fBg\fR
1852or
1853\fBG\fR
1854to 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:
1855.sp
1856.if n \{\
1857.RS 4
1858.\}
1859.nf
1860\fB\-XX:CodeCacheMinimumFreeSpace=1024m\fR
1861
1862.fi
1863.if n \{\
1864.RE
1865.\}
1866.RE
1867.PP
1868\-XX:CompileCommand=\fIcommand\fR,\fImethod\fR[,\fIoption\fR]
1869.RS 4
1870Specifies a command to perform on a method\&. For example, to exclude the
1871\fBindexOf()\fR
1872method of the
1873\fBString\fR
1874class from being compiled, use the following:
1875.sp
1876.if n \{\
1877.RS 4
1878.\}
1879.nf
1880\fB\-XX:CompileCommand=exclude,java/lang/String\&.indexOf\fR
1881
1882.fi
1883.if n \{\
1884.RE
1885.\}
1886Note 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
1887\fB\-XX:+PrintCompilation\fR
1888and
1889\fB\-XX:+LogCompilation\fR
1890options:
1891.sp
1892.if n \{\
1893.RS 4
1894.\}
1895.nf
1896\fB\-XX:CompileCommand=exclude,java\&.lang\&.String::indexOf\fR
1897
1898.fi
1899.if n \{\
1900.RE
1901.\}
1902If 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
1903\fBindexOf(String)\fR
1904method of the
1905\fBString\fR
1906class from being compiled, use the following:
1907.sp
1908.if n \{\
1909.RS 4
1910.\}
1911.nf
1912\fB\-XX:CompileCommand="exclude,java/lang/String\&.indexOf,(Ljava/lang/String;)I"\fR
1913
1914.fi
1915.if n \{\
1916.RE
1917.\}
1918You can also use the asterisk (*) as a wildcard for class and method names\&. For example, to exclude all
1919\fBindexOf()\fR
1920methods in all classes from being compiled, use the following:
1921.sp
1922.if n \{\
1923.RS 4
1924.\}
1925.nf
1926\fB\-XX:CompileCommand=exclude,*\&.indexOf\fR
1927
1928.fi
1929.if n \{\
1930.RE
1931.\}
1932The commas and periods are aliases for spaces, making it easier to pass compiler commands through a shell\&. You can pass arguments to
1933\fB\-XX:CompileCommand\fR
1934using spaces as separators by enclosing the argument in quotation marks:
1935.sp
1936.if n \{\
1937.RS 4
1938.\}
1939.nf
1940\fB\-XX:CompileCommand="exclude java/lang/String indexOf"\fR
1941
1942.fi
1943.if n \{\
1944.RE
1945.\}
1946Note that after parsing the commands passed on the command line using the
1947\fB\-XX:CompileCommand\fR
1948options, the JIT compiler then reads commands from the
1949\fB\&.hotspot_compiler\fR
1950file\&. You can add commands to this file or specify a different file using the
1951\fB\-XX:CompileCommandFile\fR
1952option\&.
1953.sp
1954To add several commands, either specify the
1955\fB\-XX:CompileCommand\fR
1956option multiple times, or separate each argument with the newline separator (\fB\en\fR)\&. The following commands are available:
1957.PP
rgallard36ba8532014-06-06 15:45:48 -07001958break
rgallardf71f2512015-02-02 10:12:21 -08001959.RS 4
rgallard36ba8532014-06-06 15:45:48 -07001960Set a breakpoint when debugging the JVM to stop at the beginning of compilation of the specified method\&.
rgallardf71f2512015-02-02 10:12:21 -08001961.RE
1962.PP
rgallard36ba8532014-06-06 15:45:48 -07001963compileonly
rgallardf71f2512015-02-02 10:12:21 -08001964.RS 4
1965Exclude all methods from compilation except for the specified method\&. As an alternative, you can use the
1966\fB\-XX:CompileOnly\fR
1967option, which allows to specify several methods\&.
1968.RE
1969.PP
rgallard36ba8532014-06-06 15:45:48 -07001970dontinline
rgallardf71f2512015-02-02 10:12:21 -08001971.RS 4
rgallard36ba8532014-06-06 15:45:48 -07001972Prevent inlining of the specified method\&.
rgallardf71f2512015-02-02 10:12:21 -08001973.RE
1974.PP
rgallard36ba8532014-06-06 15:45:48 -07001975exclude
rgallardf71f2512015-02-02 10:12:21 -08001976.RS 4
rgallard36ba8532014-06-06 15:45:48 -07001977Exclude the specified method from compilation\&.
rgallardf71f2512015-02-02 10:12:21 -08001978.RE
1979.PP
rgallard36ba8532014-06-06 15:45:48 -07001980help
rgallardf71f2512015-02-02 10:12:21 -08001981.RS 4
1982Print a help message for the
1983\fB\-XX:CompileCommand\fR
1984option\&.
1985.RE
1986.PP
rgallard36ba8532014-06-06 15:45:48 -07001987inline
rgallardf71f2512015-02-02 10:12:21 -08001988.RS 4
rgallard36ba8532014-06-06 15:45:48 -07001989Attempt to inline the specified method\&.
rgallardf71f2512015-02-02 10:12:21 -08001990.RE
1991.PP
rgallard36ba8532014-06-06 15:45:48 -07001992log
rgallardf71f2512015-02-02 10:12:21 -08001993.RS 4
1994Exclude compilation logging (with the
1995\fB\-XX:+LogCompilation\fR
1996option) for all methods except for the specified method\&. By default, logging is performed for all compiled methods\&.
1997.RE
1998.PP
rgallard36ba8532014-06-06 15:45:48 -07001999option
rgallardf71f2512015-02-02 10:12:21 -08002000.RS 4
2001This 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
2002\fBBlockLayoutByFrequency\fR
2003option for the
2004\fBappend()\fR
2005method of the
2006\fBStringBuffer\fR
2007class, use the following:
2008.sp
2009.if n \{\
2010.RS 4
2011.\}
2012.nf
2013\fB\-XX:CompileCommand=option,java/lang/StringBuffer\&.append,BlockLayoutByFrequency\fR
2014
2015.fi
2016.if n \{\
2017.RE
2018.\}
rgallard36ba8532014-06-06 15:45:48 -07002019You can specify multiple compilation options, separated by commas or spaces\&.
rgallardf71f2512015-02-02 10:12:21 -08002020.RE
2021.PP
rgallard36ba8532014-06-06 15:45:48 -07002022print
rgallardf71f2512015-02-02 10:12:21 -08002023.RS 4
rgallard36ba8532014-06-06 15:45:48 -07002024Print generated assembler code after compilation of the specified method\&.
rgallardf71f2512015-02-02 10:12:21 -08002025.RE
2026.PP
rgallard36ba8532014-06-06 15:45:48 -07002027quiet
rgallardf71f2512015-02-02 10:12:21 -08002028.RS 4
2029Do not print the compile commands\&. By default, the commands that you specify with the \-\fBXX:CompileCommand\fR
2030option are printed; for example, if you exclude from compilation the
2031\fBindexOf()\fR
2032method of the
2033\fBString\fR
2034class, then the following will be printed to standard output:
2035.sp
2036.if n \{\
2037.RS 4
2038.\}
2039.nf
2040\fBCompilerOracle: exclude java/lang/String\&.indexOf\fR
2041
2042.fi
2043.if n \{\
2044.RE
2045.\}
2046You can suppress this by specifying the
2047\fB\-XX:CompileCommand=quiet\fR
2048option before other
2049\fB\-XX:CompileCommand\fR
2050options\&.
2051.RE
2052.RE
2053.PP
2054\-XX:CompileCommandFile=\fIfilename\fR
2055.RS 4
2056Sets the file from which JIT compiler commands are read\&. By default, the
2057\fB\&.hotspot_compiler\fR
2058file is used to store commands performed by the JIT compiler\&.
2059.sp
2060Each 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
2061\fBtoString()\fR
2062method of the
2063\fBString\fR
2064class:
2065.sp
2066.if n \{\
2067.RS 4
2068.\}
2069.nf
2070\fBprint java/lang/String toString\fR
2071
2072.fi
2073.if n \{\
2074.RE
2075.\}
2076For more information about specifying the commands for the JIT compiler to perform on methods, see the
2077\fB\-XX:CompileCommand\fR
2078option\&.
2079.RE
2080.PP
2081\-XX:CompileOnly=\fImethods\fR
2082.RS 4
2083Sets 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
2084\fBlength()\fR
2085method of the
2086\fBString\fR
2087class and the
2088\fBsize()\fR
2089method of the
2090\fBList\fR
2091class, use the following:
2092.sp
2093.if n \{\
2094.RS 4
2095.\}
2096.nf
2097\fB\-XX:CompileOnly=java/lang/String\&.length,java/util/List\&.size\fR
2098
2099.fi
2100.if n \{\
2101.RE
2102.\}
2103Note 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
2104\fB\-XX:+PrintCompilation\fR
2105and
2106\fB\-XX:+LogCompilation\fR
2107options:
2108.sp
2109.if n \{\
2110.RS 4
2111.\}
2112.nf
2113\fB\-XX:CompileOnly=java\&.lang\&.String::length,java\&.util\&.List::size\fR
2114
2115.fi
2116.if n \{\
2117.RE
2118.\}
rgallard36ba8532014-06-06 15:45:48 -07002119Although 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 -08002120.sp
2121.if n \{\
2122.RS 4
2123.\}
2124.nf
2125\fB\-XX:CompileOnly=java/lang/String\fR
2126\fB\-XX:CompileOnly=java/lang\fR
2127\fB\-XX:CompileOnly=\&.length\fR
2128
2129.fi
2130.if n \{\
2131.RE
2132.\}
2133.RE
2134.PP
2135\-XX:CompileThreshold=\fIinvocations\fR
2136.RS 4
2137Sets 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
2138\fB\-XX:+TieredCompilation\fR\&. The following example shows how to set the number of interpreted method invocations to 5,000:
2139.sp
2140.if n \{\
2141.RS 4
2142.\}
2143.nf
2144\fB\-XX:CompileThreshold=5000\fR
2145
2146.fi
2147.if n \{\
2148.RE
2149.\}
2150You can completely disable interpretation of Java methods before compilation by specifying the
2151\fB\-Xcomp\fR
2152option\&.
2153.RE
2154.PP
2155\-XX:+DoEscapeAnalysis
2156.RS 4
2157Enables the use of escape analysis\&. This option is enabled by default\&. To disable the use of escape analysis, specify
2158\fB\-XX:\-DoEscapeAnalysis\fR\&. Only the Java HotSpot Server VM supports this option\&.
2159.RE
2160.PP
2161\-XX:InitialCodeCacheSize=\fIsize\fR
2162.RS 4
2163Sets the initial code cache size (in bytes)\&. Append the letter
2164\fBk\fR
2165or
2166\fBK\fR
2167to indicate kilobytes,
2168\fBm\fR
2169or
2170\fBM\fR
2171to indicate megabytes,
2172\fBg\fR
2173or
2174\fBG\fR
2175to 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:
2176.sp
2177.if n \{\
2178.RS 4
2179.\}
2180.nf
2181\fB\-XX:InitialCodeCacheSize=32k\fR
2182
2183.fi
2184.if n \{\
2185.RE
2186.\}
2187.RE
2188.PP
2189\-XX:+Inline
2190.RS 4
2191Enables method inlining\&. This option is enabled by default to increase performance\&. To disable method inlining, specify
2192\fB\-XX:\-Inline\fR\&.
2193.RE
2194.PP
2195\-XX:InlineSmallCode=\fIsize\fR
2196.RS 4
2197Sets the maximum code size (in bytes) for compiled methods that should be inlined\&. Append the letter
2198\fBk\fR
2199or
2200\fBK\fR
2201to indicate kilobytes,
2202\fBm\fR
2203or
2204\fBM\fR
2205to indicate megabytes,
2206\fBg\fR
2207or
2208\fBG\fR
2209to 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:
2210.sp
2211.if n \{\
2212.RS 4
2213.\}
2214.nf
2215\fB\-XX:InlineSmallCode=1000\fR
2216
2217.fi
2218.if n \{\
2219.RE
2220.\}
2221.RE
2222.PP
2223\-XX:+LogCompilation
2224.RS 4
2225Enables logging of compilation activity to a file named
2226\fBhotspot\&.log\fR
2227in the current working directory\&. You can specify a different log file path and name using the
2228\fB\-XX:LogFile\fR
2229option\&.
2230.sp
2231By default, this option is disabled and compilation activity is not logged\&. The
2232\fB\-XX:+LogCompilation\fR
2233option has to be used together with the
2234\fB\-XX:UnlockDiagnosticVMOptions\fR
2235option that unlocks diagnostic JVM options\&.
2236.sp
2237You can enable verbose diagnostic output with a message printed to the console every time a method is compiled by using the
2238\fB\-XX:+PrintCompilation\fR
2239option\&.
2240.RE
2241.PP
2242\-XX:MaxInlineSize=\fIsize\fR
2243.RS 4
2244Sets the maximum bytecode size (in bytes) of a method to be inlined\&. Append the letter
2245\fBk\fR
2246or
2247\fBK\fR
2248to indicate kilobytes,
2249\fBm\fR
2250or
2251\fBM\fR
2252to indicate megabytes,
2253\fBg\fR
2254or
2255\fBG\fR
2256to indicate gigabytes\&. By default, the maximum bytecode size is set to 35 bytes:
2257.sp
2258.if n \{\
2259.RS 4
2260.\}
2261.nf
2262\fB\-XX:MaxInlineSize=35\fR
2263
2264.fi
2265.if n \{\
2266.RE
2267.\}
2268.RE
2269.PP
2270\-XX:MaxNodeLimit=\fInodes\fR
2271.RS 4
rgallard36ba8532014-06-06 15:45:48 -07002272Sets 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 -08002273.sp
2274.if n \{\
2275.RS 4
2276.\}
2277.nf
2278\fB\-XX:MaxNodeLimit=65000\fR
2279
2280.fi
2281.if n \{\
2282.RE
2283.\}
2284.RE
2285.PP
2286\-XX:MaxTrivialSize=\fIsize\fR
2287.RS 4
2288Sets the maximum bytecode size (in bytes) of a trivial method to be inlined\&. Append the letter
2289\fBk\fR
2290or
2291\fBK\fR
2292to indicate kilobytes,
2293\fBm\fR
2294or
2295\fBM\fR
2296to indicate megabytes,
2297\fBg\fR
2298or
2299\fBG\fR
2300to indicate gigabytes\&. By default, the maximum bytecode size of a trivial method is set to 6 bytes:
2301.sp
2302.if n \{\
2303.RS 4
2304.\}
2305.nf
2306\fB\-XX:MaxTrivialSize=6\fR
2307
2308.fi
2309.if n \{\
2310.RE
2311.\}
2312.RE
2313.PP
2314\-XX:+OptimizeStringConcat
2315.RS 4
2316Enables the optimization of
2317\fBString\fR
2318concatenation operations\&. This option is enabled by default\&. To disable the optimization of
2319\fBString\fR
2320concatenation operations, specify
2321\fB\-XX:\-OptimizeStringConcat\fR\&. Only the Java HotSpot Server VM supports this option\&.
2322.RE
2323.PP
2324\-XX:+PrintAssembly
2325.RS 4
2326Enables printing of assembly code for bytecoded and native methods by using the external
2327\fBdisassembler\&.so\fR
2328library\&. This enables you to see the generated code, which may help you to diagnose performance issues\&.
2329.sp
2330By default, this option is disabled and assembly code is not printed\&. The
2331\fB\-XX:+PrintAssembly\fR
2332option has to be used together with the
2333\fB\-XX:UnlockDiagnosticVMOptions\fR
2334option that unlocks diagnostic JVM options\&.
2335.RE
2336.PP
2337\-XX:+PrintCompilation
2338.RS 4
rgallard36ba8532014-06-06 15:45:48 -07002339Enables 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 -08002340.sp
2341You can also log compilation activity to a file by using the
2342\fB\-XX:+LogCompilation\fR
2343option\&.
2344.RE
2345.PP
2346\-XX:+PrintInlining
2347.RS 4
rgallard36ba8532014-06-06 15:45:48 -07002348Enables printing of inlining decisions\&. This enables you to see which methods are getting inlined\&.
rgallardf71f2512015-02-02 10:12:21 -08002349.sp
2350By default, this option is disabled and inlining information is not printed\&. The
2351\fB\-XX:+PrintInlining\fR
2352option has to be used together with the
2353\fB\-XX:+UnlockDiagnosticVMOptions\fR
2354option that unlocks diagnostic JVM options\&.
2355.RE
2356.PP
2357\-XX:ReservedCodeCacheSize=\fIsize\fR
2358.RS 4
2359Sets the maximum code cache size (in bytes) for JIT\-compiled code\&. Append the letter
2360\fBk\fR
2361or
2362\fBK\fR
2363to indicate kilobytes,
2364\fBm\fR
2365or
2366\fBM\fR
2367to indicate megabytes,
2368\fBg\fR
2369or
2370\fBG\fR
2371to indicate gigabytes\&. The default maximum code cache size is 240 MB; if you disable tiered compilation with the option
2372\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
2373\fB\-XX:InitialCodeCacheSize\fR\&. This option is equivalent to
2374\fB\-Xmaxjitcodesize\fR\&.
2375.RE
2376.PP
2377\-XX:RTMAbortRatio=\fIabort_ratio\fR
2378.RS 4
2379The 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
2380\fB\-XX:+UseRTMDeopt\fR
2381option 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\&.
2382.RE
2383.PP
2384\-XX:RTMRetryCount=\fInumber_of_retries\fR
2385.RS 4
2386RTM 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
2387\fB\-XX:UseRTMLocking\fR
2388option must be enabled\&.
2389.RE
2390.PP
2391\-XX:\-TieredCompilation
2392.RS 4
2393Disables the use of tiered compilation\&. By default, this option is enabled\&. Only the Java HotSpot Server VM supports this option\&.
2394.RE
2395.PP
2396\-XX:+UseAES
2397.RS 4
2398Enables 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\&.
2399.RE
2400.PP
2401\-XX:+UseAESIntrinsics
2402.RS 4
2403UseAES 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
2404\fB\-XX:\-UseAES \-XX:\-UseAESIntrinsics\fR\&. For example, to enable hardware AES, use the following flags:
2405.sp
2406.if n \{\
2407.RS 4
2408.\}
2409.nf
2410\fB\-XX:+UseAES \-XX:+UseAESIntrinsics\fR
2411
2412.fi
2413.if n \{\
2414.RE
2415.\}
2416To support UseAES and UseAESIntrinsics flags for 32\-bit and 64\-bit use
2417\fB\-server\fR
2418option to choose Java HotSpot Server VM\&. These flags are not supported on Client VM\&.
2419.RE
2420.PP
2421\-XX:+UseCodeCacheFlushing
2422.RS 4
2423Enables 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
2424\fB\-XX:\-UseCodeCacheFlushing\fR\&.
2425.RE
2426.PP
2427\-XX:+UseCondCardMark
2428.RS 4
rgallard36ba8532014-06-06 15:45:48 -07002429Enables 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 -08002430.RE
2431.PP
2432\-XX:+UseRTMDeopt
2433.RS 4
2434Auto\-tunes RTM locking depending on the abort ratio\&. This ratio is specified by
2435\fB\-XX:RTMAbortRatio\fR
2436option\&. 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
2437\fB\-XX:+UseRTMLocking\fR
2438option must be enabled\&.
2439.RE
2440.PP
2441\-XX:+UseRTMLocking
2442.RS 4
rgallard04b0ca42014-10-17 11:33:22 -07002443Generate 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 -08002444.sp
2445RTM 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
2446\fBXBEGIN\fR,
2447\fBXABORT\fR,
2448\fBXEND\fR, and
2449\fBXTEST\fR\&. The
2450\fBXBEGIN\fR
2451and
2452\fBXEND\fR
2453instructions 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
2454\fBXEND\fR
2455instruction\&. The
2456\fBXABORT\fR
2457instruction can be used to explicitly abort a transaction and the
2458\fBXEND\fR
2459instruction to check if a set of instructions are being run in a transaction\&.
2460.sp
2461A 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\&.
2462.sp
2463RTM 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\&.
2464.RE
2465.PP
2466\-XX:+UseSHA
2467.RS 4
2468Enables hardware\-based intrinsics for SHA crypto hash functions for SPARC hardware\&.
2469\fBUseSHA\fR
2470is used in conjunction with the
2471\fBUseSHA1Intrinsics\fR,
2472\fBUseSHA256Intrinsics\fR, and
2473\fBUseSHA512Intrinsics\fR
2474options\&.
2475.sp
2476The
2477\fBUseSHA\fR
2478and
2479\fBUseSHA*Intrinsics\fR
2480flags are enabled by default, and are supported only for Java HotSpot Server VM 64\-bit on SPARC T4 and newer\&.
2481.sp
2482This feature is only applicable when using the
2483\fBsun\&.security\&.provider\&.Sun\fR
2484provider for SHA operations\&.
2485.sp
2486To disable all hardware\-based SHA intrinsics, specify
2487\fB\-XX:\-UseSHA\fR\&. To disable only a particular SHA intrinsic, use the appropriate corresponding option\&. For example:
2488\fB\-XX:\-UseSHA256Intrinsics\fR\&.
2489.RE
2490.PP
2491\-XX:+UseSHA1Intrinsics
2492.RS 4
2493Enables intrinsics for SHA\-1 crypto hash function\&.
2494.RE
2495.PP
2496\-XX:+UseSHA256Intrinsics
2497.RS 4
2498Enables intrinsics for SHA\-224 and SHA\-256 crypto hash functions\&.
2499.RE
2500.PP
2501\-XX:+UseSHA512Intrinsics
2502.RS 4
2503Enables intrinsics for SHA\-384 and SHA\-512 crypto hash functions\&.
2504.RE
2505.PP
2506\-XX:+UseSuperWord
2507.RS 4
2508Enables 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
2509\fB\-XX:\-UseSuperWord\fR\&. Only the Java HotSpot Server VM supports this option\&.
2510.RE
2511.SS "Advanced Serviceability Options"
2512.PP
rgallard36ba8532014-06-06 15:45:48 -07002513These options provide the ability to gather system information and perform extensive debugging\&.
rgallardf71f2512015-02-02 10:12:21 -08002514.PP
2515\-XX:+ExtendedDTraceProbes
2516.RS 4
2517Enables additional
2518\fBdtrace\fR
2519tool probes that impact the performance\&. By default, this option is disabled and
2520\fBdtrace\fR
2521performs only standard probes\&.
2522.RE
2523.PP
2524\-XX:+HeapDumpOnOutOfMemory
2525.RS 4
2526Enables the dumping of the Java heap to a file in the current directory by using the heap profiler (HPROF) when a
2527\fBjava\&.lang\&.OutOfMemoryError\fR
2528exception is thrown\&. You can explicitly set the heap dump file path and name using the
2529\fB\-XX:HeapDumpPath\fR
2530option\&. By default, this option is disabled and the heap is not dumped when an
2531\fBOutOfMemoryError\fR
2532exception is thrown\&.
2533.RE
2534.PP
2535\-XX:HeapDumpPath=\fIpath\fR
2536.RS 4
2537Sets the path and file name for writing the heap dump provided by the heap profiler (HPROF) when the
2538\fB\-XX:+HeapDumpOnOutOfMemoryError\fR
2539option is set\&. By default, the file is created in the current working directory, and it is named
2540\fBjava_pid\fR\fIpid\fR\fB\&.hprof\fR
2541where
2542\fIpid\fR
2543is the identifier of the process that caused the error\&. The following example shows how to set the default file explicitly (\fB%p\fR
2544represents the current process identificator):
2545.sp
2546.if n \{\
2547.RS 4
2548.\}
2549.nf
2550\fB\-XX:HeapDumpPath=\&./java_pid%p\&.hprof\fR
2551
2552.fi
2553.if n \{\
2554.RE
2555.\}
2556The following example shows how to set the heap dump file to
2557\fB/var/log/java/java_heapdump\&.hprof\fR:
2558.sp
2559.if n \{\
2560.RS 4
2561.\}
2562.nf
2563\fB\-XX:HeapDumpPath=/var/log/java/java_heapdump\&.hprof\fR
2564
2565.fi
2566.if n \{\
2567.RE
2568.\}
2569.RE
2570.PP
2571\-XX:LogFile=\fIpath\fR
2572.RS 4
2573Sets 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
2574\fBhotspot\&.log\fR\&.
2575.sp
2576The following example shows how to set the log file to
2577\fB/var/log/java/hotspot\&.log\fR:
2578.sp
2579.if n \{\
2580.RS 4
2581.\}
2582.nf
2583\fB\-XX:LogFile=/var/log/java/hotspot\&.log\fR
2584
2585.fi
2586.if n \{\
2587.RE
2588.\}
2589.RE
2590.PP
2591\-XX:+PrintClassHistogram
2592.RS 4
2593Enables printing of a class instance histogram after a
2594\fBControl+C\fR
2595event (\fBSIGTERM\fR)\&. By default, this option is disabled\&.
2596.sp
2597Setting this option is equivalent to running the
2598\fBjmap \-histo\fR
2599command, or the
2600\fBjcmd \fR\fIpid\fR\fB GC\&.class_histogram\fR
2601command, where
2602\fIpid\fR
2603is the current Java process identifier\&.
2604.RE
2605.PP
2606\-XX:+PrintConcurrentLocks
2607.RS 4
2608Enables printing of locks after a event\&. By default, this option is disabled\&.
2609.sp
2610Enables printing of
2611\fBjava\&.util\&.concurrent\fR
2612locks after a
2613\fBControl+C\fR
2614event (\fBSIGTERM\fR)\&. By default, this option is disabled\&.
2615.sp
2616Setting this option is equivalent to running the
2617\fBjstack \-l\fR
2618command or the
2619\fBjcmd \fR\fIpid\fR\fB Thread\&.print \-l\fR
2620command, where
2621\fIpid\fR
2622is the current Java process identifier\&.
2623.RE
2624.PP
2625\-XX:+UnlockDiagnosticVMOptions
2626.RS 4
rgallard36ba8532014-06-06 15:45:48 -07002627Unlocks 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 -08002628.RE
2629.SS "Advanced Garbage Collection Options"
2630.PP
rgallard36ba8532014-06-06 15:45:48 -07002631These options control how garbage collection (GC) is performed by the Java HotSpot VM\&.
rgallardf71f2512015-02-02 10:12:21 -08002632.PP
2633\-XX:+AggressiveHeap
2634.RS 4
2635Enables 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\&.
2636.RE
2637.PP
2638\-XX:+AlwaysPreTouch
2639.RS 4
2640Enables touching of every page on the Java heap during JVM initialization\&. This gets all pages into the memory before entering the
2641\fBmain()\fR
2642method\&. 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\&.
2643.RE
2644.PP
2645\-XX:+CMSClassUnloadingEnabled
2646.RS 4
2647Enables 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
2648\fB\-XX:\-CMSClassUnloadingEnabled\fR\&.
2649.RE
2650.PP
2651\-XX:CMSExpAvgFactor=\fIpercent\fR
2652.RS 4
rgallardb6435452013-11-25 20:19:02 -08002653Sets 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 -08002654.sp
2655.if n \{\
2656.RS 4
2657.\}
2658.nf
2659\fB\-XX:CMSExpAvgFactor=15\fR
2660
2661.fi
2662.if n \{\
2663.RE
2664.\}
2665.RE
2666.PP
2667\-XX:CMSInitiatingOccupancyFraction=\fIpercent\fR
2668.RS 4
2669Sets 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
2670\fB\-XX:CMSTriggerRatio\fR
2671is used to define the value of the initiating occupancy fraction\&.
2672.sp
rgallardb6435452013-11-25 20:19:02 -08002673The following example shows how to set the occupancy fraction to 20%:
rgallardf71f2512015-02-02 10:12:21 -08002674.sp
2675.if n \{\
2676.RS 4
2677.\}
2678.nf
2679\fB\-XX:CMSInitiatingOccupancyFraction=20\fR
2680
2681.fi
2682.if n \{\
2683.RE
2684.\}
2685.RE
2686.PP
2687\-XX:+CMSScavengeBeforeRemark
2688.RS 4
rgallardb6435452013-11-25 20:19:02 -08002689Enables scavenging attempts before the CMS remark step\&. By default, this option is disabled\&.
rgallardf71f2512015-02-02 10:12:21 -08002690.RE
2691.PP
2692\-XX:CMSTriggerRatio=\fIpercent\fR
2693.RS 4
2694Sets the percentage (0 to 100) of the value specified by
2695\fB\-XX:MinHeapFreeRatio\fR
2696that is allocated before a CMS collection cycle commences\&. The default value is set to 80%\&.
2697.sp
rgallardb6435452013-11-25 20:19:02 -08002698The following example shows how to set the occupancy fraction to 75%:
rgallardf71f2512015-02-02 10:12:21 -08002699.sp
2700.if n \{\
2701.RS 4
2702.\}
2703.nf
2704\fB\-XX:CMSTriggerRatio=75\fR
2705
2706.fi
2707.if n \{\
2708.RE
2709.\}
2710.RE
2711.PP
2712\-XX:ConcGCThreads=\fIthreads\fR
2713.RS 4
rgallardb6435452013-11-25 20:19:02 -08002714Sets 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 -08002715.sp
rgallardb6435452013-11-25 20:19:02 -08002716For example, to set the number of threads for concurrent GC to 2, specify the following option:
rgallardf71f2512015-02-02 10:12:21 -08002717.sp
2718.if n \{\
2719.RS 4
2720.\}
2721.nf
2722\fB\-XX:ConcGCThreads=2\fR
2723
2724.fi
2725.if n \{\
2726.RE
2727.\}
2728.RE
2729.PP
2730\-XX:+DisableExplicitGC
2731.RS 4
2732Enables the option that disables processing of calls to
2733\fBSystem\&.gc()\fR\&. This option is disabled by default, meaning that calls to
2734\fBSystem\&.gc()\fR
2735are processed\&. If processing of calls to
2736\fBSystem\&.gc()\fR
2737is disabled, the JVM still performs GC when necessary\&.
2738.RE
2739.PP
2740\-XX:+ExplicitGCInvokesConcurrent
2741.RS 4
2742Enables invoking of concurrent GC by using the
2743\fBSystem\&.gc()\fR
2744request\&. This option is disabled by default and can be enabled only together with the
2745\fB\-XX:+UseConcMarkSweepGC\fR
2746option\&.
2747.RE
2748.PP
2749\-XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses
2750.RS 4
2751Enables invoking of concurrent GC by using the
2752\fBSystem\&.gc()\fR
2753request and unloading of classes during the concurrent GC cycle\&. This option is disabled by default and can be enabled only together with the
2754\fB\-XX:+UseConcMarkSweepGC\fR
2755option\&.
2756.RE
2757.PP
2758\-XX:G1HeapRegionSize=\fIsize\fR
2759.RS 4
2760Sets 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\&.
2761.sp
rgallardb6435452013-11-25 20:19:02 -08002762The following example shows how to set the size of the subdivisions to 16 MB:
rgallardf71f2512015-02-02 10:12:21 -08002763.sp
2764.if n \{\
2765.RS 4
2766.\}
2767.nf
2768\fB\-XX:G1HeapRegionSize=16m\fR
2769
2770.fi
2771.if n \{\
2772.RE
2773.\}
2774.RE
2775.PP
2776\-XX:+G1PrintHeapRegions
2777.RS 4
rgallardb6435452013-11-25 20:19:02 -08002778Enables 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 -08002779.RE
2780.PP
2781\-XX:G1ReservePercent=\fIpercent\fR
2782.RS 4
rgallardb6435452013-11-25 20:19:02 -08002783Sets 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 -08002784.sp
rgallardb6435452013-11-25 20:19:02 -08002785The following example shows how to set the reserved heap to 20%:
rgallardf71f2512015-02-02 10:12:21 -08002786.sp
2787.if n \{\
2788.RS 4
2789.\}
2790.nf
2791\fB\-XX:G1ReservePercent=20\fR
2792
2793.fi
2794.if n \{\
2795.RE
2796.\}
2797.RE
2798.PP
2799\-XX:InitialHeapSize=\fIsize\fR
2800.RS 4
2801Sets 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
2802\fBk\fR
2803or
2804\fBK\fR
2805to indicate kilobytes,
2806\fBm\fR
2807or
2808\fBM\fR
2809to indicate megabytes,
2810\fBg\fR
2811or
2812\fBG\fR
2813to indicate gigabytes\&. The default value is chosen at runtime based on system configuration\&. See the section "Ergonomics" in
2814\fIJava SE HotSpot Virtual Machine Garbage Collection Tuning Guide\fR
2815at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gctuning/index\&.html\&.
2816.sp
rgallardb6435452013-11-25 20:19:02 -08002817The following examples show how to set the size of allocated memory to 6 MB using various units:
rgallardf71f2512015-02-02 10:12:21 -08002818.sp
2819.if n \{\
2820.RS 4
2821.\}
2822.nf
2823\fB\-XX:InitialHeapSize=6291456\fR
2824\fB\-XX:InitialHeapSize=6144k\fR
2825\fB\-XX:InitialHeapSize=6m\fR
2826
2827.fi
2828.if n \{\
2829.RE
2830.\}
2831If 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
2832\fB\-XX:NewSize\fR
2833option\&.
2834.RE
2835.PP
2836\-XX:InitialSurvivorRatio=\fIratio\fR
2837.RS 4
2838Sets the initial survivor space ratio used by the throughput garbage collector (which is enabled by the
2839\fB\-XX:+UseParallelGC\fR
2840and/or \-\fBXX:+UseParallelOldGC\fR
2841options)\&. Adaptive sizing is enabled by default with the throughput garbage collector by using the
2842\fB\-XX:+UseParallelGC\fR
2843and
2844\fB\-XX:+UseParallelOldGC\fR
2845options, and survivor space is resized according to the application behavior, starting with the initial value\&. If adaptive sizing is disabled (using the
2846\fB\-XX:\-UseAdaptiveSizePolicy\fR
2847option), then the
2848\fB\-XX:SurvivorRatio\fR
2849option should be used to set the size of the survivor space for the entire execution of the application\&.
2850.sp
rgallardb6435452013-11-25 20:19:02 -08002851The 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 -08002852.sp
2853.if n \{\
2854.RS 4
2855.\}
2856.nf
2857\fBS=Y/(R+2)\fR
2858
2859.fi
2860.if n \{\
2861.RE
2862.\}
rgallardb6435452013-11-25 20:19:02 -08002863The 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 -08002864.sp
rgallardb6435452013-11-25 20:19:02 -08002865By 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 -08002866.sp
rgallardb6435452013-11-25 20:19:02 -08002867The following example shows how to set the initial survivor space ratio to 4:
rgallardf71f2512015-02-02 10:12:21 -08002868.sp
2869.if n \{\
2870.RS 4
2871.\}
2872.nf
2873\fB\-XX:InitialSurvivorRatio=4\fR
2874
2875.fi
2876.if n \{\
2877.RE
2878.\}
2879.RE
2880.PP
2881\-XX:InitiatingHeapOccupancyPercent=\fIpercent\fR
2882.RS 4
rgallardb6435452013-11-25 20:19:02 -08002883Sets 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 -08002884.sp
rgallardb6435452013-11-25 20:19:02 -08002885By 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 -08002886.sp
2887.if n \{\
2888.RS 4
2889.\}
2890.nf
2891\fB\-XX:InitiatingHeapOccupancyPercent=75\fR
2892
2893.fi
2894.if n \{\
2895.RE
2896.\}
2897.RE
2898.PP
2899\-XX:MaxGCPauseMillis=\fItime\fR
2900.RS 4
rgallardb6435452013-11-25 20:19:02 -08002901Sets 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 -08002902.sp
rgallardb6435452013-11-25 20:19:02 -08002903The following example shows how to set the maximum target pause time to 500 ms:
rgallardf71f2512015-02-02 10:12:21 -08002904.sp
2905.if n \{\
2906.RS 4
2907.\}
2908.nf
2909\fB\-XX:MaxGCPauseMillis=500\fR
2910
2911.fi
2912.if n \{\
2913.RE
2914.\}
2915.RE
2916.PP
2917\-XX:MaxHeapSize=\fIsize\fR
2918.RS 4
2919Sets 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
2920\fBk\fR
2921or
2922\fBK\fR
2923to indicate kilobytes,
2924\fBm\fR
2925or
2926\fBM\fR
2927to indicate megabytes,
2928\fBg\fR
2929or
2930\fBG\fR
2931to indicate gigabytes\&. The default value is chosen at runtime based on system configuration\&. For server deployments,
2932\fB\-XX:InitialHeapSize\fR
2933and
2934\fB\-XX:MaxHeapSize\fR
2935are often set to the same value\&. See the section "Ergonomics" in
2936\fIJava SE HotSpot Virtual Machine Garbage Collection Tuning Guide\fR
2937at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gctuning/index\&.html\&.
2938.sp
rgallardb6435452013-11-25 20:19:02 -08002939The 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 -08002940.sp
2941.if n \{\
2942.RS 4
2943.\}
2944.nf
2945\fB\-XX:MaxHeapSize=83886080\fR
2946\fB\-XX:MaxHeapSize=81920k\fR
2947\fB\-XX:MaxHeapSize=80m\fR
2948
2949.fi
2950.if n \{\
2951.RE
2952.\}
rgallardb6435452013-11-25 20:19:02 -08002953On 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 -08002954.sp
2955The
2956\fB\-XX:MaxHeapSize\fR
2957option is equivalent to
2958\fB\-Xmx\fR\&.
2959.RE
2960.PP
2961\-XX:MaxHeapFreeRatio=\fIpercent\fR
2962.RS 4
rgallardb6435452013-11-25 20:19:02 -08002963Sets 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 -08002964.sp
rgallardb6435452013-11-25 20:19:02 -08002965The following example shows how to set the maximum free heap ratio to 75%:
rgallardf71f2512015-02-02 10:12:21 -08002966.sp
2967.if n \{\
2968.RS 4
2969.\}
2970.nf
2971\fB\-XX:MaxHeapFreeRatio=75\fR
2972
2973.fi
2974.if n \{\
2975.RE
2976.\}
2977.RE
2978.PP
2979\-XX:MaxMetaspaceSize=\fIsize\fR
2980.RS 4
rgallardb6435452013-11-25 20:19:02 -08002981Sets 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 -08002982.sp
rgallardb6435452013-11-25 20:19:02 -08002983The following example shows how to set the maximum class metadata size to 256 MB:
rgallardf71f2512015-02-02 10:12:21 -08002984.sp
2985.if n \{\
2986.RS 4
2987.\}
2988.nf
2989\fB\-XX:MaxMetaspaceSize=256m\fR
2990
2991.fi
2992.if n \{\
2993.RE
2994.\}
2995.RE
2996.PP
2997\-XX:MaxNewSize=\fIsize\fR
2998.RS 4
rgallardb6435452013-11-25 20:19:02 -08002999Sets 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 -08003000.RE
3001.PP
3002\-XX:MaxTenuringThreshold=\fIthreshold\fR
3003.RS 4
rgallardb6435452013-11-25 20:19:02 -08003004Sets 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 -08003005.sp
rgallardb6435452013-11-25 20:19:02 -08003006The following example shows how to set the maximum tenuring threshold to 10:
rgallardf71f2512015-02-02 10:12:21 -08003007.sp
3008.if n \{\
3009.RS 4
3010.\}
3011.nf
3012\fB\-XX:MaxTenuringThreshold=10\fR
3013
3014.fi
3015.if n \{\
3016.RE
3017.\}
3018.RE
3019.PP
3020\-XX:MetaspaceSize=\fIsize\fR
3021.RS 4
rgallardb6435452013-11-25 20:19:02 -08003022Sets 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 -08003023.RE
3024.PP
3025\-XX:MinHeapFreeRatio=\fIpercent\fR
3026.RS 4
rgallardb6435452013-11-25 20:19:02 -08003027Sets 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 -08003028.sp
rgallardb6435452013-11-25 20:19:02 -08003029The following example shows how to set the minimum free heap ratio to 25%:
rgallardf71f2512015-02-02 10:12:21 -08003030.sp
3031.if n \{\
3032.RS 4
3033.\}
3034.nf
3035\fB\-XX:MinHeapFreeRatio=25\fR
3036
3037.fi
3038.if n \{\
3039.RE
3040.\}
3041.RE
3042.PP
3043\-XX:NewRatio=\fIratio\fR
3044.RS 4
rgallardb6435452013-11-25 20:19:02 -08003045Sets 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 -08003046.sp
3047.if n \{\
3048.RS 4
3049.\}
3050.nf
3051\fB\-XX:NewRatio=1\fR
3052
3053.fi
3054.if n \{\
3055.RE
3056.\}
3057.RE
3058.PP
3059\-XX:NewSize=\fIsize\fR
3060.RS 4
3061Sets the initial size (in bytes) of the heap for the young generation (nursery)\&. Append the letter
3062\fBk\fR
3063or
3064\fBK\fR
3065to indicate kilobytes,
3066\fBm\fR
3067or
3068\fBM\fR
3069to indicate megabytes,
3070\fBg\fR
3071or
3072\fBG\fR
3073to indicate gigabytes\&.
3074.sp
rgallardb6435452013-11-25 20:19:02 -08003075The 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 -08003076.sp
rgallardb6435452013-11-25 20:19:02 -08003077The following examples show how to set the initial size of young generation to 256 MB using various units:
rgallardf71f2512015-02-02 10:12:21 -08003078.sp
3079.if n \{\
3080.RS 4
3081.\}
3082.nf
3083\fB\-XX:NewSize=256m\fR
3084\fB\-XX:NewSize=262144k\fR
3085\fB\-XX:NewSize=268435456\fR
3086
3087.fi
3088.if n \{\
3089.RE
3090.\}
3091The
3092\fB\-XX:NewSize\fR
3093option is equivalent to
3094\fB\-Xmn\fR\&.
3095.RE
3096.PP
3097\-XX:ParallelGCThreads=\fIthreads\fR
3098.RS 4
rgallardb6435452013-11-25 20:19:02 -08003099Sets 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 -08003100.sp
rgallardb6435452013-11-25 20:19:02 -08003101For example, to set the number of threads for parallel GC to 2, specify the following option:
rgallardf71f2512015-02-02 10:12:21 -08003102.sp
3103.if n \{\
3104.RS 4
3105.\}
3106.nf
3107\fB\-XX:ParallelGCThreads=2\fR
3108
3109.fi
3110.if n \{\
3111.RE
3112.\}
3113.RE
3114.PP
3115\-XX:+ParallelRefProcEnabled
3116.RS 4
rgallardb6435452013-11-25 20:19:02 -08003117Enables parallel reference processing\&. By default, this option is disabled\&.
rgallardf71f2512015-02-02 10:12:21 -08003118.RE
3119.PP
3120\-XX:+PrintAdaptiveSizePolicy
3121.RS 4
rgallardb6435452013-11-25 20:19:02 -08003122Enables printing of information about adaptive generation sizing\&. By default, this option is disabled\&.
rgallardf71f2512015-02-02 10:12:21 -08003123.RE
3124.PP
3125\-XX:+PrintGC
3126.RS 4
rgallardb6435452013-11-25 20:19:02 -08003127Enables printing of messages at every GC\&. By default, this option is disabled\&.
rgallardf71f2512015-02-02 10:12:21 -08003128.RE
3129.PP
3130\-XX:+PrintGCApplicationConcurrentTime
3131.RS 4
rgallardb6435452013-11-25 20:19:02 -08003132Enables 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 -08003133.RE
3134.PP
3135\-XX:+PrintGCApplicationStoppedTime
3136.RS 4
rgallardb6435452013-11-25 20:19:02 -08003137Enables 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 -08003138.RE
3139.PP
3140\-XX:+PrintGCDateStamps
3141.RS 4
rgallardb6435452013-11-25 20:19:02 -08003142Enables printing of a date stamp at every GC\&. By default, this option is disabled\&.
rgallardf71f2512015-02-02 10:12:21 -08003143.RE
3144.PP
3145\-XX:+PrintGCDetails
3146.RS 4
rgallardb6435452013-11-25 20:19:02 -08003147Enables printing of detailed messages at every GC\&. By default, this option is disabled\&.
rgallardf71f2512015-02-02 10:12:21 -08003148.RE
3149.PP
3150\-XX:+PrintGCTaskTimeStamps
3151.RS 4
rgallardb6435452013-11-25 20:19:02 -08003152Enables printing of time stamps for every individual GC worker thread task\&. By default, this option is disabled\&.
rgallardf71f2512015-02-02 10:12:21 -08003153.RE
3154.PP
3155\-XX:+PrintGCTimeStamps
3156.RS 4
rgallardb6435452013-11-25 20:19:02 -08003157Enables printing of time stamps at every GC\&. By default, this option is disabled\&.
rgallardf71f2512015-02-02 10:12:21 -08003158.RE
3159.PP
3160\-XX:+PrintStringDeduplicationStatistics
3161.RS 4
3162Prints detailed deduplication statistics\&. By default, this option is disabled\&. See the
3163\fB\-XX:+UseStringDeduplication\fR
3164option\&.
3165.RE
3166.PP
3167\-XX:+PrintTenuringDistribution
3168.RS 4
rgallardb6435452013-11-25 20:19:02 -08003169Enables printing of tenuring age information\&. The following is an example of the output:
rgallardf71f2512015-02-02 10:12:21 -08003170.sp
3171.if n \{\
3172.RS 4
3173.\}
3174.nf
3175\fBDesired survivor size 48286924 bytes, new threshold 10 (max 10)\fR
3176\fB\- age 1: 28992024 bytes, 28992024 total\fR
3177\fB\- age 2: 1366864 bytes, 30358888 total\fR
3178\fB\- age 3: 1425912 bytes, 31784800 total\fR
3179\fB\&.\&.\&.\fR
3180
3181.fi
3182.if n \{\
3183.RE
3184.\}
rgallardb6435452013-11-25 20:19:02 -08003185Age 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 -08003186.sp
rgallardb6435452013-11-25 20:19:02 -08003187In 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 -08003188.sp
rgallardb6435452013-11-25 20:19:02 -08003189By default, this option is disabled\&.
rgallardf71f2512015-02-02 10:12:21 -08003190.RE
3191.PP
3192\-XX:+ScavengeBeforeFullGC
3193.RS 4
3194Enables GC of the young generation before each full GC\&. This option is enabled by default\&. Oracle recommends that you
3195\fIdo not\fR
3196disable 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
3197\fB\-XX:\-ScavengeBeforeFullGC\fR\&.
3198.RE
3199.PP
3200\-XX:SoftRefLRUPolicyMSPerMB=\fItime\fR
3201.RS 4
3202Sets 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
3203\fB\-XX:SoftRefLRUPolicyMSPerMB\fR
3204option 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
3205\fB\-Xmx\fR
3206option has a significant effect on how quickly soft references are garbage collected\&.
3207.sp
rgallardb6435452013-11-25 20:19:02 -08003208The following example shows how to set the value to 2\&.5 seconds:
rgallardf71f2512015-02-02 10:12:21 -08003209.sp
3210.if n \{\
3211.RS 4
3212.\}
3213.nf
3214\fB\-XX:SoftRefLRUPolicyMSPerMB=2500\fR
3215
3216.fi
3217.if n \{\
3218.RE
3219.\}
3220.RE
3221.PP
3222\-XX:StringDeduplicationAgeThreshold=\fIthreshold\fR
3223.RS 4
3224\fBString\fR
3225objects 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
3226\fB\-XX:+PrintTenuringDistribution\fR
3227option\&. Note that
3228\fBString\fR
3229objects 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
3230\fB3\fR\&. See the
3231\fB\-XX:+UseStringDeduplication\fR
3232option\&.
3233.RE
3234.PP
3235\-XX:SurvivorRatio=\fIratio\fR
3236.RS 4
rgallardb6435452013-11-25 20:19:02 -08003237Sets 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 -08003238.sp
3239.if n \{\
3240.RS 4
3241.\}
3242.nf
3243\fB\-XX:SurvivorRatio=4\fR
3244
3245.fi
3246.if n \{\
3247.RE
3248.\}
3249.RE
3250.PP
3251\-XX:TargetSurvivorRatio=\fIpercent\fR
3252.RS 4
rgallardb6435452013-11-25 20:19:02 -08003253Sets 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 -08003254.sp
rgallardb6435452013-11-25 20:19:02 -08003255The following example shows how to set the target survivor space ratio to 30%:
rgallardf71f2512015-02-02 10:12:21 -08003256.sp
3257.if n \{\
3258.RS 4
3259.\}
3260.nf
3261\fB\-XX:TargetSurvivorRatio=30\fR
3262
3263.fi
3264.if n \{\
3265.RE
3266.\}
3267.RE
3268.PP
3269\-XX:TLABSize=\fIsize\fR
3270.RS 4
3271Sets the initial size (in bytes) of a thread\-local allocation buffer (TLAB)\&. Append the letter
3272\fBk\fR
3273or
3274\fBK\fR
3275to indicate kilobytes,
3276\fBm\fR
3277or
3278\fBM\fR
3279to indicate megabytes,
3280\fBg\fR
3281or
3282\fBG\fR
3283to indicate gigabytes\&. If this option is set to 0, then the JVM chooses the initial size automatically\&.
3284.sp
rgallardb6435452013-11-25 20:19:02 -08003285The following example shows how to set the initial TLAB size to 512 KB:
rgallardf71f2512015-02-02 10:12:21 -08003286.sp
3287.if n \{\
3288.RS 4
3289.\}
3290.nf
3291\fB\-XX:TLABSize=512k\fR
3292
3293.fi
3294.if n \{\
3295.RE
3296.\}
3297.RE
3298.PP
3299\-XX:+UseAdaptiveSizePolicy
3300.RS 4
3301Enables the use of adaptive generation sizing\&. This option is enabled by default\&. To disable adaptive generation sizing, specify
3302\fB\-XX:\-UseAdaptiveSizePolicy\fR
3303and set the size of the memory allocation pool explicitly (see the
3304\fB\-XX:SurvivorRatio\fR
3305option)\&.
3306.RE
3307.PP
3308\-XX:+UseCMSInitiatingOccupancyOnly
3309.RS 4
rgallardb6435452013-11-25 20:19:02 -08003310Enables 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 -08003311.RE
3312.PP
3313\-XX:+UseConcMarkSweepGC
3314.RS 4
3315Enables 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\&.
3316.sp
3317By 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
3318\fB\-XX:+UseParNewGC\fR
3319option is automatically set and you should not disable it, because the following combination of options has been deprecated in JDK 8:
3320\fB\-XX:+UseConcMarkSweepGC \-XX:\-UseParNewGC\fR\&.
3321.RE
3322.PP
3323\-XX:+UseG1GC
3324.RS 4
3325Enables 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)\&.
3326.sp
rgallardb6435452013-11-25 20:19:02 -08003327By 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 -08003328.RE
3329.PP
3330\-XX:+UseGCOverheadLimit
3331.RS 4
3332Enables the use of a policy that limits the proportion of time spent by the JVM on GC before an
3333\fBOutOfMemoryError\fR
3334exception is thrown\&. This option is enabled, by default and the parallel GC will throw an
3335\fBOutOfMemoryError\fR
3336if 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
3337\fB\-XX:\-UseGCOverheadLimit\fR\&.
3338.RE
3339.PP
3340\-XX:+UseNUMA
3341.RS 4
3342Enables 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)\&.
3343.RE
3344.PP
3345\-XX:+UseParallelGC
3346.RS 4
rgallardb6435452013-11-25 20:19:02 -08003347Enables 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 -08003348.sp
3349By 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
3350\fB\-XX:+UseParallelOldGC\fR
3351option is automatically enabled, unless you explicitly disable it\&.
3352.RE
3353.PP
3354\-XX:+UseParallelOldGC
3355.RS 4
3356Enables the use of the parallel garbage collector for full GCs\&. By default, this option is disabled\&. Enabling it automatically enables the
3357\fB\-XX:+UseParallelGC\fR
3358option\&.
3359.RE
3360.PP
3361\-XX:+UseParNewGC
3362.RS 4
3363Enables 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
3364\fB\-XX:+UseConcMarkSweepGC\fR
3365option\&. Using the
3366\fB\-XX:+UseParNewGC\fR
3367option without the
3368\fB\-XX:+UseConcMarkSweepGC\fR
3369option was deprecated in JDK 8\&.
3370.RE
3371.PP
3372\-XX:+UseSerialGC
3373.RS 4
rgallardb6435452013-11-25 20:19:02 -08003374Enables 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 -08003375.RE
3376.PP
3377\-XX:+UseSHM
3378.RS 4
rgallard04b0ca42014-10-17 11:33:22 -07003379On Linux, enables the JVM to use shared memory to setup large pages\&.
rgallardf71f2512015-02-02 10:12:21 -08003380.sp
3381For more information, see "Large Pages"\&.
3382.RE
3383.PP
3384\-XX:+UseStringDeduplication
3385.RS 4
3386Enables string deduplication\&. By default, this option is disabled\&. To use this option, you must enable the garbage\-first (G1) garbage collector\&. See the
3387\fB\-XX:+UseG1GC\fR
3388option\&.
3389.sp
3390\fIString deduplication\fR
3391reduces the memory footprint of
3392\fBString\fR
3393objects on the Java heap by taking advantage of the fact that many
3394\fBString\fR
3395objects are identical\&. Instead of each
3396\fBString\fR
3397object pointing to its own character array, identical
3398\fBString\fR
3399objects can point to and share the same character array\&.
3400.RE
3401.PP
3402\-XX:+UseTLAB
3403.RS 4
3404Enables 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
3405\fB\-XX:\-UseTLAB\fR\&.
3406.RE
3407.SS "Deprecated and Removed Options"
3408.PP
rgallardb6435452013-11-25 20:19:02 -08003409These options were included in the previous release, but have since been considered unnecessary\&.
rgallardf71f2512015-02-02 10:12:21 -08003410.PP
3411\-Xincgc
3412.RS 4
rgallard1cc205c2014-01-09 16:10:24 -08003413Enables incremental garbage collection\&. This option was deprecated in JDK 8 with no replacement\&.
rgallardf71f2512015-02-02 10:12:21 -08003414.RE
3415.PP
3416\-Xrun\fIlibname\fR
3417.RS 4
3418Loads the specified debugging/profiling library\&. This option was superseded by the
3419\fB\-agentlib\fR
3420option\&.
3421.RE
3422.PP
3423\-XX:CMSIncrementalDutyCycle=\fIpercent\fR
3424.RS 4
3425Sets 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
3426\fB\-XX:+CMSIncrementalMode\fR
3427option\&.
3428.RE
3429.PP
3430\-XX:CMSIncrementalDutyCycleMin=\fIpercent\fR
3431.RS 4
3432Sets the percentage of time (0 to 100) between minor collections that is the lower bound for the duty cycle when
3433\fB\-XX:+CMSIncrementalPacing\fR
3434is enabled\&. This option was deprecated in JDK 8 with no replacement, following the deprecation of the
3435\fB\-XX:+CMSIncrementalMode\fR
3436option\&.
3437.RE
3438.PP
3439\-XX:+CMSIncrementalMode
3440.RS 4
3441Enables the incremental mode for the CMS collector\&. This option was deprecated in JDK 8 with no replacement, along with other options that start with
3442\fBCMSIncremental\fR\&.
3443.RE
3444.PP
3445\-XX:CMSIncrementalOffset=\fIpercent\fR
3446.RS 4
3447Sets 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
3448\fB\-XX:+CMSIncrementalMode\fR
3449option\&.
3450.RE
3451.PP
3452\-XX:+CMSIncrementalPacing
3453.RS 4
3454Enables 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
3455\fB\-XX:+CMSIncrementalMode\fR
3456option\&.
3457.RE
3458.PP
3459\-XX:CMSIncrementalSafetyFactor=\fIpercent\fR
3460.RS 4
3461Sets 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
3462\fB\-XX:+CMSIncrementalMode\fR
3463option\&.
3464.RE
3465.PP
3466\-XX:CMSInitiatingPermOccupancyFraction=\fIpercent\fR
3467.RS 4
rgallardb6435452013-11-25 20:19:02 -08003468Sets 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 -08003469.RE
3470.PP
3471\-XX:MaxPermSize=\fIsize\fR
3472.RS 4
3473Sets the maximum permanent generation space size (in bytes)\&. This option was deprecated in JDK 8, and superseded by the
3474\fB\-XX:MaxMetaspaceSize\fR
3475option\&.
3476.RE
3477.PP
3478\-XX:PermSize=\fIsize\fR
3479.RS 4
3480Sets 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
3481\fB\-XX:MetaspaceSize\fR
3482option\&.
3483.RE
3484.PP
3485\-XX:+UseSplitVerifier
3486.RS 4
rgallardb6435452013-11-25 20:19:02 -08003487Enables 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 -08003488.RE
3489.PP
3490\-XX:+UseStringCache
3491.RS 4
rgallardb6435452013-11-25 20:19:02 -08003492Enables caching of commonly allocated strings\&. This option was removed from JDK 8 with no replacement\&.
rgallardf71f2512015-02-02 10:12:21 -08003493.RE
3494.SH "PERFORMANCE TUNING EXAMPLES"
3495.PP
rgallardb6435452013-11-25 20:19:02 -08003496The following examples show how to use experimental tuning flags to either optimize throughput or to provide lower response time\&.
3497.PP
rgallardf71f2512015-02-02 10:12:21 -08003498\fBExample 1 \fRTuning for Higher Throughput
3499.RS 4
3500.sp
3501.if n \{\
3502.RS 4
3503.\}
3504.nf
3505\fBjava \-d64 \-server \-XX:+AggressiveOpts \-XX:+UseLargePages \-Xmn10g \-Xms26g \-Xmx26g\fR
3506
3507.fi
3508.if n \{\
3509.RE
3510.\}
3511.RE
rgallard36ba8532014-06-06 15:45:48 -07003512.PP
rgallardf71f2512015-02-02 10:12:21 -08003513\fBExample 2 \fRTuning for Lower Response Time
3514.RS 4
3515.sp
3516.if n \{\
3517.RS 4
3518.\}
3519.nf
3520\fBjava \-d64 \-XX:+UseG1GC \-Xms26g Xmx26g \-XX:MaxGCPauseMillis=500 \-XX:+PrintGCTimeStamp\fR
3521
3522.fi
3523.if n \{\
3524.RE
3525.\}
3526.RE
3527.SH "LARGE PAGES"
3528.PP
3529Also 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\&.
3530.PP
3531A 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 -07003532.PP
rgallard04b0ca42014-10-17 11:33:22 -07003533However, 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 -08003534.SS "Large Pages Support"
3535.PP
rgallard04b0ca42014-10-17 11:33:22 -07003536Solaris and Linux support large pages\&.
rgallardf71f2512015-02-02 10:12:21 -08003537.sp
3538.it 1 an-trap
3539.nr an-no-space-flag 1
3540.nr an-break-flag 1
3541.br
3542.ps +1
3543\fBSolaris\fR
3544.RS 4
rgallard04b0ca42014-10-17 11:33:22 -07003545.PP
rgallardf71f2512015-02-02 10:12:21 -08003546Solaris 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\&.
3547.RE
3548.sp
3549.it 1 an-trap
3550.nr an-no-space-flag 1
3551.nr an-break-flag 1
3552.br
3553.ps +1
3554\fBLinux\fR
3555.RS 4
rgallard04b0ca42014-10-17 11:33:22 -07003556.PP
rgallardf71f2512015-02-02 10:12:21 -08003557The 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:
3558.sp
3559.if n \{\
3560.RS 4
3561.\}
3562.nf
3563\fB# cat /proc/meminfo | grep Huge\fR
3564\fBHugePages_Total: 0\fR
3565\fBHugePages_Free: 0\fR
3566\fBHugepagesize: 2048 kB\fR
3567
3568.fi
3569.if n \{\
3570.RE
3571.\}
rgallard04b0ca42014-10-17 11:33:22 -07003572.PP
rgallardf71f2512015-02-02 10:12:21 -08003573If 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
3574\fBroot\fR, and then follow these steps:
3575.sp
3576.RS 4
3577.ie n \{\
3578\h'-04' 1.\h'+01'\c
3579.\}
3580.el \{\
3581.sp -1
3582.IP " 1." 4.2
3583.\}
3584If you are using the option
3585\fB\-XX:+UseSHM\fR
3586(instead of
3587\fB\-XX:+UseHugeTLBFS\fR), then increase the
3588\fBSHMMAX\fR
3589value\&. 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:
3590.sp
3591.if n \{\
3592.RS 4
3593.\}
3594.nf
3595\fB# echo 4294967295 > /proc/sys/kernel/shmmax\fR
3596
3597.fi
3598.if n \{\
3599.RE
3600.\}
3601.RE
3602.sp
3603.RS 4
3604.ie n \{\
3605\h'-04' 2.\h'+01'\c
3606.\}
3607.el \{\
3608.sp -1
3609.IP " 2." 4.2
3610.\}
3611If you are using the option
3612\fB\-XX:+UseSHM\fR
3613or
3614\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):
3615.sp
3616.if n \{\
3617.RS 4
3618.\}
3619.nf
3620\fB# echo 1536 > /proc/sys/vm/nr_hugepages\fR
3621
3622.fi
3623.if n \{\
3624.RE
3625.\}
3626.RE
3627.if n \{\
3628.sp
3629.\}
3630.RS 4
3631.it 1 an-trap
3632.nr an-no-space-flag 1
3633.nr an-break-flag 1
3634.br
3635.ps +1
3636\fBNote\fR
3637.ps -1
3638.br
3639.TS
3640allbox tab(:);
3641l.
3642T{
3643.sp
3644.RS 4
3645.ie n \{\
3646\h'-04'\(bu\h'+03'\c
3647.\}
3648.el \{\
3649.sp -1
3650.IP \(bu 2.3
3651.\}
3652Note that the values contained in
3653\fB/proc\fR
3654will reset after you reboot your system, so may want to set them in an initialization script (for example,
3655\fBrc\&.local\fR
3656or
3657\fBsysctl\&.conf\fR)\&.
3658.RE
3659.sp
3660.RS 4
3661.ie n \{\
3662\h'-04'\(bu\h'+03'\c
3663.\}
3664.el \{\
3665.sp -1
3666.IP \(bu 2.3
3667.\}
3668If you configure (or resize) the OS kernel parameters
3669\fB/proc/sys/kernel/shmmax\fR
3670or
3671\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:
3672.sp
3673.RS 4
3674.ie n \{\
3675\h'-04'\(bu\h'+03'\c
3676.\}
3677.el \{\
3678.sp -1
3679.IP \(bu 2.3
3680.\}
rgallard04b0ca42014-10-17 11:33:22 -07003681Java heap
rgallardf71f2512015-02-02 10:12:21 -08003682.RE
3683.sp
3684.RS 4
3685.ie n \{\
3686\h'-04'\(bu\h'+03'\c
3687.\}
3688.el \{\
3689.sp -1
3690.IP \(bu 2.3
3691.\}
rgallard04b0ca42014-10-17 11:33:22 -07003692Code cache
rgallardf71f2512015-02-02 10:12:21 -08003693.RE
3694.sp
3695.RS 4
3696.ie n \{\
3697\h'-04'\(bu\h'+03'\c
3698.\}
3699.el \{\
3700.sp -1
3701.IP \(bu 2.3
3702.\}
rgallard04b0ca42014-10-17 11:33:22 -07003703The marking bitmap data structure for the parallel GC
rgallardf71f2512015-02-02 10:12:21 -08003704.RE
3705.sp
3706Consequently, if you configure the
3707\fBnr_hugepages\fR
3708parameter 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\&.
3709.RE
3710T}
3711.TE
3712.sp 1
3713.sp .5v
3714.RE
3715.RE
3716.SH "EXIT STATUS"
rgallard04b0ca42014-10-17 11:33:22 -07003717.PP
rgallardf71f2512015-02-02 10:12:21 -08003718The 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
3719\fBSystem\&.exit(exitValue)\fR\&. The values are:
3720.sp
3721.RS 4
3722.ie n \{\
3723\h'-04'\(bu\h'+03'\c
3724.\}
3725.el \{\
3726.sp -1
3727.IP \(bu 2.3
3728.\}
3729\fB0\fR: Successful completion
3730.RE
3731.sp
3732.RS 4
3733.ie n \{\
3734\h'-04'\(bu\h'+03'\c
3735.\}
3736.el \{\
3737.sp -1
3738.IP \(bu 2.3
3739.\}
3740\fB>0\fR: An error occurred
3741.RE
3742.SH "SEE ALSO"
3743.sp
3744.RS 4
3745.ie n \{\
3746\h'-04'\(bu\h'+03'\c
3747.\}
3748.el \{\
3749.sp -1
3750.IP \(bu 2.3
3751.\}
rgallardb6435452013-11-25 20:19:02 -08003752javac(1)
rgallardf71f2512015-02-02 10:12:21 -08003753.RE
3754.sp
3755.RS 4
3756.ie n \{\
3757\h'-04'\(bu\h'+03'\c
3758.\}
3759.el \{\
3760.sp -1
3761.IP \(bu 2.3
3762.\}
rgallardb6435452013-11-25 20:19:02 -08003763jdb(1)
rgallardf71f2512015-02-02 10:12:21 -08003764.RE
3765.sp
3766.RS 4
3767.ie n \{\
3768\h'-04'\(bu\h'+03'\c
3769.\}
3770.el \{\
3771.sp -1
3772.IP \(bu 2.3
3773.\}
rgallardb6435452013-11-25 20:19:02 -08003774javah(1)
rgallardf71f2512015-02-02 10:12:21 -08003775.RE
3776.sp
3777.RS 4
3778.ie n \{\
3779\h'-04'\(bu\h'+03'\c
3780.\}
3781.el \{\
3782.sp -1
3783.IP \(bu 2.3
3784.\}
rgallardb6435452013-11-25 20:19:02 -08003785jar(1)
rgallardf71f2512015-02-02 10:12:21 -08003786.RE
3787.sp
3788.RS 4
3789.ie n \{\
3790\h'-04'\(bu\h'+03'\c
3791.\}
3792.el \{\
3793.sp -1
3794.IP \(bu 2.3
3795.\}
rgallard04b0ca42014-10-17 11:33:22 -07003796jstat(1)
rgallardf71f2512015-02-02 10:12:21 -08003797.RE
3798.br
3799'pl 8.5i
3800'bp