Highlights in latest Java 12 updates

Before we have a look at the new features, let’s clarify once again what it means when a version does not have a long-term support. As a short-term support release, Java 12 will receive commercial support from Oracle only until the release of the next Java version, in this case, Java 13.
You should keep in mind, however, that although Java 12 is not a major release, in the sense that it does not come with long-term support, it is not a minor release either since it brings eight new features.

Here is an overview:

Shenandoah: A Low-Pause-Time Garbage Collector (Experimental) — Add a new garbage collection (GC) algorithm named Shenandoah which reduces GC pause times by doing evacuation work concurrently with the running Java threads. Pause times with Shenandoah are independent of heap size, meaning you will have the same consistent pause times whether your heap is 200 MB or 200 GB.

Microbenchmark Suite — Add a basic suite of microbenchmarks to the JDK source code, and make it easy for developers to run existing microbenchmarks and create new ones.

Switch Expressions (Preview) — Extend the switch statement so that it can be used as either a statement or an expression, and that both forms can use either a “traditional” or “simplified” scoping and control flow behavior. These changes will simplify everyday coding, and also prepare the way for the use of pattern matching (JEP 305) in the switch. This will be a preview language feature.

JVM Constants API — Introduce an API to model nominal descriptions of key class-file and run-time artifacts, in particular, constants that are loadable from the constant pool.

One AArch64 Port, Not Two — Remove all of the sources related to the arm64 port while retaining the 32-bit ARM port and the 64-bit aarch64 port.

Default CDS Archives — Enhance the JDK build process to generate a class data-sharing (CDS) archive, using the default class list, on 64-bit platforms.

Abortable Mixed Collections for G1 — Make G1 mixed collections abortable if they might exceed the pause target.

Promptly Return Unused Committed Memory from G1 — Enhance the G1 garbage collector to automatically return Java heap memory to the operating system when idle.

With constant updates we see more and more features introduced into the language — but what are the developers feeling about this recent change? It’s not always easy to upgrade and implement new language features in large systems and enterprises, not to mention creating compatibility with legacy code and local tricks and hacks made by the team.

And indeed, when we take a cold, hard look at recent Java versions, we see that the frequent releases do not mean that the most recent version is the most popular one.

Although being the “oldest” member of the family, Java 8 popularity is undeniable. Java 11 is gaining some traction, probably due to it being the latest long-term supported version, while Java 12 is at the bottom of the list. It is a new version, so we’re willing to give it some time, but judging from the current state, it looks like it’s not about to change much.

Does that mean that Oracle should stop their six months cadence? Well, no. This decision was made to allow Oracle release “smaller” features faster than before, helping Java align with other languages on the market.

If you ask us, this change only helps Java maintain its power and popularity, both for young and upcoming developers and veterans in the programming world. Now the only question we have is… what will Java 13 introduce, and how will those features change the way we code?


Related blog:


Comments

Popular posts from this blog

How to convert Stream to Set using java

Java Concurrency Method basic example

How to Learn Java Effectively