Skip to main content
PreparationZone Logo
PreparationZone
Back to Java

Java · Hard · Pro

Object header layout — mark word, klass pointer, alignment?

JavaMemory & JVMArchitect
Model answerPreview

Object headers

Every heap object has a mark word (hash, locks, GC age) and a Klass pointer to type metadata. HotSpot aligns objects to 8 bytes (64-bit)—fields pack after header with padding.