Created
June 7, 2013 15:41
-
-
Save anveo/5730214 to your computer and use it in GitHub Desktop.
memory leak object reference graph
This file contains hidden or 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
$ cat app/api/v2/debug.rb | |
module Api; module V2 | |
class Foobar; end | |
class Debug < Api::Base | |
get '/' do | |
@foobar = Foobar.new | |
bldr :'debug/index' | |
end | |
end | |
end; end | |
$ cat app/views/debug/index.bldr | |
attribute :foobar, 1 | |
# add racksh to Gemfile :devopment and :czar | |
$ rbenv shell 1.9.3-p392-ref | |
$ bundle install | |
$ RACK_ENV=czar bundle exec racksh | |
$rack.get '/v2/debug' | |
GC.start | |
foobar = ObjectSpace.each_object(Api::V2::Foobar).first | |
require 'object_graph' | |
ObjectGraph.new(foobar).view! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment