From 7a0069f1d6b16e8f1191d85ee5b89f5094897293 Mon Sep 17 00:00:00 2001 From: Dan Barber Date: Wed, 14 Oct 2015 16:33:36 +0100 Subject: [PATCH] Add heap_dump script --- Gemfile | 2 ++ script/heap_dump.rb | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 script/heap_dump.rb diff --git a/Gemfile b/Gemfile index f8fb7aa..7e62a9e 100644 --- a/Gemfile +++ b/Gemfile @@ -43,6 +43,8 @@ group :development do gem 'binding_of_caller' gem 'letter_opener' gem 'tunnel' + gem 'rbtrace', git: 'https://github.com/tmm1/rbtrace', branch: 'master' + gem 'foreman' end group :test, :development do diff --git a/script/heap_dump.rb b/script/heap_dump.rb new file mode 100644 index 0000000..8d8a16b --- /dev/null +++ b/script/heap_dump.rb @@ -0,0 +1,6 @@ +Thread.new do + require "objspace" + ObjectSpace.trace_object_allocations_start + GC.start() + ObjectSpace.dump_all(output: File.open("heap.json", "w")) +end.join