JDK 12 release candidate: Shenandoah, G1, JMH, Arm64. Swing bugs hit back

    240 days have passed since the release of the JEP 3: JDK Release Process , and the hellish machine for producing new versions does not want to stop. So, it's time for the next release candidate . This is a period when all bridges are burned, bugs with P2-P5 priorities no longer mean anything, and the days before the release are numbered.


    Not all bugs with P1 priority are closed. You can view the full list of problems in the bugtracker . And here the strangest thing awaits us: they all relate strictly to Swing when using GTKLookAndFeel.

    Already mentally said: "What is wrong with these guys in Swing?". This time they are not to blame. If someone doesn't know, Gtk is a free toolkit for developing graphical interfaces, especially on the GNU / Linux operating system for X11 and Wayland.

    Since Gtk 3.20, they have changed the way they work with many styles and widgets. Instead of style classes and type names, element names are now used. GTK 3.20 was released on March 21, 2016 , and it was a very large release - 28933 commit and Wayland by default. In general, the whole Gnome began to look slightly different.

    Not surprisingly, Swing could have forgotten something and failed to test it. Some of the bugs were shifted to priority on P2 and transferred to JDK 13. For example, here is this bug about the fact that Motif in MacOS, as if to put it mildly, is no longer such an actual graphic environment:

    It will be funny if on Habré someone really still uses Motif and AWT. I hope the twelfth JDK will not be canceled because of this, otherwise it will be the most epic in Java for her entire young release story.


    JEPs in this list will be listed not by importance, but only by their sequence number. This is so that you suddenly do not think that Shenanda and JMH got to the top because of personal sympathies.

    189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)

    It would be nice if it happened a year ago, and Shenanda got into the LTS. Okay, wait - and thanks for that. Shenandoah is a low-ported collector that achieves its low pause due to the multi-stream evacuation phase. Moreover, the pauses do not depend on the size of the hip, so you can safely turn terabyte hip on the prod.

    230: Microbenchmark Suite

    A JMH based test suite is added to the JDK, and the JMH itself is also added. Lies in jdk/jdk/test/micro/org/openjdk/bench. JMH is a framework for creating, assembling, running and analyzing micro-benchmarks for Java and other JVM-languages, written by you understand who . JMH is now de facto the standard for microbench marks, and the emergence of such JEPs is a matter of time.

    325: Switch Expressions (Preview)

    Instead of a thousand descriptions:

    int numLetters = switch (day) {
        case MONDAY, FRIDAY, SUNDAY -> 6;
        case TUESDAY                -> 7;
        case THURSDAY, SATURDAY     -> 8;
        case WEDNESDAY              -> 9;

    334: JVM Constants API

    The goal is to provide a set of types for the formal modeling of descriptions of classes, methods, and other entities in runtime and class files and pull them onto basic classes like Stringor Class. They live in packages like java.lang.invoke.constantand they don’t ask, but you can look at the patch itself here .

    340: One AArch64 Port, Not Two

    The old port of arm64 is thrown out into the cold, but the 32-bit ARM and aarch64 are actively sawn. For the existence of these ports, it is necessary to thank, including the RedHat and BellSoft companies (by the way, the BellSoft office is located in St. Petersburg, next to the former Oracle office). For the JDK 12 release, we will try to get a more detailed comment from the company representatives.

    341: Default CDS Archives

    As a feature of CDS, we were available for a long time, but it was not clear why we should write it ourselves each time -Xshare:dump, if the default result of executing this command is a bit predictable at the stage of creating the JDK distribution. This annoying mistake will be repaired in JDK 12, the CDS archive will be generated by the creators of the distribution, even for night builds (provided they are 64-bit and native, not for cross-compilation).

    344: Abortable Mixed Collections for G1

    This feature is needed by the internal mechanisms of the G1 garbage collector, so that it more often meets the requirements for the duration of the pause. It so happens that it can be determined when G1 time and again incorrectly assesses the complexity of assembly, especially for old regions. At this point, you can get scared and start collecting incrementally, step by step, and after each step be able to interrupt the assembly. It is argued that this will allow better fit in the expected assembly time.

    346: Promptly Return Unused Committed Memory from G1

    Now G1 gives commited memory to the operating system either with full GC or with parallel assembly. Both G1 tries to avoid in every possible way, for which he thanks. But this also means that the memory is devoured as not to itself, and it is possible to force G1 to eject the memory back only in some external way. This is especially sad for any dockers and other hipsters without terabytes of RAM on the server. Instead, it is proposed to do it in the same way that Shenanda or GenCon from OpenJ9 already knows how to determine insufficient hip utilization and, accordingly, reduce its use. On some tests on Tomkate, this reduced the memory consumption by almost two times.

    What's next

    It was a review on the tops, and we will try to make a detailed analysis of the features closer to the release in the form of separate articles - JEP translations, screencasts with benchmarks, or something else. Now we have to wait for the release, which is scheduled for March 19.

    Minute advertising. Very soon, on April 5-6, the JPoint conference will take place, which will bring together a huge number of people who know a lot about JDK and all sorts of new features. For example, there will definitely be Simon Ritter from Azul with the report "JDK 12: Pitfalls for the unwary" . The right place to discuss the latest release! More information about the JPoint can be found on the official website .

    Also popular now: