Java 15 Gains Garbage Collection, Text Block Features
The COVID-19 pandemic doesn't delay the second major release of Java in 2020, which features memory management improvements that will help accelerate native code development.
Java 15 became generally available on Sept. 15, marking the second release in 2020 of the widely deployed programming language.
The Java 15 release follows Java 14, which debuted in March, and is noteworthy for a number of improvements, as well as the fact that the release was not delayed due to the COVID-19 pandemic. Chad Arimura, vice president of Java Developer Relations at Oracle, told ITPro Today that there hasn't been any impact to the Java release schedule due to the coronavirus.
Among the features that are now production-ready in Java 15 is the ZGC low-latency garbage collector. In Java, garbage collection refers to the process by which memory management is handled, making sure that memory is properly freed up when not being used. Oracle expects ZGC to be quite impactful for a multitude of workloads, providing a strong garbage collection option for developers, Arimura said.
"As businesses evolve to become more data-driven and utilize AI/ML to make quick decisions, the need for scalable, low-latency garbage collection becomes even more important," he said.
Another key capability that is now generally available is text block. According to Java Enhancement Proposal 378 (JEP 378), the goal of the text block feature is to simplify the task of writing Java programs by making it easy to express strings that span several lines of source code, while avoiding escape sequences in common cases.
Sealed Classes Preview in Java 15
Among the new features that are being offered as a technical preview in Java 15 is JEP 360 for Sealed Classes. The documentation for JEP 360 explains that sealed classes and interfaces restrict which other classes or interfaces may extend or implement them.
According to Simon Ritter, deputy CTO of Azul, sealed classes is likely the biggest new feature in Java 15 for developers. "This gives developers greater control over what other classes or interfaces may extend or implement them," Ritter told ITPro Today. "Think of it as giving developers greater control over how classes they write are used.”
Foreign Memory Access
Another technical preview in Java 15 is the Foreign-Memory Access API (JEP 383). The new API enables Java programs to access memory that is outside of the Java heap, referred to as "foreign" memory.
The foreign-memory access capability is part of a larger effort within Java known as Project Panama, according to Arimura. The goal of Project Panama is to enable better connection between native code, such as C code and code running in a Java virtual machine.
"The foreign-memory access API may not apply to all developers, but it's important to note that this represents a step forward for Project Panama, which aims to make it much easier to interface with native code from Java," Arimura said. "This is a big deal given most AI/ML code is written in native C/C+/C++."
Arimura said Java 16 is on track for release in March 2021.
About the Author
You May Also Like