[Mongrel] Mongrel using way more memory on production than staging

Kirk Haines wyhaines at gmail.com
Wed Oct 3 16:26:17 EDT 2007

On 10/3/07, Zed A. Shaw <zedshaw at zedshaw.com> wrote:

> Apart from that, I've got no idea.  Last time I dealt with this crap with the
> horrible Ruby GC implementation the entire Ruby world took out
> torches and chased me down the street screaming that I was ruining
> their party be exposing how crap the code is.

Hey now.  I was one of those torch carriers, but all I was worried
about was making sure we were pointing in the right direction in
identifying the real memory leak instead of just villifying poor,
innocent Mutex.  In the end, it was the influence of that dastardly
Array#shift that had turned Mutex into the problem causing bad boy.

What's really appalling is how long it took after that time before
Array#shift was actually fixed in a ruby release.  It should have been
fixed in 1.8.5.

I suspect that the leak in the gethostbyname code is a similar sort of
sloppiness that had been overlooked (and probably still exists in

Chris, you asked about suggestions on how track down memory leaks.
What Zed said.  In addition, you can manually write code to check
ObjectSpace object counts.  If you suspect that the problem is
actually at Ruby or C/C++ extension level, you can also use a tool
like valgrind to analyze running code and see if you can pinpoint
anything that is actualy a problem.

Kirk Haines

More information about the Mongrel-users mailing list