Garbage Collection Enhancements


Java 12 released multiple improvements to its garbage collection algorithms.

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

An experimental Low-Pause-Time Garbage Collector, Shenandoah is initiated to bring down the GC pause time. It works in alignment with running java threads. This assists to decrease the possession of GC over stack size and makes it accordant. Now Garbage collection pause time will be the same for 2 MB as well as for 2 GB stack space.

Shenandoah is awaiting to be part of the principal JAVA launch with Java 15.

JEP 346 – Promptly Return Unused Committed Memory

With Java 12, G1 will proceed to java heap space if the application is not active and may launch the memory to the operating system. This preemptive behavior preserves and free memory.

JEP 344: Abortable Mixed Collections

With Java 12, G1 regulation has been enhanced. Now, G1 mixed collections are abortable if they surpass the explained pause limit. Now mixed collections are dispersed into compulsory and optional. G1 collectors can give priority to the compulsory sets to check the pause time objective.