Java 11 New Features

28/12/2020
Oracle has recently released Java Development Kit 10 (JDK 10), and that means JDK 11 is not far away, in accordance with Oracle’s new six-month release cycle. Let’s look at what new features you can already look forward to in JDK 11.

Epsilon Garbage Collector

According to the JDK Enhancement Proposal (or JEP) 318, Epsilon is a low-overhead garbage collector (GC) whose purpose is to handle memory allocation without implementing any actual memory reclamation mechanism.

The goal is to “provide a completely passive GC implementation with a bounded allocation limit and the lowest latency overhead possible, at the expense of memory footprint and memory throughput,” state Java core developers in the proposal. “A successful implementation is an isolated code change, does not touch other GCs, and makes minimal changes in the rest of JVM.”

Even though Java already offers a broad choice of highly configurable GC implementations, the developers believe that it’s easier to maintain a separate GC implementation to address specific use cases, such as performance testing, memory pressure testing, VM interface testing, extremely short-lived jobs, last-drop latency improvements, or last-drop throughput improvements, than piling on another configuration option on the existing GC implementation.

Local-Variable Syntax for Lambda Parameters

Java 10 introduced Local Variable Type Inference to reduce the verbosity associated with writing Java code, and Java 11 expands it to allow var to be used when declaring the formal parameters of implicitly typed lambda expressions, as stated in JEP 323, titled Local-Variable Syntax for Lambda Parameters.

As such, instead of writing:

(var x, var y) -> x.process(y)

It will be possible to simply write:

(x, y) -> x.process(y)

The uniformity itself isn’t the only benefit of local-variable syntax for lambda parameters. Another benefit is that it will become possible to apply modifiers to local variables and lambda formals without losing brevity.

Dynamic Class-File Constants

The JEP 309 extends the Java class-file format to support a new constant-pool form, CONSTANT_Dynamic, in order to reduce the cost and disruption of creating new forms of materializable class-file constants. Just as linking an invokedynamic call site delegates linkage to a bootstrap method, so will loading a CONSTANT_Dynamic delegate creation to a bootstrap method.

According to Java core developers, the new constant-pool form will offer language designers and compiler implementors broader options for expressivity and performance. “Richer, more flexible, more highly-typed constants remove friction from the development of invokedynamic protocols, which in turn facilitates the movement of complex logic from run time to linkage time, improving program performance and simplifying compiler logic.”

What Won’t Make It to Java 11

Despite the above-described features, Java 11 will actually be leaner than Java 10 because it’s set to lose CORBA (Common Object Request Broker Architecture), Java EE modules, and JavaFX, a set of graphics and media packages that enables developers to design, create, test, debug, and deploy rich client applications.

CORBA is the open standard for heterogeneous computing, and it was deprecated, along with Java EE modules, in Java SE 9. Standalone versions of Java EE modules will still be available from third-party sites, but Oracle won’t any longer have to maintain two separate implementations: one in Java SE and the other one in Java EE.

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

Install Oracle Java Development Kit (JDK) 10 on Linux Mint 19

In this article, I will show you how to install Oracle JDK 10 on Linux Mint 19. Let’s get started. Downloading Oracle...
29/12/2020

Install OpenJDK 8 on Debian 9 Stretch

Java Development Kit or JDK is used by Java programmers all over the world. Java is a compiled language. But unlike C/C++,...
28/12/2020

Ant vs Maven vs Gradle

Choosing the Right Build Tool: Ant vs Maven vs Gradle During software development, developers have to rebuild the same...
28/12/2020