# Memory leak stomping

**URL:** <https://www.ruby-forum.com/t/memory-leak-stomping/123928>\
**Category:** Rails\
**Created:** [December 22, 2007, 4:32am UTC](https://www.ruby-forum.com/t/memory-leak-stomping/123928 "2007-12-22T04:32:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luisS\_syndeomedia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/85e7bf/32.png) [@luisS\_syndeomedia](https://www.ruby-forum.com/u/luisS_syndeomedia)\
**Post date:** [December 22, 2007, 4:32am UTC](https://www.ruby-forum.com/t/memory-leak-stomping/123928/1 "2007-12-22T04:32:18Z")

</div>

I’m looking for tips on how to stomp memory leaks, as I haven’t a clue  
how to do it properly. I have a very young Rails 2.0.2 application  
that jumps from 180mb total usage to 510mb total usage in about  
60-90mins. I tried using Dike and could not make heads or tails of the  
data. All I know is that the heaviest page on my site,  
dashboard#index, was producing 700,000+ String objects according to  
Dike, but I have no idea how to reduce that number, or where to even  
start looking. (As a primitive experiment, I commented out all the db  
queries in dashboard\_controller and only reduced the number of string  
objects by about 30,000.)

Some other info about my app: we use Rmagick fairly extensively, but  
there’s almost no traffic on the site right now as we still in a  
closed alpha testing stage. There are also fairly db-intensive  
routines in dashboard which compiles user and friend activities over  
the past couple of days. I haven’t introduced any form of caching yet,  
although I’m looking at Interlock/memcached.

Any tips or links to good tutorials would be really helpful. I’ve seen  
all of the various solutions for finding leaks (Bleakhouse,  
MemoryProfiler, the aforementioned Dike), but unfortunately, I don’t  
know what to do after I’ve established that there is in fact a leak.

Thanks

:luis

---

<div class="post-metadata">

**Author:** ![luisS\_syndeomedia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/85e7bf/32.png) [@luisS\_syndeomedia](https://www.ruby-forum.com/u/luisS_syndeomedia)\
**Post date:** [December 22, 2007, 4:50pm UTC](https://www.ruby-forum.com/t/memory-leak-stomping/123928/2 "2007-12-22T16:50:28Z")

</div>

On Dec 21, 7:31 pm, “luis, syndeomedia” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> know what to do after I’ve established that there is in fact aleak.
> 
> Thanks
> 
> :luis

did you work through these?

[http://blog.methodmissing.com/2007/5/10/rails-memory-usage-case-study/](http://blog.methodmissing.com/2007/5/10/rails-memory-usage-case-study/)  
[http://codehappy.wordpress.com/2007/01/17/tracking-a-memory-leak-in-rails/](http://codehappy.wordpress.com/2007/01/17/tracking-a-memory-leak-in-rails/)

---

<div class="post-metadata">

**Author:** ![luisS\_syndeomedia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/85e7bf/32.png) [@luisS\_syndeomedia](https://www.ruby-forum.com/u/luisS_syndeomedia)\
**Post date:** [December 22, 2007, 11:58pm UTC](https://www.ruby-forum.com/t/memory-leak-stomping/123928/3 "2007-12-22T23:58:35Z")

</div>

It looks like your problem is rmagick as its been noted to have these  
issues  
[http://blog.craigambrose.com/past/2007/11/27/image\_management\_that\_will\_scale/](http://blog.craigambrose.com/past/2007/11/27/image_management_that_will_scale/)  
read about RMagick

and talking about exactly is what is going on why RMagick doesn’t  
release the memory in a constant running ruby app.  
[http://rubyforge.org/forum/forum.php?thread\_id=1374&forum\_id=1618](http://rubyforge.org/forum/forum.php?thread_id=1374&forum_id=1618)
