Juggling chainsaws: Unsafe handling of Value objects
If you’ve been writing Unsafe code before Java 28, it’s probably time to stop. And to migrate to something easier to use correctly, like Varhandles or FFM.
Dan Heidinga. Eclipse OpenJ9 project lead and JVM developer
If you’ve been writing Unsafe code before Java 28, it’s probably time to stop. And to migrate to something easier to use correctly, like Varhandles or FFM.
Reference.reachabilityFence(Object ref) came up in discussion when reviewing the pull request to merge JEP 401: Value Classes and Objects (Preview) into the mainline JDK. The key question: what should a reachabilityFence do for an identity-less value type?
This week I gave a talk at Devoxx Belgium titled “The fast startup landscape is expanding!” which shows the set of options for faster startup and how that set is growing. The talk touches on everything from CDS/AppCDS/DynamicCDS & SharedClasses to GraalVM Native Image to CRIU solutions (like Project CRaC and OpenJ9 CRIU Support) and finally to what we need from OpenJDK’s Project Leyden.
What does it look like when phase-awareness is exposed in the programming model?
Java’s constantly evolving as a language and a runtime environment. That’s one of the amazing things about working on Java. Another area where Java - and let’s face it, much of the rest of the ecosystem - is evolving is around deployments. Historically, Java’s “sweet spot” has been long running server applications. Today, we’re seeing a shift to shorter uptimes due to trends like continous delivery and horizontal scaling. Cloud native approaches are putting pressure on startup time and memory footprint with the wider adoption of containers and kubernetes.
The Eclipse OpenJ9 project has a strong focus on finding the right balance between startup performance, peak throughput and memory usage. And we’ve done a pretty good job of it - see any of our claims about fast startup with comparable performance in roughly half the memory.