Reverting the incremental GC in Python 3.14 and 3.15

TL;DR

Python 3.14 shipped with an experimental incremental garbage collector, but due to performance and memory issues, the Python core team has decided to revert to the traditional generational GC in both 3.14 and 3.15. The reversion is confirmed and will be included in upcoming releases.

Python 3.14 and 3.15 will revert the newly introduced incremental garbage collector (GC) due to performance issues, returning to the previous generational GC. This decision was made following reports of significant memory pressure and performance regressions in production environments, confirmed by the Python core team.

The incremental GC was introduced in Python 3.14 as an experimental feature aimed at reducing pause times during garbage collection. However, early reports indicate that it causes increased memory usage—up to five times higher in some cases—and longer overall runtimes, especially when handling cyclic garbage.

The core team conducted discussions with the Steering Council and decided to revert to the known, stable generational GC used in Python 3.13. The reversion will be included in the next patch releases: Python 3.14.5 and an early release of 3.15, which is still in alpha.

Developers have considered options such as providing both GCs as selectable at startup, but concerns about increased maintenance complexity and risk have led to the decision to keep the old GC as default and possibly reintroduce the incremental GC in Python 3.16 through a more formal PEP process.

Why It Matters

This development is significant because garbage collection impacts Python’s performance and memory management, especially in large or cyclic data structures common in production applications. The decision to revert reflects a cautious approach prioritizing stability and predictability over experimental features.

For developers and organizations relying on Python for production workloads, this means sticking with the proven generational GC for now, avoiding unexpected memory bloat or slowdowns caused by the incremental GC. The reversion also indicates ongoing evaluation of alternative GC strategies in future Python releases.

Python Crash Course, 3rd Edition: A Hands-On, Project-Based Introduction to Programming

Python Crash Course, 3rd Edition: A Hands-On, Project-Based Introduction to Programming

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background

The incremental GC was introduced in Python 3.14 as part of an effort to improve pause times during garbage collection. Prior to this, Python used a generational GC, which is well-understood but can cause noticeable pauses in large applications. The new GC aimed to reduce these pauses but encountered issues in real-world testing.

Testing with synthetic benchmarks showed that the incremental GC could significantly increase peak memory usage and runtime, especially when cyclic garbage was created in large quantities. These results prompted discussions within the Python core team about the trade-offs between pause time improvements and overall resource consumption.

Since the initial introduction, community feedback and internal testing have reinforced concerns about stability and performance, leading to the decision to revert in both 3.14 and 3.15, with plans to revisit the feature in future releases after more thorough evaluation.

“Due to performance regressions and memory issues, we have decided to revert the incremental GC in Python 3.14 and 3.15, returning to the stable generational approach.”

— Python core developer

“Maintaining both GCs is feasible but would increase complexity. It’s safer to revert to the old GC and consider reintroducing the incremental version in 3.16 after more testing.”

— Neil Schemenauer

Python Memory Management Optimization Guide : 75 Garbage Collection and Allocation Exercises Using Weakrefs, Slots, and Profiling to Minimize Footprint in Large Apps

Python Memory Management Optimization Guide : 75 Garbage Collection and Allocation Exercises Using Weakrefs, Slots, and Profiling to Minimize Footprint in Large Apps

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What Remains Unclear

It remains unclear whether the incremental GC will be reintroduced in Python 3.16, and if so, under what conditions or with what improvements. The community is awaiting more detailed benchmarks and real-world testing results to guide future decisions.

Python Performance Engineering: Optimization Techniques Explained

Python Performance Engineering: Optimization Techniques Explained

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What’s Next

The Python development team will focus on stabilizing the current generational GC in the upcoming 3.14.5 and 3.15 releases. Discussions about the incremental GC will continue, with potential re-evaluation for Python 3.16 through a formal PEP process. Developers are encouraged to test the current stable release and provide feedback.

Amazon

Python memory management courses

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

Why was the incremental garbage collector introduced in Python 3.14?

The incremental GC was introduced to reduce pause times during garbage collection, aiming to improve performance in applications with large memory footprints or real-time requirements.

What are the main issues caused by the incremental GC?

Early testing revealed increased memory usage—up to five times higher—and longer total execution times, especially when handling cyclic garbage, leading to performance regressions in some scenarios.

Will the incremental GC be reintroduced in the future?

The Python core team is considering reintroducing the incremental GC in Python 3.16 after further testing and evaluation, potentially through a formal PEP process to ensure stability and performance improvements.

How will this affect existing Python applications?

Applications relying on the current generational GC should see no change. Those that attempted to use the incremental GC may experience higher memory use and slower runtimes until it is re-enabled or replaced.

You May Also Like

Show HN: Performative-UI – a react component library of design tropes

A new React component library called Performative-UI, featuring common design patterns, has been shared on Show HN, aiming to simplify UI development.

Japan space startups to train engineers from India, Philippines, Indonesia

Japan’s JICA launches a program to train space industry professionals from India, Philippines, and Indonesia, focusing on satellite manufacturing and data analysis.

Fidonet: Technology, Use, Tools, and History (1993)

An overview of FidoNet’s technology, network structure, tools, and historical development as of 1993, highlighting its significance in early email networking.

Treadmill Basics: Incline, Speed, and Motor Terms Explained

A comprehensive guide to treadmill basics—incline, speed, motor terms, and how to optimize your workout for maximum results.