Java Cup
Inside Java

News and views from members of the Java team at Oracle

Safety Not Guaranteed: sun.misc.Unsafe and the Quest for Safe Alternatives

(Recorded at JavaOne 2014 - for more, check our JavaOne 2014 playlist.)

Java is designed to be a safe platform. For a set of advanced developers innovating on the Java platform and pushing it to new limits, that safety comes with an unacceptable cost: either they cannot do what they need to do or cannot do it fast enough. In such cases, those advanced developers sacrifice safety and reach for a very sharp tool, an unsupported class within OpenJDK named sun.misc.Unsafe, where safety is not guaranteed. However, there is a problem. Unsafe is probably going away.