Want to stay on top? Ruby Weekly is a once-weekly e-mail newsletter covering the latest Ruby and Rails news.
     Feed Icon

Profiling memory leaks in Rails

By Peter Cooper / August 22, 2006

Scott Laird looks at how to profile memory leaks in Rails:

One of my long-running problems with Rails (and Ruby in general) is that it’s difficult to debug memory leaks. I’ve had a number of cases where I’ve stuck something into a long-lived array or hash and discovered much later that my Ruby process was eating over 100 MB of RAM. While ps makes it easy to see when Ruby’s using lots of RAM, actually figuring out where it went is a lot harder.

Comments

  1. Chris Roos says:

    I've already posted this to Scott's blog.

    I used the memory profiler this morning and think I found a memory leak when rails is used in development, in conjunction with irb_history[1].

    [1] http://blog.seagul.co.uk/articles/2006/08/22/rails-leaking-some-strings-in-development

Other Posts to Enjoy

Twitter Mentions