1What follows from this
- An object is destroyed synchronously when its count drops to zero —
with really does close - This is a CPython detail 🔧, not a language guarantee: on PyPy the behaviour is different
- The count is not atomic → a global lock is needed → hence the GIL
- A local count does not see cycles → a second mechanism is needed, the generational collector
- Freeing an object and returning memory to the OS are different events: arenas and fragmentation
2Chapters of this root