diff options
-rw-r--r-- | app/controllers/application.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/controllers/application.rb b/app/controllers/application.rb index e427fda9c..bf596bfbe 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -6,13 +6,20 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: application.rb,v 1.53 2009-07-14 23:30:37 francis Exp $ +# $Id: application.rb,v 1.54 2009-09-10 14:07:36 francis Exp $ class ApplicationController < ActionController::Base # Standard headers, footers and navigation for whole site layout "default" + # Help work out which request causes RAM spike + # http://stackoverflow.com/questions/161315/ruby-ruby-on-rails-memory-leak-detection + before_filter :log_ram # or use after_filter + def log_ram + logger.warn "PID: #{Process.pid} RAM USAGE: " + `pmap #{Process.pid} | tail -1`[10,40].strip + end + # Set cookie expiry according to "remember me" checkbox, as per "An easier # and more flexible hack" on this page: # http://wiki.rubyonrails.org/rails/pages/HowtoChangeSessionOptions |