Java Object Headers and Compressed OOPs
Java objects in memory include data and an Object Header, which contains the Mark Word and Class Word. These store essential information like the object's identity hash code, age, lock state, and reference to its class. Compressed OOPs allow addressing 32 GB of memory using 32-bit pointers by leveraging object alignment in memory. This trade-off between performance and memory space is enabled by default but can be disabled with a VM option. Future enhancements aim to further reduce object header size.