End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
GC.measure_total_time=
GC.measure_total_time = true/false
gc.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/gc.rb, line 276
def self.measure_total_time=(flag)
Primitive.cstmt! %{
rb_objspace.flags.measure_gc = RTEST(flag) ? TRUE : FALSE;
return flag;
}
end
Enable to measure GC time. You can get the result with GC.stat(:time). Note that GC time measurement can cause some performance overhead.
See also
.measure_total_time
.remove_stress_to_class
.malloc_allocations
.start
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2