Garbage First (G1)

The Garbage First collector is the most recent implementation. It is a server-side implementation that tends to decrease the pauses and concurrently works with the application. It introduces a new way of visualizing the heap.

The heap is divided into constant-sized regions. The G1 starts to mark the regions concurrently. After this phase, it knows which regions are almost empty and then starts collecting the memory from these regions, allowing the G1 to get a lot of memory pretty quickly and without much effort. This is where the name of this algorithm comes from. Then, in the compact phase, G1 can copy objects from multiple regions to a single region to ensure that it stays efficient.

An important thing to know about the ...

Get Java EE 8 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.