fluent / sigdump

Use signal to show stacktrace of a Ruby process without restarting it
Apache License 2.0
188 stars 27 forks source link

Add GC::Profiler support #2

Closed mrkn closed 11 years ago

mrkn commented 11 years ago

This PR adds GC::Profiler support. It is only enabled when GC::Profile is enabled. Using the following simple script, I confirmed this change is available on both ruby 1.9.3-p392 and 2.0.0-p0.

require 'sigdump/setup'
GC::Profiler.enable
a = Thread.new {
  100.times {
    a = Array.new(10000){ 'aa' }
    sleep 0.1
  }
}
b = Thread.new {
  100.times {
    a = Array.new(10000){ 'aa' }
    sleep 0.1
  }
}
5.times do
  Process.kill :CONT, Process.pid
  sleep 0.5
end
a.join
b.join
frsyuki commented 11 years ago

:+1: