Skip to content

gh-137562: Remove obsolete comment about calculating incremental threshold #137564

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sergey-miryanov
Copy link
Contributor

@sergey-miryanov sergey-miryanov commented Aug 8, 2025

gc.c/SCAN_RATE_DIVISOR has obsolete comment about calculating incremental threshold based on count of survivors. It is obsolete since #117120

cpython/Python/gc.c

Lines 1345 to 1362 in 34d7351

/* Making progress in the incremental collector
* In order to eventually collect all cycles
* the incremental collector must progress through the old
* space faster than objects are added to the old space.
*
* Each young or incremental collection adds a number of
* objects, S (for survivors) to the old space, and
* incremental collectors scan I objects from the old space.
* I > S must be true. We also want I > S * N to be where
* N > 1. Higher values of N mean that the old space is
* scanned more rapidly.
* The default incremental threshold of 10 translates to
* N == 1.4 (1 + 4/threshold)
*/
/* Divide by 10, so that the default incremental threshold of 10
* scans objects at 1% of the heap size */
#define SCAN_RATE_DIVISOR 10

@sergey-miryanov
Copy link
Contributor Author

I believe this should skip news.

@sergey-miryanov
Copy link
Contributor Author

@markshannon @nascheme Please take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants