Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COUNT_ALLOCS was removed in Python3.9 #24

Open
ngoldbaum opened this issue Mar 3, 2023 · 0 comments
Open

COUNT_ALLOCS was removed in Python3.9 #24

ngoldbaum opened this issue Mar 3, 2023 · 0 comments

Comments

@ngoldbaum
Copy link

I spent a bit of time following the (normally excellent) advice in this tutorial to try a COUNT_ALLOCS build while debugging a reference leak and found that it did nothing. It turns out CPython removed the functionality in Python 3.9. See python/cpython#18259.

Unfortunately there isn't a replacement.

Should all the text referencing COUNT_ALLOCS just be removed? It would avoid wasting the time of future people who would like to debug reference issues.

I ended up fixing the issue I had by setting a breakpoint on the variable in the debug python build tracking the total number of allocations and then over the course of a python for loop that leaked memory every loop, simply printed out the objects getting increfd and decrefd and found the place where an object was getting an extra incref. Maybe I could describe this debugging process?

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

No branches or pull requests

1 participant