class Memtf::Analyzer::Memory

Encapsulate implementation of object memory tracking

Public Class Methods

iterate(&block) click to toggle source

Iterate over each object on the heap

# File lib/memtf/analyzer/memory.rb, line 7
def iterate(&block)
  ObjectSpace.each_object do |obj|
    block.call(obj)
  end
end
size_of(object) click to toggle source

Calculate the memory allocated to a given Object in bytes

@param [Object] object @return [Number]

# File lib/memtf/analyzer/memory.rb, line 17
def size_of(object)
  ObjectSpace.memsize_of(object)
end