~/talk

Demystifying Python’s Generational Garbage Collector

Talkat PyCon US 2026 · 2026-05-13..05-19· [python]
slides:none on file

Explains exactly how CPython lays out objects, how reference counting immediately frees unreachable objects, and why -5 to 256 and small-string interning matter; shows how unreachable cycles survive reference counting and how the cyclic gen0→gen1→gen2 GC amortizes work with configurable gc.enable()/gc.disable() and thresholds; demonstrates use of memory profilers, snapshot diffs, and retention metrics to find surprising leaks and whether manual GC or tuning actually reduces RSS.

AI-written summary · about

  1. 0:00Introduction
  2. 3:17Memory management analogy
  3. 5:24Why garbage collection matters
  4. 6:05C versus Python memory
  5. 7:31Reference counting explained
  6. 10:41Cleaning zero-reference objects
  7. 12:26Reference counting optimizations
  8. 13:31Circular references and leaks
  9. 14:56Cycle detection in Python
  10. 15:58Generational garbage collection
  11. 16:38Managing GC thresholds
  12. 18:03Why memory profiling matters
  13. 20:08Memory profiling tools
  14. 21:32Enterprise software lessons
  15. 24:24Fundamentals in programming
  16. 25:26AI tools versus human expertise
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.