You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm experiencing a huge memory leak issue in Rails 3.0.4 and 3.0.5. Both on WEBrick and Apache Passenger 3.0.3, both on OS X and Linux (Debian Lenny), using Ruby 1.8.7.
class ApplicationController < ActionController::Base
include AuthenticatedSystem
include RoleRequirementSystem
...
end
With these two includes, "ab -n 1000 -c1" (Apachebench, 1000 requests) will make my WEBrick process grow from 60 MB to about 600-800 MB. This also happens in tests, because of the fact that the tests won't run when I don't use the above includes in test_helper.rb. (Why not?)
Without these two includes, the same apachebench will only make it grow about 20MB.
I suspect the two included modules are somehow implicitly preloading User, and doing this again on every request. User is (in my case) the object which should be authenticable, and fairly large, with about 50 associations; it probably triggers another heap of objects being preloaded.
Is there a way to avoid this behaviour?
Thanks!
The text was updated successfully, but these errors were encountered:
I dug further and identified AASM (Acts As State Machine) as the probable cause for this. When I put "gem 'aasm'" in my Gemfile and "include AASM" in a model, the memory usage grows with each request, it seems, depending on how complex your state definitions are. See here: https://github.com/rubyist/aasm/issues/31
I'm experiencing a huge memory leak issue in Rails 3.0.4 and 3.0.5. Both on WEBrick and Apache Passenger 3.0.3, both on OS X and Linux (Debian Lenny), using Ruby 1.8.7.
I had a Rails 2.3.10 application running with restful_auth, and upgraded it to 3.0.4. This is when the leak started. See also http://stackoverflow.com/questions/5369623/tracing-memory-leak-in-ruby-on-rails-3-postgres-apache-passenger-application.
With these two includes, "ab -n 1000 -c1" (Apachebench, 1000 requests) will make my WEBrick process grow from 60 MB to about 600-800 MB. This also happens in tests, because of the fact that the tests won't run when I don't use the above includes in test_helper.rb. (Why not?)
Without these two includes, the same apachebench will only make it grow about 20MB.
I suspect the two included modules are somehow implicitly preloading User, and doing this again on every request. User is (in my case) the object which should be authenticable, and fairly large, with about 50 associations; it probably triggers another heap of objects being preloaded.
Is there a way to avoid this behaviour?
Thanks!
The text was updated successfully, but these errors were encountered: