JDK Enhancement Proposal 450 proposes to merge a compressed class word into the mark word to reduce object header size on 64-bit systems from 96-128 bits to 64 bits, thus saving 10-20% of heap space.
JEP 450 ➱ https://openjdk.org/jeps/450
Alternative Fast-Locking Scheme ➱ https://bugs.openjdk.org/browse/JDK-8...
Forwarding Table ➱ https://bugs.openjdk.org/browse/JDK-8...
22 class pointer bits ➱ https://github.com/openjdk/lilliput/p...
~~~ Header Layouts ~~~
Current Object Header:
mark word (64 bit):
either
hash code (31 bit)
GC age (4 bit)
tag (2 bit)
or
tagged pointer to separate data structure
class word
either class pointer (64 bit)
or compressed class pointer (32 bit)
does not work with JVMCI or more than 3 million classes
Proposed Compact Object Header:
mark word (64 bit):
either
compressed class pointer (32 bit)
hash code (25 bit)
GC age (4 bit)
self forwarded tag (1 bit)
tag (2 bit)
or
tagged pointer to separate data structure
~~~ Chapters ~~~
0:00 Intro
1:09 Object Headers
2:06 Object Headers - Locking
3:24 Object Headers - Garbage Collection
5:57 Object Headers - Class Word
6:51 Compact Object Headers
7:57 Compact Object Headers - Locking
8:40 Compact Object Headers - Garbage Collection
9:52 Compact Object Headers - Hashing
10:11 The Compact Future
11:15 Outro
Tags: #Java #OpenJDK #Performance #InsideJava