Writing in the front

The release of JDK 12 was a bit of a shock. From the functional thinking and paradigm of Java 1.8 to the modularity features of Java 1.9, I haven’t had a chance to feel the power of Java 1.11’s ZGC. What’s going on in JDK 12 this time? I really can’t learn any more. What should I do?

Anyway, let’s take a look at the new features in JDK 12 (Fan) and (yi).

To subscribe to CodeSheep’s public account, long press or scan below, you can get more practical, understandable and reproducible original articles


Garbage collector with low pause latency (experimental)

A Low-Pause-Time Garbage Collector (Experimental)

Added a new garbage collection (GC) algorithm named Shenandoah that reduces GC pause times by performing collection work concurrently with running Java threads. Shenandoah’s pause time is independent of the heap size, meaning that the heap will have the same pause time whether it is 200MB or 200GB.


Microbenchmark suite

Microbenchmark Suite

A basic suite of microbenchmarks has been added to the JDK source code, making it easy for developers to run existing microbenchmarks or create new ones.


Switch expressions (preview version)

Switch Expressions (Preview)

This is a preview language feature. The Switch syntax has been extended to be used not only as a statement but also as an expression, and both forms can be used with “traditional” or “simplified” syntax for different scopes or to control the flow of execution. These changes will simplify everyday coding and set the stage for using pattern matching (JEP 305) in Switch.


The JVM constants API

JVM Constants API

Introduce an API to model the nominal description of key class-files and run-time artifacts, especially constants that can be loaded from the constant pool.


Only the AArch64 implementation is retained

One AArch64 Port, Not Two

Remove all source code related to the ARM64 implementation, while preserving the 32-bit ARM and 64-bit AARCH64 implementation. The purpose of removing these implementations is to allow all contributors to focus on one implementation and eliminate the duplication of effort required to maintain both implementations.


The default class data shares the archive file

Default CDS Archives

Enhance the JDK build process to generate class data-sharing (CDS) archives on 64-bit platforms using the default class list.


Interruptible G1 Mixed GC

Abortable Mixed Collections for G1

Make the Mixed GC aborted if G1 has a possibility of exceeding the pause target.


G1 returns immediately without using allocated memory

Promptly Return Unused Committed Memory from G1

Enhance the G1 garbage collector to automatically return Java heap memory to the operating system when idle.


reference

  • openjdk.java.net/jeps/189
  • openjdk.java.net/jeps/230
  • openjdk.java.net/jeps/325
  • openjdk.java.net/jeps/334
  • openjdk.java.net/jeps/340
  • openjdk.java.net/jeps/341
  • openjdk.java.net/jeps/344
  • openjdk.java.net/jeps/346

Remember after

Don’t say anything, JDK 13 you slowly out, about to fall behind, I can’t keep up…

Due to the limited ability, if there is a mistake or improper place, please also criticize and correct, study together!

  • My Personal Blog: CodeSheep program sheep