sys.getsizeof()
does not include inline values
#128762
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
type-bug
An unexpected behavior, bug, or error
Bug report
Bug description:
Commit tested: 5e65a1a
I have a program that allocates numerous instances of this type:
After the 28th iteration, I find that it stabilizes at printing 48. But if I run the program in GDB and trace the actual allocations, I see that it is allocating 80 bytes per iteration:
I believe that the missing bytes can be accounted for in the inline values. I observe the same behavior on Python 3.13.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
sys.getsizeof()
#128763The text was updated successfully, but these errors were encountered: