Java 12 released multiple improvements to its garbage collection algorithms.
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.
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.
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.