End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
GC.stress=
GC.stress = flag → flag
gc.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.2.0/gc.rb, line 89
def self.stress=(flag)
Primitive.gc_stress_set_m flag
end
Updates the GC stress mode.
When stress mode is enabled, the GC is invoked at every GC opportunity: all memory and object allocations.
Enabling stress mode will degrade performance, it is only for debugging.
flag can be true, false, or an integer bit-ORed following flags.
Example
0x01:: no major GC 0x02:: no immediate sweep 0x04:: full mark after malloc/calloc/realloc