Python iconPythonSep 30, 2026 ~6 min source read

Garbage Collection: Generational? Incremental? Both! — Mark Shannon’s proposal from Python Language Summit 2026

After the incremental garbage collector shipped in Python 3.14 and was reverted to the generational approach used in 3.13 because of production memory pressure, Mark Shannon outlined a hybrid design that aims to reduce pause times without excessive memory use.

Python Insider: Garbage Collection: Generational? Incremental? Both! (Python Language Summit 2026)

Share this story

Send the public story page.

Useful takeaways from this story.

Shannon’s hybrid proposal: two generations (young and old) with alternating incremental scavenges, a fixed initial young-gen size (20 MB), and more frequent old-gen scavenges relative to young-gen survivor rates.

Transition and configurability concerns exist: more GC code to maintain vs. improving the default, and possible runtime tuning options similar to JVM-style GC flags were discussed.

# What happened

Mark Shannon, the author of the incremental garbage collector that shipped in Python 3.14 and was later reverted, presented a path forward at the Python Language Summit 2026. His talk focused on reducing garbage-collection pause times while keeping memory use reasonable.

# Why it matters

# The trade-offs

Two mainstream GC strategies were compared:

  • Generational GC assumes most objects die young, so it keeps memory use low but can produce long pauses when collecting older generations.

Shannon measured a metric he calls "scavenge effectiveness" (objects collected divided by objects visited). Both approaches had low effectiveness for Python: the generational GC was about 0.3% and the reverted incremental GC about 1%.

# Shannon's hybrid proposal

The recommended approach blends generational and incremental ideas:

  • Use exactly two generations: a young and an old generation.
  • Alternate between incremental scavenges on the young and old generations, avoiding full-heap non-generational scans.
  • Fix the young generation initial size at 20 MB.
  • Scavenge the old generation at twice the young-generation survivor rate (i.e., trigger old-gen work proportional to how many objects survive young-gen collections).

The goal is to reduce peak pause times like an incremental collector while keeping memory usage nearer to a generational collector.

# Questions raised and practical concerns

Na also asked about JVM-like runtime configuration for GC tuning. Shannon discussed the idea but noted that more configuration increases surface area and maintenance and that defaults should be improved first.

# Metrics and vocabulary to evaluate changes

Shannon emphasized the need for concrete metrics to judge new designs: pause time distributions, scavenge effectiveness, memory usage, and how collector behavior differs across real-world workloads. He introduced several helpful terms (scavenge, scavenge effectiveness, spaces, generations, survivor rates) to keep the discussion precise.

# Bottom line

Shannon's hybrid model aims to give Python lower pause times without the higher memory footprint of a fully non-generational incremental collector. The proposal is pragmatic: keep reference counting as the main collector, add a two-generation incremental scavenge schedule, and provide reasonable defaults (including a 20 MB young generation) while being mindful of maintenance cost and possible tuning knobs.

More context around this story.

Loading more related stories...

Keep reading in the app

Open the app view to save this story, compare related coverage, and continue from the same source.

Open in app