Java 12 - Microbenchmark

Java 12 introduces multiple enhancements to its garbage collection algorithms.

JEP 189 – Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)

An experimental Low-Pause-Time Garbage Collector, Shenandoah is introduced to reduce the GC pause time. It works in parallel with running java threads. This helps to reduce the dependency of GC over heap size and makes it consistent. Now Garbage collection pause time would be similar for 2 MB as well as for 2 GB heap sapce.

Shenandoah is expected to be part of main JAVA release with Java 15.

JEP 346 – Promptly Return Unused Committed Memory

With Java 12, G1 will process java heap space if application is inactive and may release the memory to operating system. This preemtive behavior conserve and free memory.

JEP 344 : Abortable Mixed Collections

With Java 12, G1 efficiency has been improved. Now G1 mixed collections are abortable if they exceed the define pause limit. Now mixed collections are spilt into mandatory and optional. G1 collector can prioritize the mandatory sets to be check the pause time goal.