Skip to content

Instantly share code, notes, and snippets.

@os6sense
Created May 12, 2017 13:26
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 os6sense/35b9e37eb8f23bdb4a81cde1cc23aa03 to your computer and use it in GitHub Desktop.
Save os6sense/35b9e37eb8f23bdb4a81cde1cc23aa03 to your computer and use it in GitHub Desktop.
Using memory_profiler with rails
add to gemfile :
gem 'memory_profiler', require: true, github: 'SamSaffron/memory_profiler'
Add a config/initializer/memory_profiler.rb as follows:
MemoryProfiler.start
at_exit do
report = MemoryProfiler.stop
report.pretty_print
end
This uses a LOT of memory - its the first time I've wanted 128/256GB. Its also VERY slow to generate the report on termination - be patient!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment