[Mongrel] leaking weirdness

Evan Weaver evan at cloudbur.st
Mon Apr 28 16:23:22 EDT 2008

Maybe the upgrade installed fastthread?

Most likely though it's related to the Rails app itself, not Mongrel,
and isn't immediately reproducible. Cache freshness could have a large
effect on which codepaths get traversed.

What did you add that Thread loop for? I don't understand.


On Mon, Apr 28, 2008 at 4:14 PM, Roger Pack <lists at ruby-forum.com> wrote:
> Previously posted on ruby talk.  Response...silence :)
>  ......
>  Perhaps someone out there can help give me a clue about the following
>  situation:
>  My mongrel processes seemed to be leaking.
>  As an example of this, if I added this code to the bottom of
>  environment.rb
>  Thread.new {loop do; print 'w'; end}
>  it didn't affect memory.  At first.  However after the web server got
>  its
>  first hit its memory consumption would sky-rocket.  [i.e. it would
>  monotonically grow by about 50MB/s]
>  Then I ran the same scenario 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.  It's probably
>  not even a mongrel problem.
>  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
>  --
>  Posted via http://www.ruby-forum.com/.
>  _______________________________________________
>  Mongrel-users mailing list
>  Mongrel-users at rubyforge.org
>  http://rubyforge.org/mailman/listinfo/mongrel-users

Evan Weaver

More information about the Mongrel-users mailing list