Blog Posts Process Management

After Four Fast Releases, Java 13 Blends Big Features and Subtle Fixes

Blog: Oracle BPM

Georges Saab, left, chair of the OpenJDK Governing Board, introduces Java Community Process executive committee members Bruno Souza of SouJava and Gil Tene of Azul Systems during his keynote at Oracle Code One.

 

At last year’s Oracle Code One conference, Java’s rapid-release cadence—a new version every six months—was still making news. And it wasn’t even new anymore. The change in release frequency from years to months had met initial skepticism both inside and outside the Java development team.

“It seemed inconceivable that we could turn a ship as big as Java around that fast,” said Java Language Architect Brian Goetz in his keynote address at Code One 2019 in San Francisco. “There were even fears that Java 10 or 11 might not have any features at all.” But four rapid releases later (10, 11, 12, and now 13), he said, “has fundamentally changed how we go about planning and designing new features.”

The proof is in five new features Goetz announced in Java 13, now generally available. These features range from performance enhancements to the HotSpot virtual machine and garbage collection to much-requested (yet subtle) changes that make Java code more reliable, readable, and rapid.

Optimizing Garbage Collection

“One of the advantages of Java is you can mostly run old code on a new runtime,” said Goetz, but developers who do so may be leaving some performance on the table. To demonstrate the benefits that come from simply upgrading to a newer Java Development Kit, Goetz invited Mikael Vidstedt, who runs the Java Virtual Machine engineering team at Oracle, to the stage.

When the just-in-time compiler or the garbage collector performs well, no one even notices, Vidstedt jokingly complained. His team has been steadily improving JVM performance even as developers now use much more heap memory (the area in memory where an app stores objects it’s using) than in the past. “When I started working with Java, hundreds of megabytes were considered a big heap, but now big is terabytes, and core counts have similarly increased,” he said.

In Java 13, speed demons have several new options. Dynamic class-data sharing will improve startup performance by optimizing memory usage. For dramatic speedups, Vidstedt pointed to the new Native Image tool from GraalVM, which can compile a Java application to native code.

Finally, there’s Z Garbage Collector, the new garbage collector with 1 millisecond pause times, even on a multiterabyte heap. Bottom line: Automatically reclaiming memory, which is a manual process in other programming languages, improves with each new release.

But there’s more coming on the memory front, and much of it is happening in Project Valhalla, which aligns how Java treats data with modern hardware performance. As processors have evolved during the last 30 years, computation has gotten cheaper and memory access has gotten more expensive, Goetz explained. “We’ve made a lot of progress in the last year,” he said. Java is already plenty fast, he reassured the audience, but “we won’t be satisfied until users don’t feel like they have to choose between abstraction and performance.”

Switch Expressions, Text Blocks, and Pain Points

Goetz showed off several detailed coding improvements that illustrate how the team is able to innovate and deliver more nimbly than ever before.

Switch expressions were introduced in Java 12 to reduce complex if-then code, but they were originally part of a larger pattern-matching feature that is still under development, Goetz said. Thanks to the rapid release cadence, “we were able to extract this out as a subfeature and deliver it earlier, while we continued to work on pattern matching.”

Another highly requested feature added in Java 13 is text blocks, also known as multiline strings. “It’s not a particularly sophisticated feature, but it does make a big difference in everyday code,” Goetz said.

These features and others show how various Java projects are spinning off functionality with each new release, Goetz said. For example, Project Amber brought local variable type inference in Java 10, switch expressions in 12, and text blocks in 13. Now, “it’s poised to deliver several new features in the coming year—records, sealed types, and the first phase of pattern matching. None of these is as big as some earlier features, but they address real pain points that developers experience every day.”

How Could I Not Write It in Java?

One of those pain points is also a secret handshake that every Java programmer must memorize: the first line of every program. Surprise guest speaker Aimee Lucido is a Java developer launching a new children’s book, Emmy in the Key of Code, that subtly introduces poetic language that resembles source code so that “a kid could read the story and accidentally learn a little bit of Java at the same time.”

Like the programmers who lined up outside the keynote to take pictures with Java’s mascot Duke, or who retweeted the Java 13 logo of Duke flying on a jet-propelled surfboard as a highlight of the keynote, Lucido has a sentimental spot for the language. It’s no surprise, then, that her new book shares it with children: “How could I not write this in Java?”

Leave a Comment

Get the BPI Web Feed

Using the HTML code below, you can display this Business Process Incubator page content with the current filter and sorting inside your web site for FREE.

Copy/Paste this code in your website html code:

<iframe src="https://www.businessprocessincubator.com/content/after-four-fast-releases-java-13-blends-big-features-and-subtle-fixes/?feed=html" frameborder="0" scrolling="auto" width="100%" height="700">

Customizing your BPI Web Feed

You can click on the Get the BPI Web Feed link on any of our page to create the best possible feed for your site. Here are a few tips to customize your BPI Web Feed.

Customizing the Content Filter
On any page, you can add filter criteria using the MORE FILTERS interface:

Customizing the Content Filter

Customizing the Content Sorting
Clicking on the sorting options will also change the way your BPI Web Feed will be ordered on your site:

Get the BPI Web Feed

Some integration examples

BPMN.org

XPDL.org

×