Method: MemoryProfiler::ObjectSpaceAnalyser.__sizeof

Defined in:
lib/memory-profiler.rb

.__sizeof(o) ⇒ Object

Estimates the size of an object using Marshal.dump() Defaults to 1 if anything goes wrong.



302
303
304
305
306
307
308
309
310
# File 'lib/memory-profiler.rb', line 302

def self.__sizeof(o) #:nodoc:
	if o.respond_to? :dump
		Marshal.dump(o).size
	else
		1
	end
rescue ::Exception
	1
end