Skip to content

Conversation

@KowalskiThomas
Copy link
Contributor

@KowalskiThomas KowalskiThomas commented Jan 2, 2026

What is this?

This is our first Memory Profiling correctness check for Python! 🚀

The goal is both to validate that what we report is correct and that the Memory Profiling feature continues to work over time – which we've been somewhat blind to lately.

Questions

The numbers don't make sense to me. Here is a profile I captured, I think the memory should be roughly ~75% and ~25% (since I allocate bytearray(1024) on one side and bytearray(3 * 1024) on the other) but for some reason we're getting 60% and 40% which sounds more like bytearray(2 * 1024) for the second allocation.
One possible explanation is that the bytearray overhead might be significant enough to bias the numbers but that would be sort of huge. According to my research, the PyObject overhead should be roughly 60 bytes, so far from enough to explain skewing the results so much...

image

@KowalskiThomas KowalskiThomas force-pushed the kowalski/python_basic_memory-initial-commit branch from dfb69d4 to d75746c Compare January 2, 2026 17:34
@KowalskiThomas KowalskiThomas force-pushed the kowalski/python_basic_memory-initial-commit branch from d75746c to ebcf888 Compare January 2, 2026 17:51
@KowalskiThomas KowalskiThomas changed the title [python_basic_memory] Initial commit [python_basic_memory] Add first memory correctness check Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants