java.1 184 ko
Newer Older
Axel PERSEVALLE's avatar
Axel PERSEVALLE a validé
2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000
.RS
.RS
.PP
\f[CB]\-XX:AllocatePrefetchInstr=0\f[R]
.RE
.RE
.TP
.B \f[CB]\-XX:AllocatePrefetchLines=\f[R]\f[I]lines\f[R]
Sets the number of cache lines to load after the last object allocation
by using the prefetch instructions generated in compiled code.
The default value is 1 if the last allocated object was an instance, and
3 if it was an array.
.RS
.PP
The following example shows how to set the number of loaded cache lines
to 5:
.RS
.PP
\f[CB]\-XX:AllocatePrefetchLines=5\f[R]
.RE
.RE
.TP
.B \f[CB]\-XX:AllocatePrefetchStepSize=\f[R]\f[I]size\f[R]
Sets the step size (in bytes) for sequential prefetch instructions.
Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
\f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, \f[CB]g\f[R] or \f[CB]G\f[R]
to indicate gigabytes.
By default, the step size is set to 16 bytes:
.RS
.RS
.PP
\f[CB]\-XX:AllocatePrefetchStepSize=16\f[R]
.RE
.RE
.TP
.B \f[CB]\-XX:AllocatePrefetchStyle=\f[R]\f[I]style\f[R]
Sets the generated code style for prefetch instructions.
The \f[I]style\f[R] argument is an integer from 0 to 3:
.RS
.TP
.B \f[CB]0\f[R]
Don\[aq]t generate prefetch instructions.
.RS
.RE
.TP
.B \f[CB]1\f[R]
Execute prefetch instructions after each allocation.
This is the default setting.
.RS
.RE
.TP
.B \f[CB]2\f[R]
Use the thread\-local allocation block (TLAB) watermark pointer to
determine when prefetch instructions are executed.
.RS
.RE
.TP
.B \f[CB]3\f[R]
Generate one prefetch instruction per cache line.
.RS
.RE
.RE
.TP
.B \f[CB]\-XX:+BackgroundCompilation\f[R]
Enables background compilation.
This option is enabled by default.
To disable background compilation, specify
\f[CB]\-XX:\-BackgroundCompilation\f[R] (this is equivalent to specifying
\f[CB]\-Xbatch\f[R]).
.RS
.RE
.TP
.B \f[CB]\-XX:CICompilerCount=\f[R]\f[I]threads\f[R]
Sets the number of compiler threads to use for compilation.
By default, the number of compiler threads is selected automatically
depending on the number of CPUs and memory available for compiled code.
The following example shows how to set the number of threads to 2:
.RS
.RS
.PP
\f[CB]\-XX:CICompilerCount=2\f[R]
.RE
.RE
.TP
.B \f[CB]\-XX:+UseDynamicNumberOfCompilerThreads\f[R]
Dynamically create compiler thread up to the limit specified by
\f[CB]\-XX:CICompilerCount\f[R].
This option is enabled by default.
.RS
.RE
.TP
.B \f[CB]\-XX:CompileCommand=\f[R]\f[I]command\f[R]\f[CB],\f[R]\f[I]method\f[R][\f[CB],\f[R]\f[I]option\f[R]]
Specifies a \f[I]command\f[R] to perform on a \f[I]method\f[R].
For example, to exclude the \f[CB]indexOf()\f[R] method of the
\f[CB]String\f[R] class from being compiled, use the following:
.RS
.RS
.PP
\f[CB]\-XX:CompileCommand=exclude,java/lang/String.indexOf\f[R]
.RE
.PP
Note that the full class name is specified, including all packages and
subpackages separated by a slash (\f[CB]/\f[R]).
For easier cut\-and\-paste operations, it\[aq]s also possible to use the
method name format produced by the \f[CB]\-XX:+PrintCompilation\f[R] and
\f[CB]\-XX:+LogCompilation\f[R] options:
.RS
.PP
\f[CB]\-XX:CompileCommand=exclude,java.lang.String::indexOf\f[R]
.RE
.PP
If the method is specified without the signature, then the command is
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 a command end.
For example, if you want to exclude only the \f[CB]indexOf(String)\f[R]
method of the \f[CB]String\f[R] class from being compiled, use the
following:
.RS
.PP
\f[CB]\-XX:CompileCommand="exclude,java/lang/String.indexOf,(Ljava/lang/String;)I"\f[R]
.RE
.PP
You can also use the asterisk (*) as a wildcard for class and method
names.
For example, to exclude all \f[CB]indexOf()\f[R] methods in all classes
from being compiled, use the following:
.RS
.PP
\f[CB]\-XX:CompileCommand=exclude,*.indexOf\f[R]
.RE
.PP
The commas and periods are aliases for spaces, making it easier to pass
compiler commands through a shell.
You can pass arguments to \f[CB]\-XX:CompileCommand\f[R] using spaces as
separators by enclosing the argument in quotation marks:
.RS
.PP
\f[CB]\-XX:CompileCommand="exclude\ java/lang/String\ indexOf"\f[R]
.RE
.PP
Note that after parsing the commands passed on the command line using
the \f[CB]\-XX:CompileCommand\f[R] options, the JIT compiler then reads
commands from the \f[CB]\&.hotspot_compiler\f[R] file.
You can add commands to this file or specify a different file using the
\f[CB]\-XX:CompileCommandFile\f[R] option.
.PP
To add several commands, either specify the \f[CB]\-XX:CompileCommand\f[R]
option multiple times, or separate each argument with the new line
separator (\f[CB]\\n\f[R]).
The following commands are available:
.TP
.B \f[CB]break\f[R]
Sets a breakpoint when debugging the JVM to stop at the beginning of
compilation of the specified method.
.RS
.RE
.TP
.B \f[CB]compileonly\f[R]
Excludes all methods from compilation except for the specified method.
As an alternative, you can use the \f[CB]\-XX:CompileOnly\f[R] option,
which lets you specify several methods.
.RS
.RE
.TP
.B \f[CB]dontinline\f[R]
Prevents inlining of the specified method.
.RS
.RE
.TP
.B \f[CB]exclude\f[R]
Excludes the specified method from compilation.
.RS
.RE
.TP
.B \f[CB]help\f[R]
Prints a help message for the \f[CB]\-XX:CompileCommand\f[R] option.
.RS
.RE
.TP
.B \f[CB]inline\f[R]
Attempts to inline the specified method.
.RS
.RE
.TP
.B \f[CB]log\f[R]
Excludes compilation logging (with the \f[CB]\-XX:+LogCompilation\f[R]
option) for all methods except for the specified method.
By default, logging is performed for all compiled methods.
.RS
.RE
.TP
.B \f[CB]option\f[R]
Passes a JIT compilation option to the specified method in place of the
last argument (\f[CB]option\f[R]).
The compilation option is set at the end, after the method name.
For example, to enable the \f[CB]BlockLayoutByFrequency\f[R] option for
the \f[CB]append()\f[R] method of the \f[CB]StringBuffer\f[R] class, use the
following:
.RS
.RS
.PP
\f[CB]\-XX:CompileCommand=option,java/lang/StringBuffer.append,BlockLayoutByFrequency\f[R]
.RE
.PP
You can specify multiple compilation options, separated by commas or
spaces.
.RE
.TP
.B \f[CB]print\f[R]
Prints generated assembler code after compilation of the specified
method.
.RS
.RE
.TP
.B \f[CB]quiet\f[R]
Instructs not to print the compile commands.
By default, the commands that you specify with the
\f[CB]\-XX:CompileCommand\f[R] option are printed; for example, if you
exclude from compilation the \f[CB]indexOf()\f[R] method of the
\f[CB]String\f[R] class, then the following is printed to standard output:
.RS
.RS
.PP
\f[CB]CompilerOracle:\ exclude\ java/lang/String.indexOf\f[R]
.RE
.PP
You can suppress this by specifying the
\f[CB]\-XX:CompileCommand=quiet\f[R] option before other
\f[CB]\-XX:CompileCommand\f[R] options.
.RE
.RE
.TP
.B \f[CB]\-XX:CompileCommandFile=\f[R]\f[I]filename\f[R]
Sets the file from which JIT compiler commands are read.
By default, the \f[CB]\&.hotspot_compiler\f[R] file is used to store
commands performed by the JIT compiler.
.RS
.PP
Each line in the command file represents a command, a class name, and a
method name for which the command is used.
For example, this line prints assembly code for the \f[CB]toString()\f[R]
method of the \f[CB]String\f[R] class:
.RS
.PP
\f[CB]print\ java/lang/String\ toString\f[R]
.RE
.PP
If you\[aq]re using commands for the JIT compiler to perform on methods,
then see the \f[CB]\-XX:CompileCommand\f[R] option.
.RE
.TP
.B \f[CB]\-XX:CompilerDirectivesFile=\f[R]\f[I]file\f[R]
Adds directives from a file to the directives stack when a program
starts.
See \f[B]Compiler Control\f[R]
[https://docs.oracle.com/en/java/javase/12/vm/compiler\-control1.html#GUID\-94AD8194\-786A\-4F19\-BFFF\-278F8E237F3A].
.RS
.PP
The \f[CB]\-XX:CompilerDirectivesFile\f[R] option has to be used together
with the \f[CB]\-XX:UnlockDiagnosticVMOptions\f[R] option that unlocks
diagnostic JVM options.
.RE
.TP
.B \f[CB]\-XX:+CompilerDirectivesPrint\f[R]
Prints the directives stack when the program starts or when a new
directive is added.
.RS
.PP
The \f[CB]\-XX:+CompilerDirectivesPrint\f[R] option has to be used
together with the \f[CB]\-XX:UnlockDiagnosticVMOptions\f[R] option that
unlocks diagnostic JVM options.
.RE
.TP
.B \f[CB]\-XX:CompileOnly=\f[R]\f[I]methods\f[R]
Sets the list of methods (separated by commas) to which compilation
should be restricted.
Only the specified methods are compiled.
Specify each method with the full class name (including the packages and
subpackages).
For example, to compile only the \f[CB]length()\f[R] method of the
\f[CB]String\f[R] class and the \f[CB]size()\f[R] method of the
\f[CB]List\f[R] class, use the following:
.RS
.RS
.PP
\f[CB]\-XX:CompileOnly=java/lang/String.length,java/util/List.size\f[R]
.RE
.PP
Note that the full class name is specified, including all packages and
subpackages separated by a slash (\f[CB]/\f[R]).
For easier cut and paste operations, it\[aq]s also possible to use the
method name format produced by the \f[CB]\-XX:+PrintCompilation\f[R] and
\f[CB]\-XX:+LogCompilation\f[R] options:
.RS
.PP
\f[CB]\-XX:CompileOnly=java.lang.String::length,java.util.List::size\f[R]
.RE
.PP
Although wildcards aren\[aq]t 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:
.IP
.nf
\f[CB]
\-XX:CompileOnly=java/lang/String
\-XX:CompileOnly=java/lang
\-XX:CompileOnly=.length
\f[R]
.fi
.RE
.TP
.B \f[CB]\-XX:CompileThresholdScaling=\f[R]\f[I]scale\f[R]
Provides unified control of first compilation.
This option controls when methods are first compiled for both the tiered
and the nontiered modes of operation.
The \f[CB]CompileThresholdScaling\f[R] option has a floating point value
between 0 and +Inf and scales the thresholds corresponding to the
current mode of operation (both tiered and nontiered).
Setting \f[CB]CompileThresholdScaling\f[R] to a value less than 1.0
results in earlier compilation while values greater than 1.0 delay
compilation.
Setting \f[CB]CompileThresholdScaling\f[R] to 0 is equivalent to disabling
compilation.
.RS
.RE
.TP
.B \f[CB]\-XX:+DoEscapeAnalysis\f[R]
Enables the use of escape analysis.
This option is enabled by default.
To disable the use of escape analysis, specify
\f[CB]\-XX:\-DoEscapeAnalysis\f[R].
.RS
.RE
.TP
.B \f[CB]\-XX:InitialCodeCacheSize=\f[R]\f[I]size\f[R]
Sets the initial code cache size (in bytes).
Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
\f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
\f[CB]G\f[R] to indicate gigabytes.
The default value depends on the platform.
The initial code cache size shouldn\[aq]t be less than the system\[aq]s
minimal memory page size.
The following example shows how to set the initial code cache size to 32
KB:
.RS
.RS
.PP
\f[CB]\-XX:InitialCodeCacheSize=32k\f[R]
.RE
.RE
.TP
.B \f[CB]\-XX:+Inline\f[R]
Enables method inlining.
This option is enabled by default to increase performance.
To disable method inlining, specify \f[CB]\-XX:\-Inline\f[R].
.RS
.RE
.TP
.B \f[CB]\-XX:InlineSmallCode=\f[R]\f[I]size\f[R]
Sets the maximum code size (in bytes) for already compiled methods that
may be inlined.
This flag only applies to the C2 compiler.
Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
\f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
\f[CB]G\f[R] to indicate gigabytes.
The default value depends on the platform and on whether tiered
compilation is enabled.
In the following example it is set to 1000 bytes:
.RS
.RS
.PP
\f[CB]\-XX:InlineSmallCode=1000\f[R]
.RE
.RE
.TP
.B \f[CB]\-XX:+LogCompilation\f[R]
Enables logging of compilation activity to a file named
\f[CB]hotspot.log\f[R] in the current working directory.
You can specify a different log file path and name using the
\f[CB]\-XX:LogFile\f[R] option.
.RS
.PP
By default, this option is disabled and compilation activity isn\[aq]t
logged.
The \f[CB]\-XX:+LogCompilation\f[R] option has to be used together with
the \f[CB]\-XX:UnlockDiagnosticVMOptions\f[R] option that unlocks
diagnostic JVM options.
.PP
You can enable verbose diagnostic output with a message printed to the
console every time a method is compiled by using the
\f[CB]\-XX:+PrintCompilation\f[R] option.
.RE
.TP
.B \f[CB]\-XX:FreqInlineSize=\f[R]\f[I]size\f[R]
Sets the maximum bytecode size (in bytes) of a hot method to be inlined.
This flag only applies to the C2 compiler.
Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
\f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
\f[CB]G\f[R] to indicate gigabytes.
The default value depends on the platform.
In the following example it is set to 325 bytes:
.RS
.RS
.PP
\f[CB]\-XX:FreqInlineSize=325\f[R]
.RE
.RE
.TP
.B \f[CB]\-XX:MaxInlineSize=\f[R]\f[I]size\f[R]
Sets the maximum bytecode size (in bytes) of a cold method to be
inlined.
This flag only applies to the C2 compiler.
Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
\f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
\f[CB]G\f[R] to indicate gigabytes.
By default, the maximum bytecode size is set to 35 bytes:
.RS
.RS
.PP
\f[CB]\-XX:MaxInlineSize=35\f[R]
.RE
.RE
.TP
.B \f[CB]\-XX:C1MaxInlineSize=\f[R]\f[I]size\f[R]
Sets the maximum bytecode size (in bytes) of a cold method to be
inlined.
This flag only applies to the C1 compiler.
Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
\f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
\f[CB]G\f[R] to indicate gigabytes.
By default, the maximum bytecode size is set to 35 bytes:
.RS
.RS
.PP
\f[CB]\-XX:MaxInlineSize=35\f[R]
.RE
.RE
.TP
.B \f[CB]\-XX:MaxTrivialSize=\f[R]\f[I]size\f[R]
Sets the maximum bytecode size (in bytes) of a trivial method to be
inlined.
This flag only applies to the C2 compiler.
Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
\f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
\f[CB]G\f[R] to indicate gigabytes.
By default, the maximum bytecode size of a trivial method is set to 6
bytes:
.RS
.RS
.PP
\f[CB]\-XX:MaxTrivialSize=6\f[R]
.RE
.RE
.TP
.B \f[CB]\-XX:C1MaxTrivialSize=\f[R]\f[I]size\f[R]
Sets the maximum bytecode size (in bytes) of a trivial method to be
inlined.
This flag only applies to the C1 compiler.
Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
\f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
\f[CB]G\f[R] to indicate gigabytes.
By default, the maximum bytecode size of a trivial method is set to 6
bytes:
.RS
.RS
.PP
\f[CB]\-XX:MaxTrivialSize=6\f[R]
.RE
.RE
.TP
.B \f[CB]\-XX:MaxNodeLimit=\f[R]\f[I]nodes\f[R]
Sets the maximum number of nodes to be used during single method
compilation.
By default the value depends on the features enabled.
In the following example the maximum number of nodes is set to 100,000:
.RS
.RS
.PP
\f[CB]\-XX:MaxNodeLimit=100000\f[R]
.RE
.RE
.TP
.B \f[CB]\-XX:NonNMethodCodeHeapSize=\f[R]\f[I]size\f[R]
Sets the size in bytes of the code segment containing nonmethod code.
.RS
.PP
A nonmethod code segment containing nonmethod code, such as compiler
buffers and the bytecode interpreter.
This code type stays in the code cache forever.
This flag is used only if \f[CB]\-XX:SegmentedCodeCache\f[R] is enabled.
.RE
.TP
.B \f[CB]\-XX:NonProfiledCodeHeapSize=\f[R]\f[I]size\f[R]
Sets the size in bytes of the code segment containing nonprofiled
methods.
This flag is used only if \f[CB]\-XX:SegmentedCodeCache\f[R] is enabled.
.RS
.RE
.TP
.B \f[CB]\-XX:+OptimizeStringConcat\f[R]
Enables the optimization of \f[CB]String\f[R] concatenation operations.
This option is enabled by default.
To disable the optimization of \f[CB]String\f[R] concatenation operations,
specify \f[CB]\-XX:\-OptimizeStringConcat\f[R].
.RS
.RE
.TP
.B \f[CB]\-XX:+PrintAssembly\f[R]
Enables printing of assembly code for bytecoded and native methods by
using the external \f[CB]hsdis\-<arch>.so\f[R] or \f[CB]\&.dll\f[R] library.
For 64\-bit VM on Windows, it\[aq]s \f[CB]hsdis\-amd64.dll\f[R].
This lets you to see the generated code, which may help you to diagnose
performance issues.
.RS
.PP
By default, this option is disabled and assembly code isn\[aq]t printed.
The \f[CB]\-XX:+PrintAssembly\f[R] option has to be used together with the
\f[CB]\-XX:UnlockDiagnosticVMOptions\f[R] option that unlocks diagnostic
JVM options.
.RE
.TP
.B \f[CB]\-XX:ProfiledCodeHeapSize=\f[R]\f[I]size\f[R]
Sets the size in bytes of the code segment containing profiled methods.
This flag is used only if \f[CB]\-XX:SegmentedCodeCache\f[R] is enabled.
.RS
.RE
.TP
.B \f[CB]\-XX:+PrintCompilation\f[R]
Enables verbose diagnostic output from the JVM by printing a message to
the console every time a method is compiled.
This lets you to see which methods actually get compiled.
By default, this option is disabled and diagnostic output isn\[aq]t
printed.
.RS
.PP
You can also log compilation activity to a file by using the
\f[CB]\-XX:+LogCompilation\f[R] option.
.RE
.TP
.B \f[CB]\-XX:+PrintInlining\f[R]
Enables printing of inlining decisions.
This let\[aq]s you see which methods are getting inlined.
.RS
.PP
By default, this option is disabled and inlining information isn\[aq]t
printed.
The \f[CB]\-XX:+PrintInlining\f[R] option has to be used together with the
\f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R] option that unlocks diagnostic
JVM options.
.RE
.TP
.B \f[CB]\-XX:ReservedCodeCacheSize=\f[R]\f[I]size\f[R]
Sets the maximum code cache size (in bytes) for JIT\-compiled code.
Append the letter \f[CB]k\f[R] or \f[CB]K\f[R] to indicate kilobytes,
\f[CB]m\f[R] or \f[CB]M\f[R] to indicate megabytes, or \f[CB]g\f[R] or
\f[CB]G\f[R] to indicate gigabytes.
The default maximum code cache size is 240 MB; if you disable tiered
compilation with the option \f[CB]\-XX:\-TieredCompilation\f[R], 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 shouldn\[aq]t be less than the initial code
cache size; see the option \f[CB]\-XX:InitialCodeCacheSize\f[R].
.RS
.RE
.TP
.B \f[CB]\-XX:RTMAbortRatio=\f[R]\f[I]abort_ratio\f[R]
Specifies the RTM abort ratio is specified as a percentage (%) of all
executed RTM transactions.
If a number of aborted transactions becomes greater than this ratio,
then the compiled code is deoptimized.
This ratio is used when the \f[CB]\-XX:+UseRTMDeopt\f[R] option is
enabled.
The default value of this option is 50.
This means that the compiled code is deoptimized if 50% of all
transactions are aborted.
.RS
.RE
.TP
.B \f[CB]\-XX:RTMRetryCount=\f[R]\f[I]number_of_retries\f[R]
Specifies the number of times that the RTM locking code is retried, when
it is aborted or busy, before falling back to the normal locking
mechanism.
The default value for this option is 5.
The \f[CB]\-XX:UseRTMLocking\f[R] option must be enabled.
.RS
.RE
.TP
.B \f[CB]\-XX:+SegmentedCodeCache\f[R]
Enables segmentation of the code cache.
Without the \f[CB]\-XX:+SegmentedCodeCache\f[R], the code cache consists
of one large segment.
With \f[CB]\-XX:+SegmentedCodeCache\f[R], we have separate segments for
nonmethod, profiled method, and nonprofiled method code.
These segments aren\[aq]t resized at runtime.
The feature is enabled by default if tiered compilation is enabled
(\f[CB]\-XX:+TieredCompilation\f[R] ) and
\f[CB]\-XX:ReservedCodeCacheSize\f[R] >= 240 MB.
The advantages are better control of the memory footprint, reduced code
fragmentation, and better iTLB/iCache behavior due to improved locality.
iTLB/iCache is a CPU\-specific term meaning Instruction Translation
Lookaside Buffer (ITLB).
ICache is an instruction cache in theCPU.
The implementation of the code cache can be found in the file:
\f[CB]/share/vm/code/codeCache.cpp\f[R].
.RS
.RE
.TP
.B \f[CB]\-XX:StartAggressiveSweepingAt=\f[R]\f[I]percent\f[R]
Forces stack scanning of active methods to aggressively remove unused
code when only the given percentage of the code cache is free.
The default value is 10%.
.RS
.RE
.TP
.B \f[CB]\-XX:\-TieredCompilation\f[R]
Disables the use of tiered compilation.
By default, this option is enabled.
.RS
.RE
.TP
.B \f[CB]\-XX:UseSSE=\f[R]\f[I]version\f[R]
Enables the use of SSE instruction set of a specified version.
Is set by default to the highest supported version available (x86 only).
.RS
.RE
.TP
.B \f[CB]\-XX:UseAVX=\f[R]\f[I]version\f[R]
Enables the use of AVX instruction set of a specified version.
Is set by default to the highest supported version available (x86 only).
.RS
.RE
.TP
.B \f[CB]\-XX:+UseAES\f[R]
Enables hardware\-based AES intrinsics for hardware that supports it.
This option is on by default on hardware that has the necessary
instructions.
The \f[CB]\-XX:+UseAES\f[R] is used in conjunction with UseAESIntrinsics.
Flags that control intrinsics now require the option
\f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
.RS
.RE
.TP
.B \f[CB]\-XX:+UseAESIntrinsics\f[R]
Enables AES intrinsics.
Specifying\f[CB]\-XX:+UseAESIntrinsics\f[R] is equivalent to also enabling
\f[CB]\-XX:+UseAES\f[R].
To disable hardware\-based AES intrinsics, specify
\f[CB]\-XX:\-UseAES\ \-XX:\-UseAESIntrinsics\f[R].
For example, to enable hardware AES, use the following flags:
.RS
.RS
.PP
\f[CB]\-XX:+UseAES\ \-XX:+UseAESIntrinsics\f[R]
.RE
.PP
Flags that control intrinsics now require the option
\f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
.RE
.TP
.B \f[CB]\-XX:+UseAESCTRIntrinsics\f[R]
Analogous to \f[CB]\-XX:+UseAESIntrinsics\f[R] enables AES/CTR intrinsics.
.RS
.RE
.TP
.B \f[CB]\-XX:+UseGHASHIntrinsics\f[R]
Controls the use of GHASH intrinsics.
Enabled by default on platforms that support the corresponding
instructions.
Flags that control intrinsics now require the option
\f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
.RS
.RE
.TP
.B \f[CB]\-XX:+UseBASE64Intrinsics\f[R]
Controls the use of accelerated BASE64 encoding routines for
\f[CB]java.util.Base64\f[R].
Enabled by default on platforms that support it.
Flags that control intrinsics now require the option
\f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
.RS
.RE
.TP
.B \f[CB]\-XX:+UseAdler32Intrinsics\f[R]
Controls the use of Adler32 checksum algorithm intrinsic for
\f[CB]java.util.zip.Adler32\f[R].
Enabled by default on platforms that support it.
Flags that control intrinsics now require the option
\f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
.RS
.RE
.TP
.B \f[CB]\-XX:+UseCRC32Intrinsics\f[R]
Controls the use of CRC32 intrinsics for \f[CB]java.util.zip.CRC32\f[R].
Enabled by default on platforms that support it.
Flags that control intrinsics now require the option
\f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
.RS
.RE
.TP
.B \f[CB]\-XX:+UseCRC32CIntrinsics\f[R]
Controls the use of CRC32C intrinsics for \f[CB]java.util.zip.CRC32C\f[R].
Enabled by default on platforms that support it.
Flags that control intrinsics now require the option
\f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
.RS
.RE
.TP
.B \f[CB]\-XX:+UseSHA\f[R]
Enables hardware\-based intrinsics for SHA crypto hash functions for
some hardware.
The \f[CB]UseSHA\f[R] option is used in conjunction with the
\f[CB]UseSHA1Intrinsics\f[R], \f[CB]UseSHA256Intrinsics\f[R], and
\f[CB]UseSHA512Intrinsics\f[R] options.
.RS
.PP
The \f[CB]UseSHA\f[R] and \f[CB]UseSHA*Intrinsics\f[R] flags are enabled by
default on machines that support the corresponding instructions.
.PP
This feature is applicable only when using the
\f[CB]sun.security.provider.Sun\f[R] provider for SHA operations.
Flags that control intrinsics now require the option
\f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
.PP
To disable all hardware\-based SHA intrinsics, specify the
\f[CB]\-XX:\-UseSHA\f[R].
To disable only a particular SHA intrinsic, use the appropriate
corresponding option.
For example: \f[CB]\-XX:\-UseSHA256Intrinsics\f[R].
.RE
.TP
.B \f[CB]\-XX:+UseSHA1Intrinsics\f[R]
Enables intrinsics for SHA\-1 crypto hash function.
Flags that control intrinsics now require the option
\f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
.RS
.RE
.TP
.B \f[CB]\-XX:+UseSHA256Intrinsics\f[R]
Enables intrinsics for SHA\-224 and SHA\-256 crypto hash functions.
Flags that control intrinsics now require the option
\f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
.RS
.RE
.TP
.B \f[CB]\-XX:+UseSHA512Intrinsics\f[R]
Enables intrinsics for SHA\-384 and SHA\-512 crypto hash functions.
Flags that control intrinsics now require the option
\f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
.RS
.RE
.TP
.B \f[CB]\-XX:+UseMathExactIntrinsics\f[R]
Enables intrinsification of various \f[CB]java.lang.Math.*Exact()\f[R]
functions.
Enabled by default.
Flags that control intrinsics now require the option
\f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
.RS
.RE
.TP
.B \f[CB]\-XX:+UseMultiplyToLenIntrinsic\f[R]
Enables intrinsification of \f[CB]BigInteger.multiplyToLen()\f[R].
Enabled by default on platforms that support it.
Flags that control intrinsics now require the option
\f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
.RS
.RE
.TP
.B \-XX:+UseSquareToLenIntrinsic
Enables intrinsification of \f[CB]BigInteger.squareToLen()\f[R].
Enabled by default on platforms that support it.
Flags that control intrinsics now require the option
\f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
.RS
.RE
.TP
.B \-XX:+UseMulAddIntrinsic
Enables intrinsification of \f[CB]BigInteger.mulAdd()\f[R].
Enabled by default on platforms that support it.
Flags that control intrinsics now require the option
\f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
.RS
.RE
.TP
.B \-XX:+UseMontgomeryMultiplyIntrinsic
Enables intrinsification of \f[CB]BigInteger.montgomeryMultiply()\f[R].
Enabled by default on platforms that support it.
Flags that control intrinsics now require the option
\f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
.RS
.RE
.TP
.B \-XX:+UseMontgomerySquareIntrinsic
Enables intrinsification of \f[CB]BigInteger.montgomerySquare()\f[R].
Enabled by default on platforms that support it.
Flags that control intrinsics now require the option
\f[CB]\-XX:+UnlockDiagnosticVMOptions\f[R].
.RS
.RE
.TP
.B \f[CB]\-XX:+UseCMoveUnconditionally\f[R]
Generates CMove (scalar and vector) instructions regardless of
profitability analysis.
.RS
.RE
.TP
.B \f[CB]\-XX:+UseCodeCacheFlushing\f[R]
Enables flushing of the code cache before shutting down the compiler.
This option is enabled by default.
To disable flushing of the code cache before shutting down the compiler,
specify \f[CB]\-XX:\-UseCodeCacheFlushing\f[R].
.RS
.RE
.TP
.B \f[CB]\-XX:+UseCondCardMark\f[R]
Enables checking if the card is already marked before updating the card
table.
This option is disabled by default.
It should be used only on machines with multiple sockets, where it
increases the performance of Java applications that rely on concurrent
operations.
.RS
.RE
.TP
.B \f[CB]\-XX:+UseCountedLoopSafepoints\f[R]
Keeps safepoints in counted loops.
Its default value depends on whether the selected garbage collector
requires low latency safepoints.
.RS
.RE
.TP
.B \f[CB]\-XX:LoopStripMiningIter=\f[R]\f[I]number_of_iterations\f[R]
Controls the number of iterations in the inner strip mined loop.
Strip mining transforms counted loops into two level nested loops.
Safepoints are kept in the outer loop while the inner loop can execute
at full speed.
This option controls the maximum number of iterations in the inner loop.
The default value is 1,000.
.RS
.RE
.TP
.B \f[CB]\-XX:LoopStripMiningIterShortLoop\f[R]=\f[I]number_of_iterations\f[R]
Controls loop strip mining optimization.
Loops with the number of iterations less than specified will not have
safepoints in them.
Default value is 1/10th of \f[CB]\-XX:LoopStripMiningIter\f[R].
.RS
.RE
.TP
.B \f[CB]\-XX:+UseFMA\f[R]
Enables hardware\-based FMA intrinsics for hardware where FMA
instructions are available (such as, Intel and ARM64).
FMA intrinsics are generated for the
\f[CB]java.lang.Math.fma(\f[R]\f[I]a\f[R]\f[CB],\f[R] \f[I]b\f[R]\f[CB],\f[R]
\f[I]c\f[R]\f[CB])\f[R] methods that calculate the value of \f[CB](\f[R]
\f[I]a\f[R] \f[CB]*\f[R] \f[I]b\f[R] \f[CB]+\f[R] \f[I]c\f[R] \f[CB])\f[R]
expressions.
.RS
.RE
.TP
.B \f[CB]\-XX:+UseRTMDeopt\f[R]
Autotunes RTM locking depending on the abort ratio.
This ratio is specified by the \f[CB]\-XX:RTMAbortRatio\f[R] option.
If the number of aborted transactions exceeds the abort ratio, then the
method containing the lock is deoptimized and recompiled with all locks
as normal locks.
This option is disabled by default.
The \f[CB]\-XX:+UseRTMLocking\f[R] option must be enabled.
.RS
.RE
.TP
.B \f[CB]\-XX:+UseRTMLocking\f[R]
Generates 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 available only on x86 CPUs that support
Transactional Synchronization Extensions (TSX).
.RS
.PP
RTM is part of Intel\[aq]s TSX, which is an x86 instruction set
extension and facilitates the creation of multithreaded applications.
RTM introduces the new instructions \f[CB]XBEGIN\f[R], \f[CB]XABORT\f[R],
\f[CB]XEND\f[R], and \f[CB]XTEST\f[R].
The \f[CB]XBEGIN\f[R] and \f[CB]XEND\f[R] instructions enclose a set of
instructions to run as a transaction.
If no conflict is found when running the transaction, then the memory
and register modifications are committed together at the \f[CB]XEND\f[R]
instruction.
The \f[CB]XABORT\f[R] instruction can be used to explicitly abort a
transaction and the \f[CB]XTEST\f[R] instruction checks if a set of
instructions is being run in a transaction.
.PP
A lock on a transaction is inflated when another thread tries to access
the same transaction, thereby blocking the thread that didn\[aq]t
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\[aq]s system.
.PP
RTM improves performance for highly contended locks with low conflict in
a critical region (which is code that must not be accessed by more than
one thread concurrently).
RTM also improves the performance of coarse\-grain locking, which
typically doesn\[aq]t 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.
.RE
.TP
.B \f[CB]\-XX:+UseSuperWord\f[R]
Enables the transformation of scalar operations into superword
operations.
Superword is a vectorization optimization.
This option is enabled by default.
To disable the transformation of scalar operations into superword
operations, specify \f[CB]\-XX:\-UseSuperWord\f[R].
.RS
.RE
.SH ADVANCED SERVICEABILITY OPTIONS FOR JAVA
.PP
These \f[CB]java\f[R] options provide the ability to gather system
information and perform extensive debugging.
.TP
.B \f[CB]\-XX:+DisableAttachMechanism\f[R]
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 diagnostics and troubleshooting tools such as
\f[CB]jcmd\f[R], \f[CB]jstack\f[R], \f[CB]jmap\f[R], and \f[CB]jinfo\f[R].
.RS
.RS
.PP
\f[B]Note:\f[R] The tools such as \f[B]jcmd\f[R], \f[B]jinfo\f[R],
\f[B]jmap\f[R], and \f[B]jstack\f[R] shipped with the JDK aren\[aq]t
supported when using the tools from one JDK version to troubleshoot a
different JDK version.
.RE
.RE
.TP
.B \f[CB]\-XX:+ExtendedDTraceProbes\f[R]
\f[B]Linux and macOS:\f[R] Enables additional \f[CB]dtrace\f[R] tool probes
that affect the performance.
By default, this option is disabled and \f[CB]dtrace\f[R] performs only
standard probes.
.RS
.RE
.TP
.B \f[CB]\-XX:+HeapDumpOnOutOfMemoryError\f[R]
Enables the dumping of the Java heap to a file in the current directory
by using the heap profiler (HPROF) when a
\f[CB]java.lang.OutOfMemoryError\f[R] exception is thrown.
You can explicitly set the heap dump file path and name using the
\f[CB]\-XX:HeapDumpPath\f[R] option.
By default, this option is disabled and the heap isn\[aq]t dumped when
an \f[CB]OutOfMemoryError\f[R] exception is thrown.
.RS
.RE
.TP
.B \f[CB]\-XX:HeapDumpPath=path\f[R]
Sets the path and file name for writing the heap dump provided by the
heap profiler (HPROF) when the \f[CB]\-XX:+HeapDumpOnOutOfMemoryError\f[R]
option is set.
By default, the file is created in the current working directory, and
it\[aq]s named \f[CB]java_pid<pid>.hprof\f[R] where \f[CB]<pid>\f[R] is the
identifier of the process that caused the error.
The following example shows how to set the default file explicitly
(\f[CB]%p\f[R] represents the current process identifier):
.RS
.RS
.PP
\f[CB]\-XX:HeapDumpPath=./java_pid%p.hprof\f[R]
.RE
.IP \[bu] 2
\f[B]Linux and macOS:\f[R] The following example shows how to set the
heap dump file to \f[CB]/var/log/java/java_heapdump.hprof\f[R]:
.RS 2
.RS
.PP
\f[CB]\-XX:HeapDumpPath=/var/log/java/java_heapdump.hprof\f[R]
.RE
.RE
.IP \[bu] 2
\f[B]Windows:\f[R] The following example shows how to set the heap dump
file to \f[CB]C:/log/java/java_heapdump.log\f[R]:
.RS 2
.RS