Hey,
We recently spotted strange behavior with Rails 2.3. For some reason last 3 requests/responses (and all connected objects - controller, views, controller's instance variables, etc) are always present in memory in _production_ mode.
This is how we see the problem. Create an empty Rails application with a simple controller like this:
=== app/controllers/default_controller.rb === class A end
class DefaultController < ApplicationController
def index @a = A.new GC.start x = 0 ObjectSpace.each_object(A) do |o| x+=1 end puts x render :text => "Hello!" end
end
Now launch the application (in a production mode) and perform requests. You'll see that: - after first request: there's one object of class A in memory - after second request: there're two objects of class A in memory!!! - after third request: there're three objects of class A in memory!!! - after Nth request: there're still three objects of class A in memory!!!
The complete log output will look like this: