Reducing Uninitialized Deoptimizations
In some applications, uninitialized
deoptimizations are common. This problem typically occurs in applications with a warm-up phase that does not compile all the necessary methods. Resolving dependencies in the Java thread as compilation is being scheduled is key. It removes many trapping situations and by combining eager initialization with eager resolution, traps can often be eliminated completely, even for new objects and static field and method access.
Using UseEnhancedClassResolution as a Flag
To reduce uninitialized
deoptimizations, Azul Zing Builds of OpenJDK (Zing) provide the flag UseEnhancedClassResolution
. This flag reduces uninitialized
deoptimizations when the class is already loaded and initialized, but has not been resolved within a particular class
This optimization only applies to allocation sites and might not help applications that are deliberated design to avoid garbage collection.