New JVM and Other Libs Features in Java 15 | TechWell

New JVM and Other Libs Features in Java 15

Computer with code

Each new version of the OpenJDK (Java Developer Kit) includes some language features and some non-language JVM (Java Virtual Machine), core-libs, and other libs-related features. Here, we’ll discuss some of the non-language new features in the upcoming OpenJDK 15.

Edwards-Curve Digital Signature Algorithm (EdDSA)
Digital signatures, also called cryptographic signatures, in Java are used to ensure the authenticity of the sender and integrity of the message.

The existing digital signature schemes are being replaced by the Edwards-Curve Digital Signature Algorithm (EdDSA) because it provides better performance and improved security. Users that want to use EdDSA have to install third-party libraries that support it.

OpenJDK 15 implements digital signatures using EdDSA and avails its inherent benefits of improved performance and existing support in OpenSSL crypto library and TSL 1.3.

Hidden Classes
Dynamic class generation is sometimes used to generate classes at runtime. As an example, the lambda expressions in a Java source code are not converted to a Java class file at compile-time, but instead, bytecode is generated and used at runtime.

As the dynamically generated classes are merely an implementation detail of the static classes, it is unnecessary to create and store named dynamic classes, not to mention the memory the dynamic classes’ storage uses.

OpenJDK 15 introduces hidden classes for dynamic use. Hidden classes are classes that are generated at runtime and used internally only by the framework that generates them. Hidden classes are not discoverable by other classes.

Nashorn JavaScript Engine Removed
The Nashorn JavaScript Engine was introduced in JDK 8. The command-line tool jjs tool was used to run JavaScript programs from the command-line. The Nashorn JavaScript engine is based on ECMAScript-262 5.1 standard.

The ECMAScript language constructs and APIs have evolved rapidly making it difficult to maintain the Nashorn JavaScript Engine.

JDK 11 deprecated the Nashorn JavaScript Engine including the jjs tool. The javax.script package, which consists of the scripting API classes that define Java Scripting Engines, is not affected. Java 15 has removed the Nashorn JavaScript Engine. Nashorn-based code may be migrated to GraalVM JavaScript engine, the successor to Nashorn.

New Z Garbage Collector
Garbage collection (GC) in Java is a necessary feature to free-up memory.

A common issue with most garbage collectors is GC pauses, which invariably add latency to application response times. GC pauses are quite unnecessary, especially as the scale of memory available on modern systems continues to grow.

JDK 11 added experimental support for a new garbage collector called Z Garbage Collector (ZGC) that incurs a very low latency (10 ms or less) overhead. OpenJDK 15 makes ZGC a product feature with several improvements over the experimental version. The improvements include concurrent class unloading, uncommitting unused memory, increasing maximum heap size from 4 TB to 16 TB, decreasing minimum heap size to 8 MB, adding support for class data sharing (CDS), and adding support for all commonly used platforms (Linux, Windows, macOS).

Shenandoah Garbage Collector
One of the overheads of almost all garbage collectors is pause-times in running Java applications.

The pause-times could range from 10-500 ms based on Service Level Agreements applications guarantee. The higher end of the range is still considerable given the large-scale memory available to modern machines.

JDK 12 introduced a low-pause parallel and concurrent garbage collection algorithm for large heap applications—named Shenandoah—as an experimental feature. The pause-times are toward the lower end of the 10-500ms range. Running programs are never interrupted for more than very few milliseconds. The benefits of Shenandoah are as follows:

  • Shorter pause times

  • Open-source

  • Architecture independent

  • Standard GC interface with performance comparable to G1, CMS, and Parallel GCs
  • OpenJDK 15 makes Standard GC a product feature


Up Next

About the Author

TechWell Insights To Go

(* Required fields)

Get the latest stories delivered to your inbox every week.