[Bug #21838] Don't force major GC when there are allocatable slots#15882
Merged
peterzhu2118 merged 1 commit intoruby:masterfrom Jan 16, 2026
Merged
Conversation
[Bug #21838]
When we have allocatable slots, we can grow the heap instead of forcing
a major GC. This prevents major GC to be ran very often in certain situations.
See the ticket for more details.
On ruby-bench, we can see that this patch doesn't cause any significant
regressions:
-------------- ----------- ---------- --------- ----------- ---------- --------- -------------- -------------
bench master (ms) stddev (%) RSS (MiB) branch (ms) stddev (%) RSS (MiB) branch 1st itr master/branch
activerecord 148.2 0.3 59.2 150.0 0.8 69.7 1.015 0.988
chunky-png 435.2 0.3 72.9 438.8 0.1 66.7 0.993 0.992
erubi-rails 733.8 1.2 118.7 704.8 0.2 98.3 1.077 1.041
hexapdf 1400.4 1.1 247.0 1405.0 0.9 223.7 0.986 0.997
liquid-c 32.5 3.3 32.8 32.5 2.1 30.7 1.042 0.999
liquid-compile 31.0 1.7 35.1 33.4 3.9 32.8 0.938 0.928
liquid-render 84.7 0.4 30.8 86.3 0.4 30.8 0.981 0.982
lobsters 594.7 0.6 310.5 596.6 0.4 306.0 1.057 0.997
mail 75.6 2.8 53.3 76.9 0.7 53.2 0.968 0.982
psych-load 1122.8 1.2 29.2 1145.1 0.4 31.7 0.964 0.981
railsbench 1244.7 0.3 115.5 1254.8 1.1 115.2 0.939 0.992
rubocop 103.7 0.5 94.1 104.3 0.5 92.4 0.985 0.994
ruby-lsp 88.3 0.6 78.5 88.5 1.2 77.9 0.992 0.997
sequel 26.9 0.9 33.6 28.3 1.4 32.1 0.954 0.952
shipit 1119.3 1.5 171.4 1075.7 2.1 162.5 1.873 1.040
-------------- ----------- ---------- --------- ----------- ---------- --------- -------------- -------------
byroot
approved these changes
Jan 16, 2026
Member
byroot
left a comment
There was a problem hiding this comment.
Maybe just add [Bug #21838] to link on Redmine.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When we have allocatable slots, we can grow the heap instead of forcing a major GC. This prevents major GC to be ran very often in certain situations. See the ticket for more details.
On ruby-bench, we can see that this patch doesn't cause any significant regressions: