Garbage-first collectorThe garbage-first collector (G1) is a garbage collection algorithm introduced in the Oracle HotSpot Java virtual machine (JVM) 6 and supported from 7 Update 4. It was planned to replace concurrent mark sweep collector (CMS) in JVM 7 and was made default in Java 9.[1] Garbage collectorGarbage-first (G1) collector is a server-style garbage collector, targeted for multiprocessors with large memories, that meets a soft real-time goal with high probability, while achieving high-throughput.[2] G1 preferentially collects regions with the least amount of live data, or "garbage first".[3] G1 is the long term replacement of CMS. Whole-heap operations, such as global marking, are performed concurrently with the application threads, to prevent interruptions proportional to heap or live-data size. Concurrent marking provides both collection completeness and identifies regions ripe for reclamation via compacting evacuation. This evacuation is performed in parallel on multiprocessors, to decrease pause times and increase throughput. G1 was first introduced as an experimental option in Java SE 6 Update 14,[4] where it can be enabled with the following two command-line parameters: In Java 9 G1 was made the default garbage collector,[6][1] in spite of Google counter proposing the well-known CMS as the standard, claiming the modified CMS it uses performs better than G1.[7] Since then, Oracle has greatly improved G1's throughput, latency and memory footprint.[8] Related productsGuaranteed real-time behavior even with garbage collection requires a real-time garbage collector such as those that come with Sun's Java RTS[9] or IBM’s WebSphere RT.[10] See alsoReferences
External links |