Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling/disabling GC manually causes rack-perftools_profiler to hang #18

Open
fimmtiu opened this issue Apr 2, 2012 · 1 comment
Open

Comments

@fimmtiu
Copy link

fimmtiu commented Apr 2, 2012

So I'm profiling a Rails 3.2 app on Ruby 1.9.3 which has the following filter in ApplicationController to reduce the frequency of GC runs:

@@last_gc_run = Time.now
around_filter do |c, &action|
  GC.disable
  rv = action.call()
  if Time.now - @@last_gc_run > 1.0
    GC.enable
    GC.start
    @@last_gc_run = Time.now
  end
  rv
end

Ordinarily, this makes things about 30% faster. If I hit http://mysite/controller/action, it runs as expected, only taking a few seconds... but if I hit http://mysite/controller/action?profile=1, it causes the Ruby process to spin up to 100% CPU usage and run forever. Doesn't respond to signals, needs to be SIGKILLed. Removing this around_filter makes ?profile=1 requests work normally again.

My configuration is { :default_printer => :text, :mode => :walltime }, although the bug seems to occur no matter which printer I use.

@fimmtiu
Copy link
Author

fimmtiu commented Apr 2, 2012

Sorry, forgot to mention: this is all running on Apache 2.2 with Passenger 3.0.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant