# Accurately measure python core fragmentation

**URL:** <https://discuss.python.org/t/accurately-measure-python-core-fragmentation/106668>\
**Category:** Python Help\
**Tags:** help\
**Created:** [March 24, 2026, 8:36am UTC](https://discuss.python.org/t/accurately-measure-python-core-fragmentation/106668 "2026-03-24T08:36:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZwPwn](https://avatars.discourse-cdn.com/v4/letter/z/4491bb/32.png) [@ZwPwn](https://discuss.python.org/u/ZwPwn)\
**Post date:** [March 24, 2026, 8:36am UTC](https://discuss.python.org/t/accurately-measure-python-core-fragmentation/106668/1 "2026-03-24T08:36:30Z")

</div>

Greetings folks, I am new to this. I was wondering how to accurately “debug” pymalloc, but also get a pretty accurate measurment of python’s fragmentation using python’s internal. I peeked the source code, I asked AI, but I am not sure how it works.

To the people who where in part of the python core development

1. How do I measure fragmentation in python core accurately ? (My approach would be to use some kind of diffing like vmrss vs internals or tools like memray)
2. How do I learn how to debug such complex thing as a production-grade allocator
3. Does it matter in the AI era ?

Thank you in advance
