#sizeInMemory only takes into account object header size and the size of the objectitself.sizeInMemory is also ignorant of details such as the padding of objects to 64-bits in both 32-bit and 64-bit Spur, the overflow header when there are more than 254 slots, etc. siseInMemory should really be implemented like this: