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:
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'll try applying both of those fixes before I go any further,
although I suspect they aren't the cause of the bloat I'm seeing (both
of the pieces of code which got patched pre-date 2.1.2 and are
relatively old, one from August 2008 and one from 2006, and I didn't
really see any memory bloat in 2.1.2).
We had similar problem after upgrading from 2.1.0 to 2.2.2. Rails just
kept accumulating memory. After we applied the buffered logger fix
(http://github.com/rails/rails/commit/
9f69ff12d44c4d1e475fd6efede120ccedba3b3e) we were back normal memory
usage, no leaks.
Ran into a similar problem as well. After a frustrating week basically
unpacking all gems, and rebuilding our gem list fixed it (which is a
terrible answer cause i can't rightly say what caused the leak). Best
i can tell there was some issue with different gems that caused a
memory leak and removing and reinstalling them all seemed to resolve
it. Note to self, always check gems into your project