Use CRuby compatible key in ObjectSpace.count_objects .