Sha256: d98fc8a2999dec0485b6c716455c746229f331e97bca22549a1494a8892c87a0
Contents?: true
Size: 375 Bytes
Versions: 20
Compression:
Stored size: 375 Bytes
Contents
# frozen_string_literal: true class DeferredGarbageCollection DEFERRED_GC_THRESHOLD = (ENV['DEFER_GC'] || 15.0).to_f @last_gc_run = Time.zone.now def self.start GC.disable end def self.reconsider if Time.zone.now - @last_gc_run >= DEFERRED_GC_THRESHOLD GC.enable GC.start GC.disable @last_gc_run = Time.zone.now end end end
Version data entries
20 entries across 20 versions & 1 rubygems