Skip to content

Instantly share code, notes, and snippets.

View simonrussell's full-sized avatar

Simon Russell simonrussell

View GitHub Profile
def object_report(type = nil)
if type
puts "number of (#{type}) objects in memory = #{ObjectSpace.each_object(type).count}"
else
puts "number of objects in memory = #{ObjectSpace.each_object.count}"
end
end
def full_report
ObjectSpace.each_object.to_a.inject(Hash.new(0)) do |h,o|