created on | July 16, 2022 |
general availability on 2019-03-19
JEP | state | summary /remark |
---|---|---|
JEP 189: Shenandoah, A Low-Pause-Time Garbage Collector (Experimental) | experimental | a GC which reduces GC pause times by doing evacuation work concurrently with the running Java threads. Pause times are independent of heap size, the goal is to never interrupt the running program for more than a handful of milliseconds. |
JEP 325: Switch Expressions (Preview) | preview | extended switch statement that can be used as either a statement or an expression. Both forms can use either a “traditional” or “simplified” scoping and control flow behavior. |
JEP 334: JVM Constants API | standard | an API to model nominal descriptions of key class-file and run-time artifacts, in particular constants that are loadable from the constant pool. |
JEP 344: Abortable Mixed Collections for G1 | standard | make all pauses in G1 abortable. |
JEP 346: Promptly Return Unused Committed Memory from G1 | standard | make G1 detect phases of Java heap under-utilization (“idle” phases), and automatically reduce the JVMs heap usage during that time. Tests with a prototype were quite impressive (see blow). |
JEP | summary /remark |
---|---|
JEP 230: Microbenchmark Suite | a basic suite of microbenchmarks in the JDK source code. Makes it easy for developers to run existing microbenchmarks and create new ones. |
JEP 340: One AArch64 Port, Not Two | remove all of the sources related to the arm64 port while retaining the 32-bit ARM port and the 64-bit aarch64 port. |
JEP 341: Default CDS Archives | enhance the JDK build process to generate a class data-sharing (CDS) archive, using the default class list, on 64-bit platforms. |
none
none
To enable/use Shenandoah GC, the following JVM options will be needed: .
The Shenandoah wiki page lists the supported Java versions as Java 8, Java 11 and Java 17. Users of Java 12 are encouraged to migrate to Java 17 as soon as possible.
Shenandoah availability differs by vendor and JDK release. The wiki page lists the vendor status.
The following switch statement in “traditional” form:
can be reduced to:
There are a few notable things in the new extended form of the “traditional” switch statement:
The code to the right of a “case L ->” switch label is restricted to be an expression, a block, or (for convenience) a throw statement.
You can mix the traditional and extended form. That is, you can use the labels and . In this case values are yielded using the break with value statement:
The cases of a switch expression must be exhaustive. For any possible value there must be a matching switch label, which means that more often than not a default clause is required.
A switch expression must complete with a value, or throw an exception. The compiler checks that for every switch label, if it is matched then a value can be yielded (or an exception is thrown).
From JEP 346:
" Tests with a prototype in Bruno et al., section 5.5, shows that based on the real-world utilization of a Tomcat server that serves HTTP requests during the day, and is mostly idle during the night, this solution can reduce the amount of memory committed by the Java VM by 85%. "
JEP 346, Motivation
The link to the paper of Bruno et al. in the text cited above is unfortunately dead.
OpenJDK JDK 12 Feature List and Schedule
JEP 189: Shenandoah, A Low-Pause-Time Garbage Collector
(Experimental)
Shenandoah wiki page
JEP 325: Switch Expressions
(Preview)
JEP 346: Promptly Return Unused Committed Memory from G1