The Java object header is currently a 128-bit object in the 64-bit HotSpot VM, coupled with a 64-bit multipurpose header word and a 64-bit class pointer. The proposal states that reducing header size would greatly enhance overall CPU and memory usage for all Java workloads, reduce memory pressure, irrespective of been in a large in-memory database or small containerized app.
The reduction in object header will been useful for such purposes as tracking the age of each object in garbage collection, type information and storing identity hash code.
What would Developers benefit from Project Lilliput?
With Project Lilliput, Java would have a smaller object header, which means improving memory usage, with other benefits including:
- Packing of Objects gets tighter
- Higher Object Allocation rate
- Reduction in garbage collection activity
- Reduction in heap usage
Additionally, it will make the header layout more flexible and allows more build or runtime configuration of how bits are used.
Initial work plan for Project Lilliput
Project Lilliput cites a number of techniques to downsizing header fields, such as backfilling fields known at compile time and compressing pointers.
Albeit, there are constraints to the project, like the fact that it requires a change in assembly across supported platforms. Also, there could be issues with other Java projects, such as Loom: for decrease complexity in concurrent applications, Panama: for bridging between Java and C/C++ and Leyden: which addresses Java issues like slow startup time.