Java 15

Java 15 – Garbage Collectors and Other Changes

Java 15 has made the ZGC, Z Garbage Collector a standard feature. It was an experimental feature till Java 15. It is low latency, highly scalable garbage collector.

ZGC was introduced in Java 11 as an experimental feature as developer community felt it to be too large to be released early. A lot of improvements are done to this garbage collection since then, for example −

  1. Concurrent class unloading
  2. Uncommiting of unused memory
  3. Support for Class Data Sharing
  4. NUMA Awareness
  5. Multithreaded Heap Pre-touch
  6. Max Heap Size limit from 4 TB to 16 TB.

ZGC is highly performant and works efficiently even in case of massive data applications e.g. machine learning applications. It ensures that there is no long pause while processing the data due to garbage collection. It supports Linux, Windows and MacOS.

The Shenandoah low-pause-time garbage collector is now out of the experimental stage. It had been introduced into JDK 12 and from java 15 onwards, it is a part of standard JDK.

Other Changes

JEP 383 – Foreign Memory Access API

Java 14 allowed java programs to safely and efficiently access foreign memory outside of the Java heap. Earlier mapDB, memcached, ignite java libraries provided the foreign memory access. It is a cleaner API to operate on all types of foreign memories(native memory, persistent memory, managed heap memory etc. ) in a seamless way. It also takes care of safety of JVM regardless of foreign memory type. Garbage collection/Memory deallocation operations should be explicitly mentioned as well.

This API is based on three main abstractions MemorySegment, MemoryAddress and MemoryLayout and is a safe way to access both heap as well as non-heap memory.

Java 15 continue this feature as incubating and added new refinements to the API.

JEP 339 − Edwards-Curve Digital Signature Algorithm (EdDSA)

Edwards-Curve Digital Signature Algorithm, EdDSA is an advanced elliptic curve scheme and is better than existing signature schemes in the JDK. It has improved security and performance as compared to other signature schemes. It is supported by popular crypto libraries like OpenSSL, BoringSSL etc. EdDSA will only be implemented in java 15 only in the SunEC provider.

JEP 373 − Reimplement the Legacy DatagramSocket API

Legacy implementations of the java.net.DatagramSocket and java.net.MulticastSocket APIs are replaced with simpler and more modern implementations which are easy to maintain and debug.

The current implementations of java.net.datagram.Socket and java.net.MulticastSocket are in jdk from 1.0, IPv6 was still under development. This JEP targets to replace current implementation of MulticastSocket which has reconciled IPv4 and IPv6 in ways that are difficult to maintain.

About the Author: Elavarasan PK

Technical Specialist, Intersoft Data Labs