Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Java 22 is born! And you are already outdated!

Thiago
March 30, 2024

Java 22 is born! And you are already outdated!

Java 22 was released on March 19th and brings more than 10 JEPs. Do you know them?

Knowing them is essential to delivering better solutions, don’t you believe it? Come with me to learn about them and how to take advantage of them.

Thiago

March 30, 2024
Tweet

More Decks by Thiago

Other Decks in Technology

Transcript

  1. Table of Contents Increase Development Productivity Performance and Garbage Collector

    Frameworks and Future How to stay up to date with the news 01 01 02 03 04
  2. JEP - JDK Enhancement Proposal JEP is a document whose

    purpose is to add an enhancement to Java.
  3. The goal of Project Amber is to explore and incubate

    smaller, productivity-oriented Java language feature. • Pattern Matching for Switch • Pattern Matching for Instanceof • Unnamed Classes and Instance main methods • Local-Variable Type Inference (var) • Records • Sealed Classes • String Templates • Text Blocks • Switch Expressions • Unnamed Patterns and Variables • Statements before super(…) (Preview) Project Amber
  4. A. 2 B. 3 C. 4 D. 5 E. >

    5 F. Do we have more than one? How many GC are there ?
  5. A. 2 B. 3 C. 4 D. 5 E. >

    5 F. Do we have more than one? How many GC are there ?
  6. Parallel GC • Is the default until Java 9 •

    Is more focused on throughput
  7. CMS • Was replaced by G1GC • It was removed

    by JEP 363 - Remove the Concurrent Mark Sweep (CMS) Garbage Collector, after Java 14
  8. G1 • Is the default since Java 9 by JEP

    248: Make G1 the Default Garbage Collector • More focus on the balance between throughput and latency
  9. G1 G1 continues to be improved: - JEP 423: Region

    fix for G1, on Java 22 - JDK-8272773 - Configurable Card Table Card Size (-XX:GCCardSizeInBytes) available on java 18
  10. Shenandoah • Lower latency GC • JEP 379: Shenandoah: A

    Low-Pause-Time Garbage Collector (Production), available on Java 15 for production
  11. ZGC • Lower latency GC • JEP 377: ZGC: A

    Scalable Low-Latency Garbage Collector (Production), available on Java 15 for production • Improving in ZGC on Java 21 - JEP 439: Generational ZGC
  12. Java 22 • JEP 454: Foreign Function & Memory API

    • JEP 457: Class-File API (Preview) • JEP 458: Launch Multi-File Source-Code Programs • JEP 460: Vector API (Seventh Incubator) • JEP 462: Structured Concurrency (Second Preview) • JEP 464: Scoped Values (Second Preview) …
  13. Java 23 and Future • JEP 455: Primitive types in

    Patterns, instanceof, and switch (Preview) • JEP 404: Generational Shenandoah (Experimental) • JEP 401: Value Classes and Objects (Preview) • JEP 467: Markdown Documentation Comments • JEP 468: Derived Record Creation (Preview)
  14. How to stay up to date? Not all improvements are

    done by JEP, so you can follow the release notes from Oracle https://www.oracle.com/java/technologies/javase/22-relnote-is sues.html
  15. How to stay up to date? Follow by blog, where

    I’m posting about best practices, and also more tips to help you improve your productivity with Java 😁 https://devjava.substack.com/