Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

class method

GC.latest_gc_info

(?::Hash[::Symbol, untyped]? hash) -> ::Hash[::Symbol, untyped]
(::Symbol key) -> untyped
GC.latest_gc_info → hash
GC.latest_gc_info(hash) → hash
GC.latest_gc_info(key) → value

Returns information about the most recent garbage collection.

If the argument hash is given and is a Hash object, it is overwritten and returned. This is intended to avoid the probe effect.

If the argument key is given and is a Symbol object, it returns the value associated with the key. This is equivalent to GC.latest_gc_info[key].

Ruby version changes

  1. 3.2