[Ruby] Memory profiling rails

Eric Hodel drbrain at segment7.net
Tue Aug 12 11:07:59 PDT 2008


On Aug 8, 2008, at 10:11 AM, Scott Windsor wrote:
> I'm trying to track down a memory leak in my rails app - on certain  
> page
> requests the memory usage is jumping 20-30M and never regaining  
> (even after
> explict GC calls are made).
>
> I've been looking at various options for helping track down this leak.
> Right now I'm fairly certain it's not from a leaky c-extension (but  
> I could
> be wrong), so I'm up for investigating leaks in ruby first.
>
> I'd like to use ruby-prof, which requires a patched version of  
> ruby.  I've
> patched ruby and installed in a alternate location, but it doesn't  
> seem to
> pick up any gems - do I have to keep a seperate set of gems for this
> install?

First, install RubyGems with your patched ruby.  Then:

export GEM_HOME=`/path/to/unpatched/gem env home`
export GEM_PATH=`/path/to/unpatched/gem env path`



More information about the Ruby mailing list