diff options
author | francis <francis> | 2009-09-17 10:24:34 +0000 |
---|---|---|
committer | francis <francis> | 2009-09-17 10:24:34 +0000 |
commit | 6c251bd414c4a6ea10cc74f25db1d9c5f2fbb15c (patch) | |
tree | 7e21693480ce2ba4192249b3dc81a8bac7c24c9c /app/controllers/application.rb | |
parent | 7220c3a29466b507e49828af34bde5dd5edc10c4 (diff) |
Store only clipped attachment text in database.
Diffstat (limited to 'app/controllers/application.rb')
-rw-r--r-- | app/controllers/application.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 8c4410b65..0d3664d4d 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -6,15 +6,21 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: application.rb,v 1.57 2009-09-15 11:47:20 francis Exp $ +# $Id: application.rb,v 1.58 2009-09-17 10:24:35 francis Exp $ class ApplicationController < ActionController::Base # Standard headers, footers and navigation for whole site layout "default" - # Help work out which request causes RAM spike + # Help work out which request causes RAM spike. # http://www.codeweblog.com/rails-to-monitor-the-process-of-memory-leaks-skills/ + # This shows the memory use increase of the Ruby process due to the request. + # Since Ruby never returns memory to the OS, if the existing process previously + # served a larger request, this won't show any consumption for the later request. + # Ruby also grabs memory from the OS in variously sized jumps, so the extra + # consumption of a request shown by this function will only appear in such + # jumps. around_filter :record_memory def record_memory File.read("/proc/#{Process.pid}/status").match(/VmRSS:\s+(\d+)/) |