This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients methane, pablogsal, serhiy.storchaka, vstinner
Date 2019-07-08.14:24:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1562595844.55.0.929894745485.issue36389@roundup.psfhosted.org>
In-reply-to
Content
I opened this issue, because I was convinced that it would be easy to implement checks faster than gc.setthreshold(), but I failed to write efficient tests which detect the bugs that I listed above.

My approach was basically to check all objects tracked by the GC every N memory allocations (PyGC_Malloc): too slow. I tried to put thresholds per generation: it was still too slow.

Maybe recent objects should be checked often, but old objects should be checked less often. For example, only check objects in generation 0 and scan new objects, and then remember the size of generation 0. At the next check, ignore objects already checked.

I failed to find time and interest to implement this approach. I abandon this issue and my PR.

In the meanwhile, gc.set_threshold(5) can be used. It isn't too slow and is quite good to find most bugs listed in this issue.
History
Date User Action Args
2019-07-08 14:24:04vstinnersetrecipients: + vstinner, methane, serhiy.storchaka, pablogsal
2019-07-08 14:24:04vstinnersetmessageid: <1562595844.55.0.929894745485.issue36389@roundup.psfhosted.org>
2019-07-08 14:24:04vstinnerlinkissue36389 messages
2019-07-08 14:24:04vstinnercreate