To reduce application execution time, Java’s segmented code cache would be extended with an optional “hot” code heap to compactly accommodate a part of non-profiled methods, under a draft JDK enhancement proposal now floating in the OpenJDK community. Another success metric of the plan is reducing the fragmentation of highly-optimized code in the code cache.
By extending Java’s compiler control mechanism to mark certain methods as hot so they could compile into the hot code heap, the proposal would separate code that is known to be hot, decrease fragmentation of selected code, and reduce the negative impact of compiled code hotness scattering on the performance of Java applications. It also would provide method-context dependent control for placing C2-compiled blobs into the hot code heap and provide a basis for the possibility of profiling and compacting the code using the virtual machine itself.