You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implements incremental cyclic GC.
Instead of traversing one generation on each collection, we traverse the young generation and the oldest part of the old generation. By traversing the old generation a chunk at a time, we keep pause times down a lot.
The build failures appear to be caused by #114751, so I think this is ready for review.
I believe the reason that the earlier version of this PR needed reverting was that it relied on the young gen being empty after a young collection. However if a finalizer creates new objects, then that assumption is false.
This version merges the young gen and increment before collection, so we don't care if the young gen isn't empty afterwards.
@DinoV
It looks like the progress calculation got reverted to the prior, incorrect, version when I merged in the move of the GC code from gcmodule.c to gc.c.
I've fixed that and added a test based on your example.
Should be good to go now.
In pythonGH-116206, the comment about moving reachable objects to next generation got moved from its original place to a place where there is no code below it. This PR puts it back where the actual movement of rechable objects happen to the next generation.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements incremental cyclic GC.
Instead of traversing one generation on each collection, we traverse the young generation and the oldest part of the old generation. By traversing the old generation a chunk at a time, we keep pause times down a lot.
See faster-cpython/ideas#613 for the idea and algorithm.
📚 Documentation preview 📚: https://cpython-previews--116206.org.readthedocs.build/