Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
GC.stress=
(::Integer flag) -> ::Integer
(bool flag) -> bool
GC.stress = flag → flag
gc.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/gc.rb, line 92
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.
The flag can be true, false, or an integer bitwise-ORed with the following flags:
Example
0x01:: no major GC 0x02:: no immediate sweep 0x04:: full mark after malloc/calloc/realloc