-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
GH-126491: Lower heap size limit with faster marking #127519
base: main
Are you sure you want to change the base?
Conversation
!buildbot iOS |
🤖 New build scheduled with the buildbot fleet by @markshannon for commit 8893cf5 🤖 The command will test the builders whose names match following regular expression: The builders matched are:
|
!buildbot Android |
🤖 New build scheduled with the buildbot fleet by @markshannon for commit 8893cf5 🤖 The command will test the builders whose names match following regular expression: The builders matched are:
|
!buildbot Android|iOS |
🤖 New build scheduled with the buildbot fleet by @markshannon for commit 8262bf0 🤖 The command will test the builders whose names match following regular expression: The builders matched are:
|
Performance is a wash overall, but I think that is an artifact of our benchmarks. I would expect this to perform better on larger heaps and consume less memory, although the benchmarks show no overall change in memory consumption. Note that the "create gc cycles" benchmark shows a 10% speedup and "gc traversal" an 8% speedup, but there is an equivalent slowdown on the "xml etree" benchmarks. |
InternalDocs/garbage_collector.md
Outdated
For each full scavenge we must visit all objects, `T == L + G0 + G1`, during which | ||
`G1` garbage objects are created. | ||
|
||
The number of new objects created `N` must be at least the new garbage created, `N ≥ G`. |
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.
Why? Couldn't the new garbage be old objects that were initially alive?
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.
There will be, but we are assuming a steady state, where L
doesn't change. I'll make that clearer.
InternalDocs/garbage_collector.md
Outdated
Everything in `M` is live, so `I ≥ G0` and in practice `I` is closer to `G0 + G1`. | ||
|
||
If we choose the amount of work done such that `2*M + I == 6N` then we can do | ||
do less work in most cases, but are still guaranteed to keep up. |
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.
do less work in most cases, but are still guaranteed to keep up. | |
less work in most cases, but are still guaranteed to keep up. |
InternalDocs/garbage_collector.md
Outdated
For each full scavenge we must visit all objects, `T == L + G0 + G1`, during which | ||
`G1` garbage objects are created. | ||
|
||
The number of new objects created `N` must be at least the new garbage created, `N ≥ G`. |
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.
You never defined G
. I assume it's G1-G0
.
With marking added to the cyclic GC (#127110) we spend a lot of the time in the GC forming transitive closures, both for marking and for the increments of the incremental GC.
Unfortunately the current algorithm has a couple of mistakes in it. One harmful, one beneficial.
These more or less cancel out.
This PR deliberately counts marking as twice as effective as normal collection, but limits the amount of work done.
To do so, we need to increase the typical amount of work done a bit.
This has the advantage of limiting the amount of garbage to (roughly) 1/3 of the heap.
This PR does two things: