Skip to content

Instantly share code, notes, and snippets.

View radiocontroller's full-sized avatar
🏊‍♀️
Focusing

Rcer radiocontroller

🏊‍♀️
Focusing
  • Hangzhou
  • 21:06 (UTC +08:00)
View GitHub Profile
@camertron
camertron / measure.rb
Created June 15, 2012 22:48
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 # ?