Skip to content

Instantly share code, notes, and snippets.

@barkerja
Created December 12, 2014 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barkerja/faf0a172d8d53493297e to your computer and use it in GitHub Desktop.
Save barkerja/faf0a172d8d53493297e to your computer and use it in GitHub Desktop.
sort object allocation by count
objects = Hash.new(0)
ObjectSpace.each_object { |obj| objects[obj.class] += 1 }
p objects.sort_by { |_,v| -v }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment