End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
GC.malloc_allocated_size
GC.malloc_allocated_size → Integer
gc.c
View on GitHub ↗
static VALUE
gc_malloc_allocated_size(VALUE self)
{
return UINT2NUM(rb_objspace.malloc_params.allocated_size);
}
Returns the size of memory allocated by malloc().
Only available if ruby was built with CALC_EXACT_MALLOC_SIZE.
See also
.latest_gc_info
.malloc_allocations
.latest_compact_info
.remove_stress_to_class
also in
4.1 · 3.3 · 3.2 · 3.1