Selectively disabling the JIT or AOT compiler
If your Java™ program failure points to a problem with the JIT or AOT compiler, you can try to narrow down the problem further.
About this task
By default, the JIT compiler optimizes methods at various optimization levels. Different selections of optimizations are applied to different methods, which are based on their call counts. Methods that are called more frequently are optimized at higher levels. By changing JIT compiler parameters, you can control the optimization level at which methods are optimized. You can determine whether the optimizer is at fault and, if it is, which optimization is problematic.
The AOT compiler by default compiles methods at the warm
optimization level.
Forcing the AOT compiler to compile a method at a higher level is possible, but not supported.
java -Xjit:verbose,optLevel=noOpt -mp . -m HelloWorld
runs the HelloWorld program, enables verbose output from the JIT, and makes the JIT generate native
code without performing any optimizations. Optimization options are listed in -Xjit. The AOT compiler is
controlled in a similar manner, by using the -Xaot option. Use the
-Xjit option when you are diagnosing JIT compiler problems, and the
-Xaot option when you are diagnosing AOT compiler problems.Follow these steps to determine which part of the compiler is causing the failure:
Procedure
What to do next
If one of these settings causes your failure to disappear, you have a workaround that you can use. This workaround is temporary while the Java service team analyze and fix the compiler problem. If removing disableInlining from the JIT or AOT parameter list does not cause the failure to reappear, do so to improve performance. Follow the instructions in Locating the failing method to improve the performance of the workaround.
If the failure still occurs
at the noOpt
optimization level, you must disable the JIT or
AOT compiler as a workaround.