sum = 0
typec = {}
ObjectSpace.each_object(Object) do |obj|
  typec[obj.type] = 0 if typec[obj.type].nil?
  typec[obj.type]+= 1
  sum+= 1
end
print "--\n"
typec.each do |type, count|
  print "#{type.name}: #{count}\n"
end
print "--\n"
print "sum: #{sum}\n"

