Inside CPython's allocator
Connect Python allocations to pymalloc arenas, pools, blocks, process RSS, tracemalloc domains, and responsible measurement.
Independent field notes / Vol. 01
Precise explanations of the machinery, patterns, and tradeoffs that make Python feel deceptively simple.
Read the cover storyThe index
5 notes, edited for signal.
Connect Python allocations to pymalloc arenas, pools, blocks, process RSS, tracemalloc domains, and responsible measurement.
Design reliable cleanup around context managers, finalizers, cycles, resurrection, shutdown, async cancellation, and process exit.
Build a precise model of CPython object lifetime, cycles, finalizers, weak references, and the diagnostics that can accidentally keep objects alive.
Build a precise model of binding, mutation, copying, argument passing, closure cells, identity, and API ownership.
Use weak references, weak containers, and finalizers without confusing reachability, equality, callbacks, or cache policy.
Editorial policy
No listicles. No folklore. No just trust me abstractions.
Every note should leave you with a better model of the system, not just another snippet to paste.