AIThis post was created with the assistance of artificial intelligence (AI).

TL;DR

Python 3.14 shipped with an experimental incremental garbage collector but faced performance and memory issues. Developers have decided to revert to the older generational GC in both 3.14 and 3.15. The change aims to improve stability and maintainability.

Python’s core development team has officially reverted the incremental garbage collector introduced in Python 3.14 and 3.15, returning to the traditional generational GC due to significant memory pressure and stability issues reported in production environments.

Buying for a business?Offer from Amazon

Get business pricing on monitors, keyboards and dev gear

  • Business-only prices and quantity discounts
  • Tax-exempt purchasing
  • Multiple users, one account, clear invoices
As an affiliate, we earn on qualifying purchases.

The incremental garbage collector was added in Python 3.14 as an experimental feature aimed at reducing pause times during garbage collection. However, reports from users indicated increased memory usage and performance regressions, especially under cyclic garbage workloads. As a result, the core team, after discussions with the Steering Council, decided to revert to the previous generational GC in both 3.14 and 3.15. The reversion was carried out quickly, with plans to consider reintroducing the incremental GC in Python 3.16 through the formal PEP process, allowing for more thorough evaluation. Developers highlighted that maintaining both GCs simultaneously would increase long-term complexity and maintenance overhead, and that the simpler, well-understood generational GC provides greater stability.

Why It Matters

This development is significant because the garbage collector impacts Python’s performance and memory footprint, especially for large or cyclic data structures. Reverting to the proven generational GC aims to improve stability and predictability, which is crucial for production environments. The decision also reflects the challenges of integrating experimental features into a core language used widely in critical systems.

Products Worth Considering

As an affiliate, we earn on qualifying purchases.

Background

Python 3.14 introduced an incremental GC as part of ongoing efforts to optimize garbage collection pause times. The feature was not part of the original PEPs and was rolled out as an experimental change. During testing, several users reported increased memory usage—up to five times higher in some cases—and performance regressions, particularly with cyclic garbage. The core developers initially considered maintaining both GCs as an experimental option but concluded that the added complexity outweighed the benefits. The rollback aligns with Python’s cautious approach to integrating major changes, especially in patch releases, which traditionally prioritize stability.

“The incremental GC didn’t go through the PEP process and caused unforeseen issues. Returning to the old GC provides a safer, more predictable environment.”

— Python core developer

“Having two GCs in production would complicate maintenance and increase risk. It’s better to keep the codebase simple and reliable.”

— Serhiy Storchaka

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 development team plans to evaluate this through the formal PEP process, but specific timelines and technical details are still being discussed.

What’s Next

The core developers will focus on refining the garbage collection system, possibly developing a new, more robust incremental GC as an opt-in feature for Python 3.16. They will also seek more real-world testing and benchmarks to better understand the trade-offs involved. The next release, Python 3.14.5, will likely be released early once the revert is finalized, with further testing ongoing for 3.15 and 3.16.

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 for large applications and real-time systems.

What are the main issues caused by the incremental GC?

Reports indicated increased memory usage—up to five times higher in some cases—and performance regressions, especially with cyclic garbage. These issues affected stability and predictability.

Will the incremental GC be reintroduced in future Python versions?

It is under consideration for Python 3.16, but only after thorough evaluation through the formal PEP process and additional testing to ensure stability.

How does reverting the GC affect Python’s performance and stability?

Reverting to the older generational GC prioritizes stability, reducing memory pressure and performance regressions, especially in production environments.

You May Also Like

CERT is releasing six CVEs for serious security vulnerabilities in dnsmasq

CERT has released six CVEs detailing serious security flaws in dnsmasq, affecting most recent versions. Patches are now available for affected systems.

Another Universal Linux Local Privilege Escalation (LPE) Vulnerability: Dirty Frag, (Fri, May 8th)

A new local privilege escalation named ‘Dirty Frag’ affects many Linux kernels since 2017, allowing root access via chained kernel vulnerabilities. Patch efforts are underway.

Codex just found a “workaround” of not having sudo on my PC

Codex has discovered a method to bypass the need for sudo privileges on a PC, raising questions about security and system management.