JEP 450 : Compact Object Headers i

What is JEP 450?

  • In Java, every object has a header (used for synchronization, identity hashcode, GC, etc.)

  • Historically, it was 96 bits (12 bytes) on 64-bit platforms

  • With JEP 450, object headers are now optional and compact — down to 64 bits (8 bytes) when possible

Why does it matter?

  • More efficient object layout

  • Better cache locality

  • Up to 5–10% memory savings in some apps

DEMO

Try to see class layout - attempt 1 - org.openjdk.jol

manual run :

mvn dependency:copy-dependencies

to copy org.openjdk.jol to traget to have it on classpath later

then run :

SCRIPT RUN :

This presentation works on openjdk but on azul the same amount of memory is allocated

If the same output

Try to see class layout - attempt 2 - mass allocation

with method :

We have two different results :

Education :

https://openjdk.org/jeps/450

Last updated