Automatic memory management is one of Python’s key features, yet for many developers it stays opaque: objects appear when you create them and vanish when you stop using them, with little visibility into what happens in between.
This talk pulls back that curtain and explains how CPython actually manages memory—from how objects are allocated and laid out in memory, to how unused objects are reclaimed through reference counting, to why reference counting alone is not enough when objects reference each other in cycles.
We will cover the cyclic garbage collector: how it discovers unreachable reference cycles, and why it is split across generations to amortize cost. Along the way, we will touch on practical debugging and tuning: interpreting GC behavior and spotting retention and leaks.