From d4f70c45029ab1c6aba4bc2d69283ae43e46d9ff Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 29 Apr 2011 12:18:59 -0700 Subject: examples/big_app_gc: update this example OobGC is actually broken with nginx these days since we needed to preserve the env for body.close... --- examples/big_app_gc.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/big_app_gc.rb b/examples/big_app_gc.rb index 779c3ee..0d9aa54 100644 --- a/examples/big_app_gc.rb +++ b/examples/big_app_gc.rb @@ -21,13 +21,11 @@ # of memory, and will hurt simpler apps/endpoints that can process # multiple requests before incurring GC. -class Unicorn::HttpServer - REQ = Unicorn::HttpRequest::REQ - alias _process_client process_client - undef_method :process_client +module Unicorn::BigAppGC def process_client(client) - _process_client(client) - REQ.clear + super + @request.clear GC.start end -end if defined?(Unicorn) +end +ObjectSpace.each_object(Unicorn::HttpServer) { |s| s.extend(Unicorn::BigAppGC) } -- cgit v1.2.3-24-ge0c7