BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News OpenJDK News Roundup: Compact Object Headers, Synch Virtual Threads, Disable Security Manager

OpenJDK News Roundup: Compact Object Headers, Synch Virtual Threads, Disable Security Manager

There was a flurry of activity in the OpenJDK ecosystem in which: four JEPs, having successfully completed their respective reviews, are now Targeted for JDK 24; and five new JEPs have been Proposed to Target for JDK 24 and will be under review during the week of November 4, 2024.

Targeted

JEP 490, ZGC: Remove the Non-Generational Mode, has been promoted from Proposed to Target to Targeted for JDK 24. This JEP proposes to remove the non-generational mode of the Z Garbage Collector (ZGC). The generational mode is now the default as per JEP 474, ZGC: Generational Mode by Default, delivered in JDK 23. By removing the non-generational mode of ZGC, it eliminates the need to maintain two modes and improves development time of new features for the generational mode.

JEP 487, Scoped Values (Fourth Preview), has been promoted from Proposed to Target to Targeted for JDK 24. Formerly known as Extent-Local Variables (Incubator), proposes a fourth preview, with one change, in order to gain additional experience and feedback from one round of incubation and three rounds of preview, namely: JEP 481, Scoped Values (Third Preview), delivered in JDK 23; JEP 464, Scoped Values (Second Preview), delivered in JDK 22; JEP 446, Scoped Values (Preview), delivered in JDK 21; and JEP 429, Scoped Values (Incubator), delivered in JDK 20. This feature enables sharing of immutable data within and across threads. This is preferred to thread-local variables, especially when using large numbers of virtual threads. The only change from the previous preview is the removal of the callWhere() and runWhere() methods from the ScopedValue class that leaves the API fluent. The ability to use one or more bound scoped values is accomplished via the call() and run() methods defined in the ScopedValue.Carrier class.

JEP 478, Key Derivation Function API (Preview), has been promoted from Proposed to Target to Targeted for JDK 24. This JEP proposes to introduce an API for Key Derivation Functions (KDFs), cryptographic algorithms for deriving additional keys from a secret key and other data, with goals to: allow security providers to implement KDF algorithms in either Java or native code; and enable the use of KDFs in implementations of JEP 452, Key Encapsulation Mechanism.

JEP 404, Generational Shenandoah (Experimental), has been promoted from Proposed to Target to Targeted for JDK 24. This JEP proposes to provide an experimental generational mode, without breaking non-generational Shenandoah Garbage Collector, with the intent to make the generational mode the default in a future JDK release. Originally targeted for JDK 21, JEP 404 was officially removed from the final feature set due to the "risks identified during the review process and the lack of time available to perform the thorough review that such a large contribution of code requires." The Shenandoah team decided to "deliver the best Generational Shenandoah that they can" and target a future release.

Proposed to Target

Just over a week after having been elevated to Candidate status, JEP 493, Linking Run-Time Images without JMODs, has been promoted from Candidate to Proposed to Target for JDK 24. This JEP proposes to "reduce the size of the JDK by approximately 25% by enabling the jlink tool to create custom run-time images without using the JDK's JMOD files." This feature must explicitly be enabled upon building the JDK. Developers are now allowed to link a run-time image from their local modules regardless where those modules exist. The review is expected to conclude on November 5, 2024.

JEP 491, Synchronize Virtual Threads without Pinning, has been promoted from Candidate to Proposed to Target for JDK 24. This JEP proposes to:

Improve the scalability of Java code that uses synchronized methods and statements by arranging for virtual threads that block in such constructs to release their underlying platform threads for use by other virtual threads. This will eliminate nearly all cases of virtual threads being pinned to platform threads, which severely restricts the number of virtual threads available to handle an application's workload.

The review is expected to conclude on November 8, 2024.

JEP 488, Primitive Types in Patterns, instanceof, and switch (Second Preview), has been promoted from Candidate to Proposed to Target for JDK 24. This JEP, under the auspices of Project Amber, proposes a second round of preview, without change, to gain additional experience and feedback from the previous round or preview, namely: JEP 455, Primitive Types in Patterns, instanceof, and switch (Preview), delivered in JDK 23. This feature enhances pattern matching by allowing primitive type patterns in all pattern contexts, and extending instanceof and switch to work with all primitive types. More details may be found in this draft specification by Aggelos Biboudis, Principal Member of Technical Staff at Oracle. The review is expected to conclude on November 5, 2024.

JEP 486, Permanently Disable the Security Manager, has been promoted from Candidate to Proposed to Target for JDK 24. This JEP proposes to permanently disable the SecurityManager class since it was deprecated with JEP 411, Deprecate the Security Manager for Removal, delivered in JDK 17. While it was possible for developers to still enable the SecurityManager class while it has been deprecated, this functionality will be removed as the next step for ultimate removal. The review is expected to conclude on November 8, 2024.

JEP 450, Compact Object Headers (Experimental), has been promoted from Candidate to Proposed to Target for JDK 24. This JEP, inspired by Project Lilliput, proposes to "reduce the size of object headers in the HotSpot JVM from between 96 and 128 bits down to 64 bits on 64-bit architectures." This feature is disabled by default as it is considered experimental and may cause unintended consequences if enabled by a developer. The review is expected to conclude on November 7, 2024.

JDK 24 Feature Set (So Far) and Release Schedule

The JDK 24 release schedule, as approved by Mark Reinhold, Chief Architect, Java Platform Group at Oracle, is as follows:

  • Rampdown Phase One (fork from main line): December 5, 2024
  • Rampdown Phase Two: January 16, 2025
  • Initial Release Candidate: February 6, 2025
  • Final Release Candidate: February 20, 2025
  • General Availability: March 18, 2025

With just over a month before the scheduled Rampdown Phase One, where the feature set for JDK 24 will be frozen, these are the 14 JEPs (including the ones that are Proposed to Target) included in the feature set so far.

For JDK 24, developers are encouraged to report bugs via the Java Bug Database.

About the Author

Rate this Article

Adoption
Style

BT