Skip to content

Instantly share code, notes, and snippets.

@astroza
Created January 22, 2016 15:47
lib/inspector.rb
class Inspector
def inspect_objects_space
count = Hash.new(0)
ObjectSpace.each_object(Object) {|o| count[o.class] += 1 }
server = TCPSocket.new 'localhost', 51313
max = count.reduce do |a, v| a[1] > v[1] ? a : v end
server.puts max.to_s
server.close
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment