From the output of puts ObjectSpace.methods.sort
after requiring objspace
, it looks like that method doesn't exist.
irb(main):005:0> puts ObjectSpace.methods.sort
...
reachable_objects_from
remove_class_variable
remove_instance_variable
respond_to?
send
singleton_class
singleton_methods
taint
tainted?
tap
to_enum
to_s
trust
undefine_finalizer
untaint
untrust
untrusted?
=> nil
irb(main):009:0> ObjectSpace.methods.include? :trace_object_allocations
=> false
You can see that it contains the ::reachable_objects_from
method, which is mentioned in the docs, but not the one you're looking for, unfortunately.