baldmountain
2008-Jan-23 18:07 UTC
Controllers don''t seemed to be released at the end of a request
Controllers seem to be leaked in 1.2.6 but not in 2.0.2. I created an
empty rails app with nothing but the following controller:
class HomeController < ApplicationController
def index
@contents = []
1.upto(2000) {
@contents << "big long string."
}
end
end
where "big long string is about 1K long. This creates a controller
with a member variable with a good 2 megs worth of stuff hanging off
it. (@contents) If I run this controller in 1.2.6, and then exercise
the app, it leaks like a sieve, but in 2.0.2 it doesn''t. I was
wondering what is hanging onto controllers at the end of a request? I
can work around the issue by setting @contents to nil or an empty
array at the end of the template but that seems like a hack and the
app is still leaking controllers.
Does anyone know what changed in 2.0.2 so that controllers can be
collected?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
baldmountain
2008-Jan-23 20:59 UTC
Re: Controllers don''t seemed to be released at the end of a request
Sigh. I think Im wrong about this. I added a finalizer using ObjectSpace.define_finalizer to the controller where it is created in base.rb. The act of defining the finalizer seems to keep the item from being collected. Sigh. Taking out the define_finalizer seems to fix the issue. On the other hand something still holding onto my controllers in my full app. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
John Barnette
2008-Jan-23 22:50 UTC
Re: Controllers don''t seemed to be released at the end of a request
On Jan 23, 2008 12:59 PM, baldmountain <baldmountain-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On the other hand something still holding onto my controllers in my > full app.We were investigating something similar recently at the day job, and tracked things back to routing. I''ll try and dig up our findings. ~ j. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
baldmountain
2008-Jan-24 12:25 UTC
Re: Controllers don''t seemed to be released at the end of a request
That would be great. I''ll also start looking into routing myself. Thanks for the pointer. On Jan 23, 5:50 pm, "John Barnette" <jbarne...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Jan 23, 2008 12:59 PM, baldmountain <baldmount...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > On the other hand something still holding onto my controllers in my > > full app. > > We were investigating something similar recently at the day job, and > tracked things back to routing. I''ll try and dig up our findings. > > ~ j.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---