Skip to content

Instantly share code, notes, and snippets.

@tiegz
Created June 26, 2012 17:33
Show Gist options
  • Save tiegz/2997289 to your computer and use it in GitHub Desktop.
Save tiegz/2997289 to your computer and use it in GitHub Desktop.
set_trace_func experiment
x = Hash.new(0)
orig = ObjectSpace.count_objects
set_trace_func proc { |event, file, line, id, binding, classname|
ObjectSpace.each_pair { |k,v|
x["#{file}:#{line}:#{k}"] += [0,(v - orig[k])].max
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment