I''m having a huge memory leak problem with a rails application I''m developing. I first noticed that when running under webrick (via script/server) there was a fast memory leak.. several users using the app for a few hours would use 1 gig of memory!!! I searched the archives and found that some users found that it could be avoided by saying --daemon when launching webrick.. tried: no luck. I then deployed via fastcgi.. No luck... So it''s not webrick.. and likely not fastcgi either.. that leaves rails itself.. But how can their be a memory leak in a garbage collected language?? It''s running on SUSE 9.1 on ruby 1.8.2 that was compiled from sources (suse package is only 1.8.1). I really need to work this through.. the only option I have left is hoping that a raw CGI will be fine because it will reload everything with every request.. hopefully that would avoid the leak but I realize how bad the performance would be in that environment. Thanks in advance!
On 2005.05.14., at 19:58, Luke Galea wrote:> I first noticed that when running under webrick (via script/server) > there was > a fast memory leak.. several users using the app for a few hours > would use 1 > gig of memory!!! >I''m experiencing the same with latest Rails (production mode) + MySQL + WebRick on Mac OS X 10.4.1. Rails have eaten all my 1 GB memory! Any solution appreciated! Gábor _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
You may want to check this : http://thread.gmane.org/gmane.comp.lang.ruby.rails/11494 and this http://thread.gmane.org/gmane.comp.lang.ruby.rails/9890 jean On 6/13/05, Gábor SEBESTYÉN <segabor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On 2005.05.14., at 19:58, Luke Galea wrote: > > > I first noticed that when running under webrick (via script/server) there > was > > a fast memory leak.. several users using the app for a few hours would use 1 > > > gig of memory!!! > > I''m experiencing the same with latest Rails (production mode) + MySQL + > WebRick on Mac OS X 10.4.1. Rails have eaten all my 1 GB memory! > Any solution appreciated! > > Gábor > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
On 2005.06.13., at 20:24, Jean Helou wrote:> You may want to check this : > http://thread.gmane.org/gmane.comp.lang.ruby.rails/11494 > and this > http://thread.gmane.org/gmane.comp.lang.ruby.rails/9890 >Thanks, but reading them led to nowhere. The original problem not answered at all. Discussions curved to kind of configuring things but noone confirmed any config wiil stop rails eating all memory. So question remaind question. Rails EATS memory but why? And how to avoid it? Gábor _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Well are you running in production or test? It was clearly stated in the second thread that there''s currently a known leak in test mode and that it''s currently considered the cost of doing business. John W Higgins wishdev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Rails doesn''t eat memory, Webrick does. As far as I am aware, you can either use a different web server (apache is also available and easily made to work with Rails on Mac 10.4.1) or fix the memory leaks in Webrick. If you''d like to try another web server, there is more information about how to get mac OS X and rails working with other web servers (lighttpd, apache) in the wiki under Installation[1]. The goal of webrick is to be convenient for development rather than a good production platform. It recommended to switch to another web server for production. [1] http://wiki.rubyonrails.com/rails/show/HowtosInstallation On Jun 13, 2005, at 11:35 AM, Gábor SEBESTYÉN wrote:> Rails EATS memory but why? And how to avoid it?
On 2005.06.13., at 21:42, Derek Gulbranson wrote:> The goal of webrick is to be convenient for development rather than > a good production platform. It recommended to switch to another web > server for production. >OK, I have it! Environment.rb was misconfigured and indeed production mode now treats memory gently. So you were all right. Gábor _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Granted I wouldn''t ordinarily use Webrick for a production environment, but are you saying that Webrick was never intended to be used for anything but simple low-traffic web serving? I thought they were trying to make it a legitimate all-ruby webserver alternative. On 6/13/05, Derek Gulbranson <derek-fFfhg8q2ax8Be96aLqz0jA@public.gmane.org> wrote:> > The goal of webrick is to be convenient for development rather than a > good production platform. It recommended to switch to another web > server for production._______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails