JVMLS 2015 - The Secret History and Tragic Fate of sun.misc.Unsafe

Java · 14K views · 2015 · 18:22

Open on YouTube

Programming language designSoftware architecture & designtalkdated

Why Stack Overflow recommends it

Stack Overflow users link it when explaining the history and planned removal of sun.misc.Unsafe and the internal sun.* APIs in Java 9, citing Reinhold's own account as the authoritative source.

Recommended by 1 people across 1 different months, 2015 to 2023.

What it is

A talk from the 2015 JVM Language Summit in which Oracle's Mark Reinhold recounts why sun.misc.Unsafe exists, how libraries came to depend on it, and how the JDK plans to replace it with supported APIs and eventually remove it. It covers the approach later described in JEP 260.

What people said

Recommends khmarbaise · 2023-10 · Stack Overflow · on “How can the sonar-maven-plugin be configured to successfully analyze Java 21 projects?”

@VictorGubin for `sun.*` there are existing alternatives.. and about performance (in particular tricks) ... use more recent JDK's they are much faster than older versions..also about "sun.*" has been mentioned already in 199X not to use, but check this page [LINK] (an in particular go to the video [this video] (at 3:30) about "sun.*" package!!!)

Cites erickson · 2015-08 · Stack Overflow · on “Why is sun.misc.unsafe.Unsafe not in one of the default java.* packages?”

Making Unsafe part of the core API, and implementing the JLS are separate issues. Unsafe is not part of the Java API because it's unsafe, and Oracle didn't want developers to use it. However, they are well aware 1) that many good developers have used it successfully, and that 2) many bad developers have abused it. So, there is a long term plan to expose the useful features of Unsafe through the core Java platform in a safe, sane, and supportable way. You can view a presentation from Mark Reinhold [this video] that explains in more detail how Unsafe will be migrated and eventually go way. However, even when Unsafe APIs are moved into some java (or javax ) package, providers will still have interna

Cites mkobit · 2015-10 · Stack Overflow · on “Removal of sun.misc.Unsafe in Java 9 will break Spring, Hibernate”

Mark Reinhold had a talk during JVM Language Summit 2015 titled The Secret History and Tragic Fate of sun.misc.Unsafe [this video] . Although these talks have plenty of disclaimers on them, you can see the proposed approach at 10:23 [this video] , which is described in JEP260 [LINK] . The general idea is: replace existing functionality with safer, supported APIs deprecate the previously existing Unsafe APIs that has been replaced remove the deprecated code in the next version Here is some relevant text from JEP260 (taken from October 20th 2015): In JDK 9 we propose to: Encapsulate all non-critical internal APIs by default: The modules that define them will not export their packages for outside use. (A