From: Tom Hughes Date: Sun, 26 Apr 2009 17:01:59 +0000 (+0000) Subject: Run GC if we hit the memory limit, and only restart if we are still too big. X-Git-Tag: live~7487 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/e3d20bd607cee68750046375b63637d37e75cd7c Run GC if we hit the memory limit, and only restart if we are still too big. --- diff --git a/public/dispatch.fcgi b/public/dispatch.fcgi index af8434a76..d3f9adf20 100755 --- a/public/dispatch.fcgi +++ b/public/dispatch.fcgi @@ -29,8 +29,12 @@ protected # Restart if we've hit our memory limit if resident_size > 512 - dispatcher_log :info, "restarting due to memory limit" - restart! + run_gc! + + if resident_size > 512 + dispatcher_log :info, "restarting due to memory limit" + restart! + end end end