Major differences between OpenJDK 17 and OpenJDK 11
Environment
- OpenJDK 11
- OpenJDK 17
Issue
- What are the differences between OpenJDK 17 and OpenJDK 11?
- Was there anything added or removed in JDK 17? What was deprecated?
Resolution
Major differences
- Content from openjdk.org is not included.JEP 403: Strongly Encapsulate JDK Internals. Access to non-public class members is not allowed.
- Always strict floating point semantics
- Context-specific deserialization filters allow applications to configure context-specific and dynamically selected deserialization filters via a JVM-wide filter factory invoked to select a filter for each serialization operation.
- Content from openjdk.java.net is not included.Elastic Metaspace: a new buddy-based allocation scheme to reduce footprint, reducing class-loader overhead and fragmentation, but also return unused native memory to the OS more promptly.
- GC log writes are async, so i/o issues (latency) writing to a gc.log will not block the entire JVM (See: https://access.redhat.com/solutions/6981996).
- BiasedLocking is disabled and deprecated: Content from bugs.openjdk.java.net is not included.JDK-8231265.
Features added
- Pattern matching switch (preview)
- Enhanced pseudo-random number generators that would provide new interface types and implementations for pseudorandom number generators (PRNGs) including jumpable PRNGs and an additional class of splittable PRNG algorithms (LXM).
- A new rendering pipeline for MacOS, using the Apple Metal API as an alternative to the existing pipeline that uses the deprecated OpenGL API.
- Content from openjdk.java.net is not included.JEP 412 Foreign Function and Memory API, introduced an incubator stage, allows Java programs to interoperate with code and data outside of the Java runtime.
- The flag
UseDynamicNumberOfGCThreadswill be honored: The number of threads used will be constantly re-evaluated and can thus vary over time, and the number of GC threads can dynamic change for a given workload. - G1GC Content from docs.oracle.com is not included.Periodic cleaning via
G1PeriodicGCIntervalflag. - Application Class-Data Sharing via Xshare:dump, ArchiveClassesAtExit, $ jcmd VM.cds
- ShenandoahSoftMaxHeapSize changed to SoftMaxHeapSize as a more general setting that applies to both the Shenandoah collector and ZGC.
- Async monitor deflation: Content from bugs.openjdk.org is not included.JDK-8153224.
- Shenandoah concurrent reference processing:
This content is not included.https://developers.redhat.com/articles/2021/05/20/shenandoah-garbage-collection-openjdk-16-concurrent-reference-processing#conclusion.
Feature deprecated/removed
- Deprecation of the Security Manager (that will be removed in a future release)
- Removal of the Remote Method Invocation (RMI) activation mechanism while preserving the rest of RMI. The RMI Activation mechanism is obsolete and disused and was deprecated for removal in JDK 15.
- Deprecating the Applet API for removal: no that much used, since all web browser vendors either have removed support for Java browser plug-ins or have announced plans to do so. This API was marked as deprecated in JDK 9.
- Removal of Nashorn JavaScript Engine: Content from openjdk.org is not included.JEP 372
- Content from openjdk.org is not included.JEP 363: Remove the Concurrent Mark Sweep (CMS) Garbage Collector.
-XX:+UseConcMarkSweepGChas been deprecated in JDK9. We can use G1GC as concurrent GC in JDK17.
Product(s)
Components
Category
Tags
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.