Skip to content

Instantly share code, notes, and snippets.

@HectorMalot
Created March 6, 2012 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HectorMalot/1988204 to your computer and use it in GitHub Desktop.
Save HectorMalot/1988204 to your computer and use it in GitHub Desktop.
Disable GC during rails request
class ApplicationController < ActionController::Base
around_filter :disable_gc
private
def disable_gc
GC.disable
begin
yield
ensure
GC.enable
GC.start
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment