rails and passenger memory issues

I’m using Rails 3, Passenger, and Postgresql. Yesterday the rails application was running very slow. So I rebooted the server. Less than 24 hours later, it is consuming even more memory than before and when trying to load the web page, it just hangs forever. I ran passenger-memory-stats to inspect the issue. And once again, I notice 2 rack processes using over 2 gigabytes of private dirty RSS:

$ rvmsudo -E /usr/local/rvm/gems/ruby-1.9.3-p327/bin/passenger-memory-stats

Use of uninitialized value $includedir in concatenation (.) or string at (eval 9) line 1.

Use of uninitialized value $includedir in concatenation (.) or string at (eval 9) line 1.

--------- Apache processes ----------

PID PPID VMSize Private Name

This blog post mentions using the xray gem to inspect running processes. That may or may not help, since you don’t know if they’re still doing whatever caused them to use so much memory by the time you find them. Couldn’t hurt to try, though.

http://pivotallabs.com/inspect-running-ruby-processes-using-xray-and-kill-3/

Jim Crate