class Appsignal::GarbageCollection::Profiler
leak memory by keeping garbage collection run samples in memory.
time, while clearing ‘GC::Profiler`’s total_time to make sure it doesn’t
A wrapper around Ruby’s ‘GC::Profiler` that tracks garbage collection
def self.lock
def self.lock @lock ||= Mutex.new end
def initialize
def initialize @total_time = 0 end
def internal_profiler
def internal_profiler GC::Profiler end
def lock
def lock self.class.lock end
def total_time
-
(Integer)-
def total_time lock.synchronize do @total_time += (internal_profiler.total_time * 1000).round internal_profiler.clear end @total_time = 0 if @total_time > 2_000_000_000 @total_time end