跳到主要内容

JDK 28 新特性概览

JEPs proposed to target JDK 28​

JEP 543: Structured Concurrency​

Simplify concurrent programming by introducing an API for structured concurrency, which treats groups of related tasks running in different threads as single units of work. This streamlines error handling and cancellation, improves reliability, and enhances observability.

译

JEP 543: 结构化并发

通过引入用于 structured concurrency 的 API 来简化并发编程,该 API 将运行在不同线程中的一组相关任务视为单个工作单元。这简化了错误处理和取消,提高了可靠性,并增强了可观测性。

JEP 545: Faster Startup and Warmup with ZGC​

Improve application startup and warmup by enhancing the Z Garbage Collector to acquire and prepare physical memory more swiftly and efficiently in response to application needs.

译

JEP 545: 使用 ZGC 实现更快的启动和预热

通过增强 Z Garbage Collector,使其能够响应应用程序需求,更快速、更高效地获取和准备物理内存,从而改进应用程序启动和预热。

JEP 546: Adaptive Heap Sizing for ZGC​

Enhance the Z Garbage Collector to adaptively adjust the size of the heap based on the resources available, the application's needs, and the needs of neighboring applications contending for the same resources.

译

JEP 546: ZGC 的自适应堆大小调整

增强 Z Garbage Collector,使其能够根据可用资源、应用程序的需求以及争用相同资源的相邻应用程序的需求,自适应地调整堆的大小。

JEPs targeted to JDK 28, so far​

JEP 401: Value Objects (Preview)​

Introduce value objects, which are immutable and lack object identity. Value objects are distinguished solely by the values of their fields, and can be represented by Java Virtual Machines in ways that improve performance. This is a preview language and VM feature.

译

JEP 401: 值对象(预览)

介绍 值对象,它们是不可变的,并且没有对象标识。值对象仅通过其字段的值来区分,并且可以由 Java 虚拟机以提升性能的方式表示。这是一个 预览语言和 VM 特性。

JEP 535: Shenandoah GC: Generational Mode by Default​

Switch the default mode of the Shenandoah Garbage Collector to the generational mode. Deprecate the non-generational mode, with the intent to remove it in a future release.

译

JEP 535: Shenandoah GC: 默认启用分代模式

将 Shenandoah Garbage Collector 的默认模式切换为分代模式。弃用非分代模式,并计划在未来的版本中移除它。

JEP 539: Strict Field Initialization in the JVM (Preview)​

Introduce strictly-initialized fields in the Java Virtual Machine. Such fields must be initialized before they are read, thus default values such as 0 or null are never observed. For strictly-initialized fields that are final, the same value is always observed. This is a preview VM feature, available for use by compilers that emit class files.

译

JEP 539: JVM 中的严格字段初始化(预览)

在 Java 虚拟机中引入严格初始化字段。此类字段在被读取之前必须初始化,因此诸如 0 或 null 之类的默认值永远不会被观察到。对于 final 的严格初始化字段,始终观察到相同的值。这是一个 preview VM feature,可供生成 class 文件的编译器使用。

JEP 540: Simple JSON API (Incubator)​

Define a simple, standard API for parsing and generating JSON documents so that doing so does not require an external library. Enable many JSON processing tasks to be accomplished with little coding. This is an incubating API.

译

JEP 540: 简易 JSON API(孵化)

定义一个简单、标准的 API,用于解析和生成 JSON 文档,从而无需依赖外部库。使许多 JSON 处理任务只需少量代码即可完成。这是一个孵化中的 API。

JEP 541: Deprecate the macOS/x64 Port for Removal​

Deprecate the macOS/x64 port, with the intent to remove it in a future release, in order to reduce maintenance costs.

译

JEP 541: 弃用 macOS/x64 移植以供移除

弃用 macOS/x64 移植版,计划在未来版本中将其移除,以降低维护成本。

JEP 542: PEM Encodings of Cryptographic Objects​

Introduce an API for encoding objects that represent cryptographic keys, certificates, and certificate revocation lists into the widely-used Privacy-Enhanced Mail (PEM) transport format, and for decoding from that format back into objects.

译

JEP 542: 密码学对象的 PEM 编码

介绍一个 API,用于将表示密码学密钥、证书和证书吊销列表的对象编码为广泛使用的 Privacy-Enhanced Mail (PEM) 传输格式,以及从该格式解码回对象。

JEP 544: Ahead-of-Time Code Compilation​

Improve startup and warmup time by making optimized native code for an application instantly available when the HotSpot Java Virtual Machine starts. Achieve this by compiling application code to native code in a training run, storing the native code in the AOT cache for use in subsequent production runs. If the workload changes in production, regenerate native code dynamically for continued peak performance, providing the best of both ahead-of-time (AOT) and just-in-time (JIT) compilation.

译

JEP 544: 提前代码编译

当 HotSpot Java Virtual Machine 启动时,使针对应用程序的优化原生代码立即可用,从而缩短启动和预热时间。为此,在一次训练运行中将应用程序代码编译为原生代码,并将该原生代码存储到 AOT cache 中,以供后续生产运行使用。如果生产环境中的工作负载发生变化,则动态重新生成原生代码,以持续保持峰值性能,从而兼具提前编译(AOT)和即时编译(JIT)的优点。