#!/usr/bin/env ruby # This code comes from http://ruby-it.org/pages/Usare+Object+Space # Check the page for copyright notice and explanations >> ObjectSpace.each_object(Bignum) {|x| puts x } => 0 >> class Mia >> def initialize(a) >> @a=a >> end >> end => nil >> a=Mia.new 10 => # >> b=Mia.new 20 => # >> ObjectSpace.each_object(Mia) {|x| puts x } # # => 2