uses OS.memsize_of for more accurate results

Thanks to @tenderlove for the hint.