# G1 garbage collector

6 Hacker News commenters recommended G1 garbage collector and 1 criticized it, November 2025 to November 2026. It was recommended in 5 of 13 months.

**Verdict:** The default garbage collector in Java's HotSpot JVM, which people find fast and rarely in need of tuning. Caveat: it can use a lot of off-heap memory.

## Why people recommend it

- Works well with default settings (3 comments): "I've been able to tune them out for nearly all workloads" ([source](https://news.ycombinator.com/item?id=48971610)) "G1 (the default, just don't add any flags)." ([source](https://news.ycombinator.com/item?id=47432980)) "it is indeed quite fast with G1" ([source](https://news.ycombinator.com/item?id=49712317))
- Fast performance overall (2 comments): "is already faster and better than Python's" ([source](https://news.ycombinator.com/item?id=48133585)) "it is indeed quite fast with G1" ([source](https://news.ycombinator.com/item?id=49712317))

## What people warn about

- High off-heap memory use (2 comments): "G1GC when it was first introduced would create these massive bookkeeping structures in order to run collections" ([source](https://news.ycombinator.com/item?id=47079854)) "It was a nasty surprise to us with G1 how much off heap memory was required" ([source](https://news.ycombinator.com/item?id=47159260))
- Not specified as Java 27 default (1 comments): "Like there's no Java 27 platform spec that says that G1 is the default garbage collector." ([source](https://news.ycombinator.com/item?id=49714138))

## Alternatives hackers recommend

- [ZGC garbage collector](https://hackerapproved.com/p/zgc.md): 17 recommend
- [Boehm GC](https://hackerapproved.com/p/boehm-gc.md): 5 recommend
- [Parallel GC (OpenJDK)](https://hackerapproved.com/p/parallel-gc.md): 5 recommend

## Cite as

Hacker Approved, "G1 garbage collector", https://hackerapproved.com/p/g1-garbage-collector/ (counts from 1,795,640 Hacker News comments, November 2025 to November 2026).
