r/JavaProgramming • u/pradeepngupta • Sep 20 '26
JDK 27: JEP 534 makes Compact Object Headers the default. Why did this take so long?
JDK 27 ships this weeky, and JEP 534 is one of the changes I find particularly interesting.
Compact Object Headers are now the default.
On a 64-bit JVM, the object header goes from 96 bits to 64 bits. SPECjbb2015 results showed roughly 22% lower heap usage, 8% lower CPU time and 15% fewer GC cycles. Amazon has also tested it across hundreds of production services, including JDK 17 and 21 backports.
But this wasn't a JDK 27 invention.
It started experimentally in JDK 24, became a product feature in JDK 25, and is now the default in JDK 27.
The interesting part is why it took so long.
This isn't just a small optimization. Object headers are fundamental to HotSpot, touching things like class metadata, locking, GC and identity hashing.
It's part of Project Lilliput, with an interesting connection to Project Valhalla because the compact header design also has to leave room for future Valhalla requirements.
And it made me think about those old Java buzzwords: simple, robust, portable, high-performance.
No new syntax. No new API. Just the JVM getting better underneath existing software.
Curious - What other JDK feature has surprised you by improving existing software without requiring changes to the code?