# Tutorial: The G1 Garbage Collector

DevFeed: [Tutorial: The G1 Garbage Collector](<https://devfeed.tech/articles/tutorial-the-g1-garbage-collector-127559.md>)

Original publisher: [Read original article](<https://inside.java/2026/11/10/g1gc-tutorial/>)

Author: Billy Korando

Published: 2026-11-10T00:00:00Z

Content type: tutorial

Language: en

Sources: [Inside Java](<https://devfeed.tech/sources/inside-java.md>)

Topics: [Tutorial](<https://devfeed.tech/topics/tutorial.md>), [performance-engineering](<https://devfeed.tech/topics/performance-engineering.md>), [Documentation](<https://devfeed.tech/topics/documentation.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [cms](<https://devfeed.tech/tags/cms.md>), [collector](<https://devfeed.tech/tags/collector.md>), [concurrent](<https://devfeed.tech/tags/concurrent.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [design](<https://devfeed.tech/tags/design.md>), [efficiency](<https://devfeed.tech/tags/efficiency.md>), [g1](<https://devfeed.tech/tags/g1.md>), [garbage-collectors](<https://devfeed.tech/tags/garbage-collectors.md>), [history](<https://devfeed.tech/tags/history.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>)

## AI overview

G1 divides the heap into uniform regions and reclaims memory by evacuating live objects while making whole regions with unreachable objects available for reuse. Its cycle combines young-region collections with concurrent marking of old regions; when reclaiming old space, it favors regions with more garbage. G1 aims to balance throughput and pause times, while ParallelGC prioritizes throughput and ZGC prioritizes low latency. G1 is the default on JDK 27 and later; on JDK 9-26 it is selected when the JVM detects at least two CPU cores and more than 1792 MB of available memory, and on JDK 8 it must be enabled with `-XX:+UseG1GC`. The text advises relying on G1's heuristics where possible: heap size and pause-time goals involve tradeoffs among memory footprint, latency, and throughput. `-XX:MaxGCPauseMillis` is a soft target, not a guarantee.

## Source excerpt

In this tutorial, we will cover a brief history of G1, its key design concepts, and how to use it.