End of Life Ruby 3.0 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.0.5/gc.rb, line 110
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
See also
.stress
.verify_compaction_references
.stat
.verify_internal_consistency
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1