A Post Apocalyptic sun misc Unsafe World
summary
sun.misc.Unsafe faces phased removal (deprecated in Java 9, removed in Java 10) but big use cases remain: off-heap memory, fast layouts, custom fences, allocateInstance hacks and 78 internal uses in one project. Replacements shown include VarHandle for field/array atomics, a JVM-level Foreign Function Calls mechanism (JNRT-style method handles) for native interop, and Generic Specialization / value types, scopes and 64-bit arrays to restore performance and safe native memory management.
AI-written summary · about
chapters (14)
- 0:00Introduction and context
- 1:20What is sun.misc.Unsafe?
- 4:20Use cases and examples
- 9:13Frameworks relying on Unsafe
- 12:21The future of Unsafe
- 18:01Accessing Unsafe
- 20:56Atomic updates and handles
- 25:00Memory management solutions
- 30:43Serialization techniques
- 34:17Native interoperability
- 38:35Value types and immutability
- 42:52Specialized generics
- 45:23Finalizers and cleaning
- 47:43Conclusion
related talks
18mThe Secret History and Tragic Fate of sun.misc.Unsafe
46mUnsafe (and Java 9/10) (RU)
50mSafely Shoot Yourself in the Foot with Java 9
48mSafely Shoot Yourself in the Foot with Java 9
41mJava 9 VarHandles Best practices, and why?
44mEngineering a Modern Java Platform
39mSafety first
41mFrom Cowboy Mode to Careful Stewardship
