Skip to content

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

class method

ObjectSpace.count_imemo_objects

ObjectSpace.count_imemo_objects([result_hash]) → hash

Counts objects for each T_IMEMO type.

This method is only for MRI developers interested in performance and memory usage of Ruby programs.

It returns a hash as:

Example
{:imemo_ifunc=>8,
 :imemo_svar=>7,
 :imemo_cref=>509,
 :imemo_memo=>1,
 :imemo_throw_data=>1}

If the optional argument, result_hash, is given, it is overwritten and returned. This is intended to avoid probe effect.

The contents of the returned hash is implementation specific and may change in the future.

In this version, keys are symbol objects.

This method is only expected to work with C Ruby.