My last deployment was based on Rails 2.1.2 and would run for months
without restarts and without leaking memory; memory would sit at
around 35 to 40M per Mongrel instance.
On updating to 2.2.2 I’m seeing gradual memory bloat and every few
days it hits its resource limit (130M per Mongrel) and monit does a
restart.
I don’t think it’s a change in my own code that introduced the leak,
seeing as I made only minimal changes necessary to fix breakage caused
by updating Rails:
$ git diff 3f39f3a…5fc7345 --stat – app config lib
app/controllers/application.rb | 26 ±----
app/controllers/comments_controller.rb | 4 ±
app/helpers/application_helper.rb | 10 +++
app/helpers/articles_helper.rb | 6 –
app/models/user.rb | 4 ±
app/views/articles/edit.html.haml | 2 ±
app/views/articles/new.html.haml | 2 ±
app/views/articles/show.html.haml | 2 ±
app/views/comments/edit.html.haml | 2 ±
app/views/issues/_issues.html.haml | 2 ±
app/views/search/_article.html.haml | 2 ±
app/views/search/_issue.html.haml | 2 ±
app/views/search/_post.html.haml | 2 ±
app/views/search/_topic.html.haml | 2 ±
config/boot.rb | 4 ±
config/deploy.rb | 3 ±
config/environment.rb | 14 ±–
config/environments/development.rb | 2 -
config/environments/production.rb | 2 -
config/environments/test.rb | 8 ±-
config/initializers/extensions.rb | 17 ++++
config/locales/en.yml | 5 +
lib/active_record/acts/classifiable.rb | 2 ±
lib/active_record/acts/searchable.rb | 2 ±
lib/sortable.rb | 2 ±
lib/tasks/rspec.rake | 132 ++++++++++++++++++++++++
++++++++
26 files changed, 194 insertions(+), 67 deletions(-)
So I’m trying to hunt down the source of the leak, but it’s kind of
intimidating because it’s almost certainly a change in “vendor”, which
churned a whole lot from 2.1.2 to 2.2.2:
1313 files changed, 105152 insertions(+), 63806 deletions(-)
Wondering if anyone else has seen memory leaks creep in while moving
from 2.1.2 to 2.2.2?
Cheers,
Wincent