Skip to content

Instantly share code, notes, and snippets.

@adamsanderson
Created January 19, 2011 18:02
Show Gist options
  • Save adamsanderson/786562 to your computer and use it in GitHub Desktop.
Save adamsanderson/786562 to your computer and use it in GitHub Desktop.
Instrumentation for rails test cases in ruby 1.9
setup{
GC.start
@__mem_stats = ObjectSpace.count_objects.dup
}
teardown{
GC.start
ObjectSpace.count_objects.each{|k,v| puts("%12s: %d" % [k, v - @__mem_stats[k] || 0]) }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment