diff --git a/Gemfile b/Gemfile index 698477e358c..018b5b37005 100644 --- a/Gemfile +++ b/Gemfile @@ -196,6 +196,7 @@ gem 'lru_redux' gem 'flamegraph', require: false gem 'rack-mini-profiler', require: false +gem 'memory_profiler', require: false, platform: :mri_21 # used for caching, optional gem 'rack-cors', require: false diff --git a/Gemfile_rails4.lock b/Gemfile_rails4.lock index 5989d7838e3..cd1fafcb493 100644 --- a/Gemfile_rails4.lock +++ b/Gemfile_rails4.lock @@ -163,6 +163,7 @@ GEM mail (2.5.4) mime-types (~> 1.16) treetop (~> 1.4.8) + memory_profiler (0.0.4) message_bus (0.9.4) eventmachine rack (>= 1.1.3) @@ -425,6 +426,7 @@ DEPENDENCIES librarian (>= 0.0.25) listen (= 0.7.3) lru_redux + memory_profiler message_bus minitest mocha diff --git a/config/initializers/06-mini_profiler.rb b/config/initializers/06-mini_profiler.rb index 8c5f385f7c5..34d6193ce39 100644 --- a/config/initializers/06-mini_profiler.rb +++ b/config/initializers/06-mini_profiler.rb @@ -2,6 +2,7 @@ if Rails.configuration.respond_to?(:enable_mini_profiler) && Rails.configuration.enable_mini_profiler require 'rack-mini-profiler' require 'flamegraph' + require 'memory_profiler' if RUBY_VERSION >= "2.1.0" # initialization is skipped so trigger it Rack::MiniProfilerRails.initialize!(Rails.application) end