-Xaot / -Xnoaot
Use this option to control the behavior of the ahead-of-time (AOT) compiler.
AOT compilation allows the compilation of Java™ classes into native code for subsequent executions of the same program. The AOT compiler works with the class data sharing framework.
The AOT compiler generates native code dynamically while an application runs and caches any generated AOT code in the shared data cache. Subsequent VMs that execute the method can load and use the AOT code from the shared data cache without incurring the performance decrease experienced with JIT-compiled native code.
Because AOT code must persist over different program executions, AOT-generated code does not perform as well as JIT-generated code. AOT code usually performs better than interpreted code.
In a VM without an AOT compiler or with the AOT compiler disabled, the JIT compiler selectively compiles frequently used methods into optimized native code. There is a time cost associated with compiling methods because the JIT compiler operates while the application is running. Because methods begin by being interpreted and most JIT compilations occur during startup, startup times can be increased.
Startup performance can be improved by using the shared AOT code to provide native code without compiling. There is a small time cost to load the AOT code for a method from the shared data cache and bind it into a running program. The time cost is low compared to the time it takes the JIT compiler to compile that method.
The AOT compiler is enabled by default, but is only active when shared classes are enabled. By default, shared classes are disabled so that no AOT activity occurs.
When the AOT compiler is active, the compiler selects the methods to be AOT compiled with the primary goal of improving startup time.
||Enable AOT with modifications|
Note: Although the AOT compiler is enabled by default, it is not active unless shared classes are enabled. Using this option on its own therefore has no effect. Use the -Xshareclasses option to enable shared classes.
You can concatenate several parameters by using commas.
||The number of times a method is called before it is compiled or loaded from an existing shared class cache.|
||The method you want to exclude when AOT code is compiled or loaded from the shared classes cache.|
||Compile or load only the methods listed in the specified limit file.|
||Do not load specified methods.|
||Load specified methods only.|
||Load only the methods listed in the specified limit file).|
||Reports information about the AOT and JIT compiler configuration and method compilation.|
<n>is the number of times a method is called before it is compiled or loaded from an existing shared class cache. For example, setting
-Xaot:count=0forces the AOT compiler to compile everything on first execution.
<method>is the Java method you want to exclude when AOT code is compiled or loaded from the shared classes cache.
Use this option if the method causes the program to fail.
- Compile or load only the methods listed on lines
<n>in the specified limit file (
<filename>). Methods not listed in the limit file and methods listed on lines outside the range are not compiled or loaded.
- Do not load methods beginning with
- Load methods beginning with
- Load only the methods listed on lines
<n>in the specified limit file (
<filename>). Methods not listed in the limit file and methods listed on lines outside the range are not loaded.
- Reports information about the AOT and JIT compiler configuration and method compilation.