lib/allocation_stats.rb
# Begin tracing object allocations. Tracing must be stopped with
# AllocationStats#stop. Garbage collection is disabled while tracing is
# enabled.
Begin tracing object allocations. Tracing must be stopped with
AllocationStats#stop. Garbage collection is disabled while tracing is
enabled.
Begin tracing object allocations . Tracing must be stopped with AllocationStats#stop . Garbage collection is disabled while tracing is enabled .
def start
    GC.start
    GC.disable
    @existing_object_ids = {}
    ObjectSpace.each_object.to_a.each do |object|
      @existing_object_ids[object.__id__ / 1000] ||= []
      @existing_object_ids[object.__id__ / 1000] << object.__id__
    end
    ObjectSpace.trace_object_allocations_start
    return self
  end
def start GC . start GC . disable @existing_object_ids = { } ObjectSpace . each_object . to_a . each do | object | @existing_object_ids [ object . __id__ / 1000 ] ||= [ ] @existing_object_ids [ object . __id__ / 1000 ] << object . __id__ end ObjectSpace . trace_object_allocations_start return self end
Begin tracing object allocations.
Begin tracing object allocations .