Created
November 12, 2014 18:45
-
-
Save csavage-mdsol/8e1bd423deac5be8f75f to your computer and use it in GitHub Desktop.
rbtrace JSON Heap Dump
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Provide the PID of a running rails process, and dump the heap to heap.json | |
# WARNING these can get pretty huge (~100MB) | |
# requries ruby 2.1 for shiny new ObjectSpace features | |
rbtrace -p <PID> -e 'Thread.new{require "objspace"; ObjectSpace.trace_object_allocations_start; GC.start(); ObjectSpace.dump_all(output: File.open("heap.json", "w"))}.join' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment