[Java] About Java 12 features

Overview

-As you can see in OpenJDK official website, you have reached the "Release-Candidate Phase" phase. --Scheduled to be released on 2019/03/19 ――I would like to summarize the features.

Feature

189: Added algorithm "Shenandoah" to shorten the GC pause time * Experimental stage?

--Shenandoah will be newly added to the GC algorithm. It seems to reduce the GC downtime by running in parallel with the running thread. --Details of the algorithm can be found on this page (https://www.researchgate.net/publication/306112816_Shenandoah_An_open-source_concurrent_compacting_garbage_collector_for_OpenJDK).

230: Bundled with JMH

--It seems that JMH (Java Micro Benchmark Harness), which was provided separately from the JDK, is included in the JDK. --It seems that the existing JMH with added functions is not bundled.

325: Expanded Switch statement functionality

--The switch statement has been expanded. --The following is quoted from the official website

Traditional switch statement

switch (day) {
    case MONDAY:
    case FRIDAY:
    case SUNDAY:
        System.out.println(6);
        break;
    case TUESDAY:
        System.out.println(7);
        break;
    case THURSDAY:
    case SATURDAY:
        System.out.println(8);
        break;
    case WEDNESDAY:
        System.out.println(9);
        break;
}

Extended switch statement

switch (day) {
    case MONDAY, FRIDAY, SUNDAY -> System.out.println(6);
    case TUESDAY                -> System.out.println(7);
    case THURSDAY, SATURDAY     -> System.out.println(8);
    case WEDNESDAY              -> System.out.println(9);
}

――It's now easier to read because you can write simple things.

334: JVM Constants API --It seems that the java.lang.invoke.constant package has been added.

340: Removed arm64 source code

--It is said that arm64 has been deleted from the source code of Port for ARM64bit. --Since it was duplicated with the source of aarch64, it seems that the purpose is to reduce the burden on the developer.

341: CDS archive defaulting

--Support for 64-bit version only --It seems that the default class list has been changed to be used as a simplification of the CDS archive generation work. --This shortens the startup time. It is possible to save the trouble of having the user execute "-Xshare: dump".

344: Allow mixed GC to stop

--It seems that you can cancel the Mixed GC of G1.

346: G1 Garbage Collector Enhancement

--It seems that the G1 garbage collector has been strengthened to automatically return the heap memory to the OS when idle.

Postscript

The articles on the following site are well organized. https://japan.techrepublic.com/article/35134682.htm

Recommended Posts

[Java] About Java 12 features
About Java features
Java features
Java features
About Java interface
[Java] About arrays
Something about java
Where about java
About Java threads
java1.8 new features
[Java] About interface
About Java class
About Java arrays
About java inheritance
About interface, java interface
About List [Java]
About java var
About Java literals
About Java commands
About Java log output
About Java functional interface
Predicted Features of Java
Java, about 2D arrays
About class division (Java)
About [Java] [StreamAPI] allMatch ()
About Java StringBuilder class
[Java] About Singleton Class
About Java method binding
[Java] About anonymous classes
About method splitting (Java)
[Java Silver] About initialization
About Java Array List
About Java Polymorphism super ()
About inheritance (Java Silver)
About Java String class
About Java access modifiers
About Java lambda expressions
About Java entry points
About Java 10 Docker support
Personal summary about Java
[Java] About enum type
All about Java programming
[Java] Three features of Java
About java abstract class
A note about Java GC
What I researched about Java 8
Java version 8 and later features
About an instance of java
What I researched about Java 6
[Gradle] About Java plug-in tasks
New features from Java7 to Java8
About Java variable declaration statements
What I researched about Java 9
[Java] About try-catch exception handling
About Java class loader types
[Java Silver] About equals method
[Java] About String and StringBuilder
Java
What I researched about Java 7
About =
About Alibaba Java Coding Guidelines