Skip to content

the usage of threshold1 for the GC is not correctly explained #144960

@arnaudlegout

Description

@arnaudlegout

Documentation

In https://docs.python.org/3/library/gc.html#gc.set_threshold it is explained that "The fraction of the old generation that is collected is inversely proportional to threshold1." As the default value of threshold1 is 10, we expect the fraction to be 1/10=0.1, which is 10% and not 1%.
No additional information is provided in https://github.com/python/cpython/blob/3.14/InternalDocs/garbage_collector.md

May be there is a constant factor used to compute the inversely proportional function, in that case it would be useful to disclose it in the documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirpendingThe issue will be closed if no feedback is provided

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions