End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
GC.auto_compact
GC.auto_compact → true or false
gc.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/gc.rb, line 46
def self.auto_compact
Primitive.gc_get_auto_compact
end
Returns whether or not automatic compaction has been enabled.
Ruby version changes
-
3.0
-
GC.auto_compact=andGC.auto_compacthave been added to control when compaction runs. Settingauto_compact=to true will cause compaction to occur during major collections. At the moment, compaction adds significant overhead to major collections, so please test first! [Feature #17176]
-