Erik Terpstra <erik / solidcode.net> writes:

> Is there some method that tells me how much memory a certain object
> consumes?
> 
> For example the size of: ['Hello world!', 345, [2, 9.43553]]
> 

String: 4 long + 1 pointer + the length of your string in bytes * 1 char
Fixnum: 2 long + 1 int
Array:  4 long + 1 pointer + the length of your array * 1 pointer 

This is all my guess from scanning ruby.h. Perhaps wrong, but should
be around the ballpark.

YS.