Skip to content

Instantly share code, notes, and snippets.

View ashr81-rg's full-sized avatar

Ashrith ashr81-rg

  • ReportGarden
  • Hyderabad, India
View GitHub Profile
@ashr81-rg
ashr81-rg / measure.rb
Created May 22, 2018 15:01 — forked from camertron/measure.rb
Measure the memory taken by a Ruby object (by Robert Klemme)
#!/bin/env ruby
# lazy hack from Robert Klemme
module Memory
# sizes are guessed, I was too lazy to look
# them up and then they are also platform
# dependent
REF_SIZE = 4 # ?
OBJ_OVERHEAD = 4 # ?