-
Notifications
You must be signed in to change notification settings - Fork 15
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
Don't leak objects in _pickle_27.c load_[short_]binbytes. #37
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi looking at your comment I think it's PyTuple_SET_ITEM who keeps the ref even if it fails !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C style review
@jamadden As a regression test, what about a simple memory consumption comparison using psutil, like the one in the ZODB bug report? |
I have three concerns about a simple memory consumption comparison using psutil:
gevent uses reference counting and objgraph to check for leaks, and that code is finicky. But here, objgraph didn't reliably find the dropped tuple, not with Because there are no existing reference counting tests in this codebase, and because of the complexity outlined above, and because Python 2.7 is a "legacy" platform at this point, I'm inclined to ask for a pass on an added regression test. @icemac ? |
That is, unfortunately, very true. |
That makes sense. |
@jamadden I'm fine with fixing this test without adding a proper test. The verification shown in this PR is enough as the change log links to it. |
@jamadden you're now a PyPI owner of zodbpickle. |
@mgedmin Thanks! The new pypi.org (warehouse) sends out notification emails when that happens, so that was nice. |
Fixes #36.
Manually verified according to zopefoundation/ZODB#203. Here's the current memory usage of the test case described there:
I'm not sure if/how to do some sort of automated regression test for this...