Skip to content

Instantly share code, notes, and snippets.

@msonnabaum
Created December 2, 2015 00:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msonnabaum/afb1cd5dffd138cc1e00 to your computer and use it in GitHub Desktop.
Save msonnabaum/afb1cd5dffd138cc1e00 to your computer and use it in GitHub Desktop.
require "objspace"
trap "USR2" do |signo|
Thread.new {
ObjectSpace.trace_object_allocations_start
GC.start
ObjectSpace.dump_all output: File.open("/tmp/heap-#{Time.now.to_i}.json", "w")
}.join
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment