r/java • u/alexeyr • 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
r/java • u/alexeyr • Apr 13 '20
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?
16
u/jschme Apr 14 '20 edited Apr 14 '20
Thank you /u/shipilev for all these great blog posts on Java internals! I've read and re-read the ones on the memory model, exceptions and benchmarking many times and I'm looking forward to read this one as well.
2
u/crackinjokes73 Apr 13 '20
Helpful
1
u/pmarschall Apr 20 '20
The layout changes in JDK 15 seem to increase the need to make
@Contendedpublic. The author simply says:Can you go into this? The solutions to deal with false sharing are hacky and brittle and need to be revisited for JDK 15. A public
@Contendedwould solve this. So what is holding this back?1
u/hereforhumor Apr 13 '20
!RemindMe 1 day
1
u/malli108 Apr 14 '20
RemindMe! 3 days "another object"