r/java • • Apr 13 '20

Java Objects Inside Out: Everything You Ever Wanted to Know About Java Object Internals in Hotspot

https://shipilev.net/jvm/objects-inside-out/
160 Upvotes

14 comments sorted by

View all comments

4

u/Polygnom Apr 14 '20

Quite interesting and helpful.

Something I wonder about is #4, especially word tearing and booleans wrt. records. Records are immutable. So in principle it should be possible to represent booleans inside records as exactly one bit, since concurrent writes simply aren't a problem, right?

1

u/alexeyr Apr 14 '20

Or more generally any group of final boolean fields...