Created
May 12, 2017 13:26
-
-
Save os6sense/35b9e37eb8f23bdb4a81cde1cc23aa03 to your computer and use it in GitHub Desktop.
Using memory_profiler with rails
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
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