Skip to content

Instantly share code, notes, and snippets.

@toolmantim
Created March 31, 2015 01:33
Show Gist options
  • Save toolmantim/cc66133bc3682c89727a to your computer and use it in GitHub Desktop.
Save toolmantim/cc66133bc3682c89727a to your computer and use it in GitHub Desktop.
Using allocation tracer
# via https://github.com/halostatue/mime-types/pull/93#issuecomment-87814894
require 'allocation_tracer'
require 'pretty_print'
$LOAD_PATH << "/Users/schneems/Documents/projects/mime-types/lib"
ObjectSpace::AllocationTracer.setup(%i{path line type})
r = ObjectSpace::AllocationTracer.trace do
require 'mime/types'
end
pp r.sort {|x, y| x.last.first <=> y.last.first }.reverse.first(100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment