Java object size feeling
The size of the Java object. There seems to be a mistake.
- reference
--4byte (32bit JVM or 64bit JVM with heap less than 32GB)
--8byte (64bit JVM with heap of 32GB or more)
- Object
―― 12byte (regardless of heap)
- Array
--12byte (32bit JVM or 64bit JVM with heap less than 32GB)
--24byte (64bit JVM with heap of 32GB or more)
However, since the size of the object is padded so that it is a multiple of 8 bytes, the minimum size of the object is 16 bytes.
Reference: Java Performance, p.202