What’s New in Java 27: Top Features and Improvements

Oracle has officially released Java Development Kit (JDK) 27, bringing a solid mix of performance upgrades, security modernizations, and developer productivity enhancements to standard Java.

This non-LTS (short-term) update ships with nine primary features on its reference implementation. Highlights include a universal default garbage collector, post-quantum security enhancements, compact object headers enabled out of the box, and several ongoing language previews.

Whether you are looking to boost runtime efficiency or streamline asynchronous code, here is a breakdown of what JDK 27 brings to the table.

Key Features in JDK 27

1. Universal Default Garbage Collection (G1)

Previously, the Garbage-First (G1) collector served as the default primarily in server settings. With JDK 27, G1 is now the universal default garbage collector across all environments. The update ensures consistent HotSpot JVM behavior while maintaining performance across throughput, latency, startup times, and memory consumption.

2. Post-Quantum Hybrid Key Exchange for TLS 1.3

To prepare Java applications for future quantum computing threats, JDK 27 introduces post-quantum hybrid key exchange algorithms for TLS 1.3 connections. By combining traditional cryptography with quantum-resistant algorithms, this feature adds a crucial layer of defense for secure network traffic.

3. Compact Object Headers Enabled by Default

By reducing object header sizes from 96 bits to 64 bits on 64-bit architectures, compact object headers are now active by default in the HotSpot JVM. This change lowers overall heap footprint, improves data locality, and allows higher deployment density.

4. In-Process JFR Data Redaction

JDK Flight Recorder (JFR) now includes native, in-process redaction capabilities. Before recording files leave the process, sensitive details—such as command-line parameters, environment variables containing tokens, and system properties storing passwords—can be automatically stripped out to prevent accidental security leaks.

5. Lazy Constants (3rd Preview)

Lazy constants offer an API for handling unmodifiable data while providing JVM-level optimizations comparable to final fields. The primary advantage over standard final variables is increased flexibility regarding when the value is initialized.

6. Primitive Types in Patterns, instanceof, and switch (5th Preview)

Java continues to refine pattern matching by expanding support for primitive types. Developers can now utilize primitives across all pattern-matching contexts, including switch expressions and instanceof checks.

7. Structured Concurrency (7th Preview)

Structured concurrency aims to make multi-threaded programming cleaner and safer. By treating group tasks across separate threads as a single unit of work, the API streamlines task cancellation, simplifies error propagation, and enhances overall observability.

8. Vector API (12th Incubation)

The Vector API returns for another incubation round. It provides a reliable way to express vector computations that compile down to optimal CPU-specific vector instructions at runtime, offering performance gains over traditional scalar code.

9. PEM Encodings for Cryptographic Objects (Preview)

This new preview API simplifies handling cryptographic assets by providing standard methods to encode and decode keys, certificates, and Certificate Revocation Lists (CRLs) into and from the widely used PEM format.

Release & Support Cycle

JDK 27 is a short-term release, meaning it will receive six months of Oracle support until the next version arrives. It follows JDK 26, which launched earlier this year in March.

Leave a Reply

Your email address will not be published. Required fields are marked *