[Mongrel] Possible memory leak problem...

Massimo Santoli massimo at zero.it
Sun Aug 19 02:53:40 EDT 2007


I'm trying to figure out a possible memory leak problem I have in my  
application.

I've tested both with mongrel and webrick and the problem remains. So  
I think it's not a mongrel problem, but I'm posting here to see if  
anybody can help me.

The RAILS application is quite simple, no special plugins ( no  
RMagick that has the memory problem ), it's a query and the data is  
outputted via rxml template,
so there is the xml Builder in the template. Actually I'm doing quite  
a lot of Ruby in the template, and the output file can get VERY big  
( depends on the input data ).
The maximum is an output file of 35MB. When somebody does this very  
heavy search the Mongrel ( or webrick ) process reaches 400MB and the  
memory
is never ever freed again...
My application has 6 mongrels and if all the mongrel end up with very  
big queries I need to restart everything, having eaten up all the 2GB  
of RAM my box has.

I tested for memory leaks with Scott Laird module, but I didn't find  
anything.

Is it a problem of the RAILS/Ruby CG? or is there something I'm  
missing ?

My only hint is the xml Builder RAILS functions, I plan to try to use  
a normal RHTML to see if something changes, I know it's not a very  
neat solution ( and BTW it is 2 to 3 times faster
on very big XML files, from some benchmarks I've done )... but I'm  
desperate!


Thanks
Massimo



More information about the Mongrel-users mailing list