|Java 16 Hits General Availability|
|Written by Kay Ewbank|
|Thursday, 18 March 2021|
Java Development Kit 16 is now generally available. Production-ready binaries under the GPL are available from Oracle; binaries from other vendors will follow shortly. Oracle has also released the new version under a commercial license for those using the Oracle JDK release as part of an Oracle product or service, or for those who want to be able to get commercial support.
The new release adds two major new features - support for Records, and Pattern Matching for the instanceof operator.
Records are classes that act as transparent carriers for immutable data, and can be thought of as nominal tuples. One reason for their addition to Java was an attempt to make the language less verbose in the hope of cutting down errors.
The addition of support for pattern matching for the instanceof operator is intended to make it possible for common logic in a program, namely the conditional extraction of components from objects, to be expressed more concisely and safely. The feature has been included as a preview feature since Java 14.
The JVM has been improved with enhanced support for concurrent thread-stack processing for the ZGC garbage collector. The processing has been moved from safepoints to a concurrent phase. The OpenJDK development team said:
"ZGC aims to make GC pauses and scalability issues in HotSpot a thing of the past. We have, so far, moved all GC operations that scale with the size of the heap and the size of metaspace out of safepoint operations and into concurrent phases. Those include marking, relocation, reference processing, class unloading, and most root processing."
Another JVM feature is elastic metaspace, a feature that returns unused HotSpot VM class-metadata (i.e. metaspace) memory to the operating system more promptly, reducing metaspace footprint. This is designed to improve memory use in applications with heavy class loading and unloading activity which until now could end up with a lot of unused space. The new scheme allocates metaspace memory in smaller chunks, and improves elasticity by returning unused metaspace memory to the operating system.
The new release also has new tools and libraries including Unix-domain socket channels and a packaging tool that allows for packaging self-contained Java applications.
or email your comment to: firstname.lastname@example.org