2 min

Tags in this article

, ,

Oracle is bringing project (JEP) Region Pinning for G1 and Project Amber to the programming language.

The new features should improve Java’s performance, stability, and security. JEP 423, also known as Region Pinning for G1, is designed to improve performance. Thus, the garbage-first (G1) Garbage Collector for memory-intensive multiprocessor machines is given a prominent role within this release.

This project helps reduce latency by applying garbage collection during native library calls, which would normally cause the collector to pause. This is accomplished by determining which objects should be blocked during native library calls. JEP 423 fixes (pins) the areas that possess the objects. In this way, garbage collection can continue for non-pinned areas.

Project Amber

Another prominent role within Java 22 is for Project Amber, which is designed for productivity-oriented Java features. Four JEPs are getting updates to optimize support further. First, “Statements before super(…),” which allows developers to specify the behaviour of constructors. Instructions that do not reference the created instance will appear before the call to a constructor.

Another innovation within Project Amber is Unnamed Variables & Patterns. This allows the Java language to be enhanced with unnamed variables and patterns. Developers can use this when variable declarations or nested patterns are needed but never used. In addition, developing Java programs becomes more accessible by expressing strings that contain values for the runtime process.

Finally, Oracle is releasing the second preview of JEP 463. With this project, Java targets students who want to write their first software programs. Teachers can introduce concepts of Java step-by-step with JEP 463.

Oracle describes the remaining updates to Java 22 as follows: “enhancements from Project Panama (Foreign Function & Memory API and Vector API); features related to Project Loom (Structured Concurrency and Scoped Values); core libraries and tools capabilities (Class-File API, Launch Multi-File Source-Code Programs, and Stream Gatherers).”

Tip: What are the most important updates in Java 20?