PyCon JP 2026

Sat, Aug 22 · 10:30 – 11:00 @ Phoenix Hall

TalkIntermediateENPython Core and Ecosystem

CPython’s Memory Engine: Allocation, Deallocation, and Free-List Tricks

Petr Andreev

Abstract

How does CPython really handle memory?
This talk follows an object’s full journey: allocation, refcounting, deallocation, freelists, and allocator swaps. You’ll see why memory seems to stick, how pymalloc and mimalloc differ, and what actually happens in hot loops. Leave with a sharp mental model for debugging performance, fragmentation, and apparent leaks.

About the speaker

Petr Andreev

Petr Andreev

Specializes in CPython internals, optimization, and high-performance computing.
Driven by GPU acceleration, CPU vectorization. Evolved from ML systems to CPython core research engineer.
8+ years leading teams in AI, maths, and physics. PyCon speaker.
Lecturer at Moscow Institute of Physics and Technology – top 1 Russian university.