# Leaking weirdness

**URL:** <https://www.ruby-forum.com/t/leaking-weirdness/134920>\
**Category:** Ruby\
**Created:** [April 16, 2008, 7:11am UTC](https://www.ruby-forum.com/t/leaking-weirdness/134920 "2008-04-16T07:11:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [April 16, 2008, 7:11am UTC](https://www.ruby-forum.com/t/leaking-weirdness/134920/1 "2008-04-16T07:11:15Z")

</div>

Perhaps someone out there can help give me a clue about the following  
situation:

My mongrel processes seem to be leaking.  
As an example of this, if I add this code to the bottom of  
environment.rb  
Thread.new {loop do; print ‘w’; end}  
it doesn’t affect memory at first, however after the web server gets its  
first hit its memory consumption would sky-rocket. [i.e. it would monotonically grow by about 50MB/s]

Then I ran the same using webrick, instead of mongrel [1.1.3].  
No leak.

Then I’m thinking ‘hmm maybe it’s mongrel and the mongrel guys have  
fixed this.’

Update my gem to 1.1.4 from 1.1.3.  
Using mongrel this time.  
No leak! Yea!

Now this is the weird part.  
Attempted to recreate the bug.  
Uninstalled mongrel 1.1.4, reinstalled 1.1.3  
uninstalled daemons [its dependency] 1.0.10, reinstalled 1.0.9 [what I  
had before].

Ran it with Mongrel again [which is where it used to leak].  
No leak.  
I am so confused!  
Perhaps rubygems was updated and so it “compiled it right this time”?  
Note that there don’t appear to be significant code changes in mongrel  
from 1.1.3 to 1.1.4, though there could be, I’m not sure.

Maybe if somebody else who ‘suspects’ a memory leak could try my code  
and see if it leaks theirs, that would be well appreciated.

The good news is that “maybe” updating rubygems and recompiling mongrel  
helps with memory leaks in rails apps.

Thoughts?  
-R  
OS X PPC patchlevel 111
