Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page is a quick guide on tracking down and patching memory leaks and other memory usage issues in Ruby & Rails.

Example: Profiling Harvesters

 

Code Block
languageruby
titleMemory Profiling Harvesters
require 'memory_profiler'

recs =  NaraHarvester.new.records
report = MemoryProfiler.report { 100.times { recs.next } }
 
report.total_retained
 

Gems (ones we've used/mentioned in examples)

...