Discussion: How to get to single object header layout

Kennke, Roman rkennke at amazon.de
Wed Feb 26 18:52:33 UTC 2025


(2nd attempt at sending this. If you receive the other attempt, please ignore it.)

This is a follow-up to discussions that we had at the OpenJDK Committers Workshop earlier this month. I have been asked to come up with a detailed schedule of how I envision to make compact object headers aka Project Lilliput the default and one and only header layout in HotSpot, and post it here for wider discussion. The goal is to get to a consensus and prepare the various HotSpot contributors for what may come and when. In particular, I am aware that other, potentially conflicting changes are in the pipeline too (looking at Valhalla, possibly other projects, too?), which we should coordinate, not only in terms of code, but also in terms of reviewer/testing resources.

We agreed at the OCW that we should make the current 8-byte-headers the default object header layout first, and only then build 4-byte-headers on top of that. We also agreed that we want as few flags permutations as possible (if it were me, I would vote for having no new flags at all, and have new implementations replace old implementations, but I can see the operational usefulness of having a fallback available if something unexpected goes wrong.)

Many of the proposed changes are ‘only’ various progressions of flags moving from new/experimental to non-experimental to default to deprecated and obsoleted. The bulk of code changes would be in JDK 27, when Lilliput 2 hits the repos (which isn't as scary as Lilliput 1, which replaced the whole locking subsystem), and the current 12-byte headers are removed.

Please let me know what you think, how we can make this work, and especially whatever concerns you may have.

JDK 25:
- 8350272: Deprecate UseCompressedClassPointers for removal
- 8350457: Support Compact Object Headers as product option

JDK 26:
- 8346011: [Lilliput] Compact Full-GC Forwarding (required for UCCP removal, pre-req for L2)
- Obsolete +/-UseCompressedClassPointers
- Make +UseCompactObjectHeaders on-by-default
- Deprecate -UseCompactObjectHeaders

JDK 27:
- Obsolete -UseCompactObjectHeaders
- 8320761: [Lilliput] Implement compact identity hashcode (alternative code path to L1, under new experimental flag, e.g. +/-UseTinyObjectHeaders)
- 8347710: [Lilliput] Implement 4 byte headers (alternative code path to L1, under new experimental flag, e.g. +/-UseTinyObjectHeaders)

JDK 28:
- Make +/-UseTinyObjectHeaders non-experimental

JDK 29:
- Make +UseTinyObjectHeaders on-by-default
- Deprecate -UseTinyObjectHeaders

JDK 30:
- Obsolete -UseTinyObjectHeaders


More information about the hotspot-dev mailing list