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/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
1
u/pmarschall Apr 20 '20
The layout changes in JDK 15 seem to increase the need to make @Contended public. The author simply says:
There are security/reliability implications in allowing adversaries to construct huge "regular" objects. Let’s leave it at that.
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 @Contended would solve this. So what is holding this back?
1
u/hereforhumor Apr 13 '20
!RemindMe 1 day
1
u/RemindMeBot Apr 14 '20
There is a 10 hour delay fetching comments.
I will be messaging you in 13 hours on 2020-04-14 20:03:38 UTC to remind you of this link
CLICK THIS LINK to send a PM to also be reminded and to reduce spam.
Parent commenter can delete this message to hide from others.
Info Custom Your Reminders Feedback
1
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?