Get the latest tech news
Java 24 to Reduce Object Header Size and Save Memory
JEP 450 (Compact Object Headers) has been targeted for delivery in JDK 24. This currently experimental feature optimizes heap utilization by shrinking the size of the mandatory object header in HotSpot. This should reduce overall heap size, improve density of deployments, and increase data locality.
The new implementation, which has been developed as part of OpenJDK's "Project Lilliput" reduces the object header size on two target 64-bit platforms (x64 and AArch64). The project seeks to exploit the observed fact that many Java workloads have small average object sizes of 32 to 64 bytes. Once available in JDK 24 (betas or final), application teams can help by testing their workloads with this new feature activated via the command-line switch-XX:UseCompactObjectHeaders and looking for performance differences associated with it.
Or read this on Hacker News