Module 23 explains where Python’s memory goes and when it comes back. By the end you can describe reference counting and the cyclic collector, use weak references and finalizers, measure object sizes, shrink many small objects, understand interning, and find a memory leak with tracemalloc.
More lessons in Complete Python Programming