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

The Evolution of Java Past, Present, and Future...

The Evolution of Java Past, Present, and Future - Winter 2024 Update

Avatar for Chihiro Ito

Chihiro Ito

May 02, 2025
Tweet

More Decks by Chihiro Ito

Other Decks in Technology

Transcript

  1. これまでのJava 3 Java SEの動向 バージョンの推移 2014~2016 2017 2018 2019 2020

    2021 2022 2023 2024 2025 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 最新 LTS 3/18 リリース
  2. Javaの仕様 • Java 言語仕様 (JLS) • Java 仮想マシン仕様 (JVMS) •

    Java Specification Requests (JSR) • JDK Enhancement Proposals (JEP) 4 Java SEの動向 さまざまな仕様
  3. Javaの仕様 • Java 言語仕様 (JLS) • Java 仮想マシン仕様 (JVMS) 5

    Java SEの動向 実装の種類 OpenJDK OpenJ9 GraalVM 実装
  4. Javaを提供しているベンダー 6 Java SEの動向 Eclipse Temurin Red Hat Build of

    OpenJDK Sap Machine OracleJDK Oracle OpenJDK Azul Zulu Liberica JDK Microsoft Build of OpenJDK Amazon Corretto Mandrel GraalVM CE GraalVM EE Eclipse OpenJ9 IBM OpenJ9 OpenJDK OpenJ9 GraalVM
  5. ここ数年の進化 7 Java SEの動向 Java 11 ~ 16 11 12

    13 14 15 16 • 181: Nest-Based Access Control • 309: Dynamic Class-File Constants • 315: Improve Aarch64 Intrinsics • 318: Epsilon: A No-Op Garbage Collector • 320: Remove the Java EE and CORBA Modules • 321: HTTP Client (Standard) • 323: Local-Variable Syntax for Lambda Parameters • 324: Key Agreement with Curve25519 and Curve448 • 327: Unicode 10 • 328: Flight Recorder • 329: ChaCha20 and Poly1305 Cryptographic Algorithms • 330: Launch Single-File Source-Code Programs • 331: Low-Overhead Heap Profiling • 332: Transport Layer Security (TLS) 1.3 • 333: ZGC: A Scalable Low-Latency Garbage Collector(Experimental) • 335: Deprecate the Nashorn JavaScript Engine • 336: Deprecate the Pack200 Tools and API • 305: Pattern Matching for instanceof (Preview) • 343: Packaging Tool (Incubator) • 345: NUMA-Aware Memory Allocation for G1 • 349: JFR Event Streaming • 352: Non-Volatile Mapped Byte Buffers • 358: Helpful NullPointerExceptions • 359: Records (Preview) • 361: Switch Expressions (Standard) • 362: Deprecate the Solaris and SPARC Ports • 363: Remove the Concurrent Mark Sweep (CMS) Garbage Collector • 364: ZGC on macOS • 365: ZGC on Windows • 366: Deprecate the ParallelScavenge + SerialOld GC Combination • 367: Remove the Pack200 Tools and API • 368: Text Blocks (Second Preview) • 370: Foreign-Memory Access API (Incubator) • 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental) • 230: Microbenchmark Suite • 325: Switch Expressions (Preview) • 334: JVM Constants API • 340: One AArch64 Port, Not Two • 341: Default CDS Archives • 344: Abortable Mixed Collections for G1 • 346: Promptly Return Unused Committed Memory from G1 • 339: Edwards-Curve Digital Signature Algorithm (EdDSA) • 360: Sealed Classes (Preview) • 371: Hidden Classes • 372: Remove the Nashorn JavaScript Engine • 373: Reimplement the Legacy DatagramSocket API • 374: Disable and Deprecate Biased Locking • 375: Pattern Matching for instanceof (Second Preview) • 377: ZGC: A Scalable Low-Latency Garbage Collector • 378: Text Blocks • 379: Shenandoah: A Low-Pause-Time Garbage Collector • 381: Remove the Solaris and SPARC Ports • 383: Foreign-Memory Access API (Second Incubator) • 384: Records (Second Preview) • 385: Deprecate RMI Activation for Removal • 350: Dynamic CDS Archives • 351: ZGC: Uncommit Unused Memory • 353: Reimplement the Legacy Socket API • 354: Switch Expressions (Preview) • 355: Text Blocks (Preview) • 338: Vector API (Incubator) • 347: Enable C++14 Language Features • 357: Migrate from Mercurial to Git • 369: Migrate to GitHub • 376: ZGC: Concurrent Thread-Stack Processing • 380: Unix-Domain Socket Channels • 386: Alpine Linux Port • 387: Elastic Metaspace • 388: Windows/AArch64 Port • 389: Foreign Linker API (Incubator) • 390: Warnings for Value-Based Classes • 392: Packaging Tool • 393: Foreign-Memory Access API (Third Incubator) • 394: Pattern Matching for instanceof • 395: Records • 396: Strongly Encapsulate JDK Internals by Default • 397: Sealed Classes (Second Preview) 11 12 13 14 15 16
  6. ここ数年の進化 8 Java SEの動向 Java 17~20 17 18 19 •

    306: Restore Always-Strict Floating-Point Semantics • 356: Enhanced Pseudo-Random Number Generators • 382: New macOS Rendering Pipeline • 391: macOS/AArch64 Port • 398: Deprecate the Applet API for Removal • 403: Strongly Encapsulate JDK Internals • 406: Pattern Matching for switch (Preview) • 407: Remove RMI Activation • 409: Sealed Classes • 410: Remove the Experimental AOT and JIT Compiler • 411: Deprecate the Security Manager for Removal • 412: Foreign Function & Memory API (Incubator) • 414: Vector API (Second Incubator) • 415: Context-Specific Deserialization Filters • 400: UTF-8 by Default • 408: Simple Web Server • 413: Code Snippets in Java API Documentation • 416: Reimplement Core Reflection with Method Handles • 417: Vector API (Third Incubator) • 418: Internet-Address Resolution SPI • 419: Foreign Function & Memory API (Second Incubator) • 420: Pattern Matching for switch (Second Preview) • 421: Deprecate Finalization for Removal • 405: Record Patterns (Preview) • 422: Linux/RISC-V Port • 424: Foreign Function & Memory API (Preview) • 425: Virtual Threads (Preview) • 426: Vector API (Fourth Incubator) • 427: Pattern Matching for switch (Third Preview) • 428: Structured Concurrency (Incubator) 参考(前ページ含む): https://openjdk.org/projects/jdk/11/ https://openjdk.org/projects/jdk/12/ https://openjdk.org/projects/jdk/13/ https://openjdk.org/projects/jdk/14/ https://openjdk.org/projects/jdk/15/ https://openjdk.org/projects/jdk/16/ https://openjdk.org/projects/jdk/17/ https://openjdk.org/projects/jdk/18/ https://openjdk.org/projects/jdk/19/ https://openjdk.org/projects/jdk/20 20 • 429: Scoped Values (Incubator) • 432: Record Patterns (Second Preview) • 433: Pattern Matching for switch (Fourth Preview) • 434: Foreign Function & Memory API (Second Preview) • 436: Virtual Threads (Second Preview) • 437: Structured Concurrency (Second Incubator)
  7. ここ数年の進化 9 Java SEの動向 Java 21~24 21 22 23 •

    430: String Templates (Preview) • 431: Sequenced Collections • 439: Generational ZGC • 440: Record Patterns • 441: Pattern Matching for switch • 442: Foreign Function & Memory API (Third Preview) • 443: Unnamed Patterns and Variables (Preview) • 444: Virtual Threads • 445: Unnamed Classes and Instance Main Methods (Preview) • 446: Scoped Values (Preview) • 448: Vector API (Sixth Incubator) • 449: Deprecate the Windows 32-bit x86 Port for Removal • 451: Prepare to Disallow the Dynamic Loading of Agents • 452: Key Encapsulation Mechanism API • 453: Structured Concurrency (Preview) • 423: Region Pinning for G1 • 447: Statements before super(...) (Preview) • 454: Foreign Function & Memory API • 456: Unnamed Variables & Patterns • 457: Class-File API (Preview) • 458: Launch Multi-File Source-Code Programs • 459: String Templates (Second Preview) • 460: Vector API (Seventh Incubator) • 461: Stream Gatherers (Preview) • 462: Structured Concurrency (Second Preview) • 463: Implicitly Declared Classes and Instance Main Methods (2nd Preview) • 464: Scoped Values (Second Preview) • 455: Primitive Types in Patterns, instanceof, and switch (Preview) • 466: Class-File API (Second Preview) • 467: Markdown Documentation Comments • 469: Vector API (Eighth Incubator) • 473: Stream Gatherers (Second Preview) • 471: Deprecate the Memory-Access Methods in sun.misc.Unsafe for Removal • 474: ZGC: Generational Mode by Default • 476: Module Import Declarations (Preview) • 477: Implicitly Declared Classes and Instance Main Methods (Third Preview) • 480: Structured Concurrency (Third Preview) • 481: Scoped Values (Third Preview) • 482: Flexible Constructor Bodies (Second Preview) 参考: https://openjdk.org/projects/jdk/21/ https://openjdk.org/projects/jdk/22/ https://openjdk.org/projects/jdk/23/ https://openjdk.org/projects/jdk/24/ • 404: Generational Shenandoah (Experimental) • 450: Compact Object Headers (Experimental) • 472: Prepare to Restrict the Use of JNI • 475: Late Barrier Expansion for G1 • 478: Key Derivation Function API (Preview) • 479: Remove the Windows 32-bit x86 Port • 483: Ahead-of-Time Class Loading & Linking • 484: Class-File API • 485: Stream Gatherers • 486: Permanently Disable the Security Manager • 487: Scoped Values (Fourth Preview) • 488: Primitive Types in Patterns, instanceof, and switch (Second Preview) • 489: Vector API (Ninth Incubator) • 490: ZGC: Remove the Non-Generational Mode • 491: Synchronize Virtual Threads without Pinning • 492: Flexible Constructor Bodies (Third Preview) • 493: Linking Run-Time Images without JMODs • 494: Module Import Declarations (Second Preview) • 495: Simple Source Files and Instance Main Methods (Fourth Preview) • 496: Quantum-Resistant Module-Lattice-Based Key Encapsulation Mechanism • 497: Quantum-Resistant Module-Lattice-Based Digital Signature Algorithm • 498: Warn upon Use of Memory-Access Methods in sun.misc.Unsafe • 499: Structured Concurrency (Fourth Preview) • 501: Deprecate the 32-bit x86 Port for Removal 24
  8. Javaのプロジェクト 11 Java SEの動向 活動中のプロジェクト 仮想マシン • Project Leyden •

    Project Lilliput • Portola Project • CRaC UI • OpenJFX Project • Wakefield 可観測性 • JDK Mission Control • VisualVM GC • Shenandoah • ZGC 大型プロジェクト • Project Amber • Project Loom • Project Panama • Project Valhalla • Project Babylon New
  9. 各プロジェクトの紹介 14 大型プロジェクト Project Amber Java言語に新しい記法を導入 Project Loom 使いやすく、安全かつ軽量でス ループットが高い並行処理を導

    入 Project Panama Javaとその外部の間で、 データ共有と処理実行を安全に 行う仕組みを導入 Project Valhalla オブジェクト型の抽象化と プリミティブ型の性能特性を組 み合わる仕組みを導入 Project Babylon バイトコードを高級言語や 低水準言語に変換する仕組み を導入 var a = ArrayList(); x instanceof Integer i sealed class Shape permits Circle, Rectangle Job Scheduler OS Thread Java Thread Virtual Thread :スレッド x y x y x y 0 1 2 :アドレス 0 1 2 x y x y x y オブジェクトの配列 プリミティブの性能特性をもつ オブジェクトの配列 0 1 2 プリミティブの配列 CPU java Bytecode Class file Native code 別の環境 別の言語 変換 生成 読む java 読み書き Native API 呼び出し Native Memory
  10. Project Amber • ゴール ◦ Java言語の改革 ◦ 生産性を重視した小規模なJava言語機能を調査・改善 • スポンサー

    ◦ コンパイラ・グループ 15 Java SEの動向 概要 Project Amber: https://openjdk.org/projects/amber/ • 特徴 ◦ 少なくとも2回プレビュー ◦ JEPだけではなく、ガイドや設計メモが公開
  11. Project Amber 16 Java SEの動向 JEPs Project Amber: https://openjdk.org/projects/amber/ JEP番号

    名称 ステータス リリース 477 Implicitly Declared Classes and Instance main Methods (Third Preview) リリース待ち 23 476 Module Import Declarations (Preview) リリース待ち 23 468 Derived Record Creation (Preview) 候補 465 String Templates (Third Preview) クローズ/差し戻し 23 455 Primitive types in Patterns, instanceof, and switch (Preview) リリース待ち 23 463 Implicitly Declared Classes and Instance main Methods (2nd Preview) リリース済み 22 459 String Templates (Second Preview) リリース済み 22 456 Unnamed Variables and Patterns リリース済み 22 447 Statements before super(…) (Preview) リリース済み 22 445 Unnamed Classes and Instance main methods (Preview) リリース済み 21 443 Unnamed Patterns and Variables (Preview) リリース済み 21 441 Pattern Matching for switch リリース済み 21 440 Record Patterns リリース済み 21
  12. Project Amber 17 Java SEの動向 JEPs Project Amber: https://openjdk.org/projects/amber/ JEP番号

    名称 ステータス リリース 432 Record Patterns (Second Preview) リリース済み 20 433 Pattern Matching for switch (Fourth Preview) リリース済み 20 427 Pattern Matching for switch (Third Preview) リリース済み 19 405 Record Patterns (Preview) リリース済み 19 420 Pattern Matching for switch (Second Preview) リリース済み 18 409 Sealed Classes リリース済み 17 406 Pattern Matching for switch (Preview) リリース済み 17 395 Records リリース済み 16 394 Pattern Matching for instanceof リリース済み 16 397 Sealed Classes (Second Preview) リリース済み 16 378 Text Blocks リリース済み 15 384 Records (Second Preview) リリース済み 15 375 Pattern Matching for instanceof (Second Preview) リリース済み 15 360 Sealed Classes (Preview) リリース済み 15
  13. Project Amber 18 Java SEの動向 JEPs Project Amber: https://openjdk.org/projects/amber/ JEP番号

    名称 ステータス リリース 361 Switch Expressions リリース済み 14 368 Text Blocks (Second Preview) リリース済み 14 359 Records (Preview) リリース済み 14 305 Pattern Matching for instanceof (Preview) リリース済み 14 355 Text Blocks (Preview) リリース済み 13 354 Switch Expressions (Second Preview) リリース済み 13 325 Switch Expressions (Preview) リリース済み 12 323 Local-Variable Syntax for Lambda Parameters リリース済み 11 286 Local-Variable Type Inference リリース済み 10 302 Lambda Leftovers 候補 - 348 Java Compiler Intrinsics for JDK APIs 候補 - 301 Enhanced Enums クローズ/差し戻し - 326 Raw String Literals クローズ/差し戻し -
  14. Project Amber 19 Java SEの動向 改善ポイント Project Amber: https://openjdk.org/projects/amber/ Object

    o; System.out.println(switch (o) { case String s && s.length() >= 5 -> s.toUpperCase(); case String s -> " %s ".formatted(s); case Integer i -> "%,d".formatted(i); default -> o.toString(); } Pattern Matching for switch (Second Preview) public abstract sealed class Shape permits Circle, Rectangle, Square {...} Sealed Classes record Foo(int x, int y) {} Records if (x instanceof Integer i) { // ここで i を使用できる } Pattern Matching for instanceof var str = """ You can write two line string. """; Text Blocks int numLetters = switch (day) { case MONDAY, FRIDAY, SUNDAY -> 6; case TUESDAY -> 7; case THURSDAY, SATURDAY -> 8; case WEDNESDAY -> 9; }; Switch Expressions var a = "Foo"; Local-Variable Type Inference
  15. Project Valhalla 21 Java SEの動向 概要 Project Valhalla: https://openjdk.org/projects/valhalla/ •

    ゴール ◦ Javaのオブジェクトモデルを、値オブジェクトと ユーザー定義プリミティブで補強 ◦ オブジェクト指向プログラミングの抽象化と 単純なプリミティブの性能特性を組み合わせること • スポンサー ◦ HotSpotグループ • 特徴 ◦ ジェネリクスAPIによる性能向上を維持するために、 Javaの ジェネリクスへの変更で補完 ◦ 以前は Value Types と言ってたものが、 inline-types に名 前を変えた x y x y 0 1 2 x y :アドレス 0 1 2 0 1 2 x y x y x y 0 1 2 オブジェクトの配列 プリミティブの性能特性をもつ オブジェクトの配列 プリミティブの配列
  16. Project Valhalla 22 Java SEの動向 JEPs JEP番号 名称 ステータス リリース

    181 Nest-Based Access Control リリース済み 11 309 Dynamic Class-File Constants リリース済み 11 334 JVM Constants API リリース済み 12 371 Hidden Classes リリース済み 15 390 Warnings for Value-Based Classes リリース済み 16 401 Value Classes and Objects (Preview) 候補 - 402 Enhanced Primitive Boxing (Preview) 候補 - - Null-Restricted Value Class Types (Preview) 下書き - - - - - - - Project Valhalla: https://openjdk.org/projects/valhalla/
  17. Project Valhalla 23 Java SEの動向 改善ポイント Project Valhalla: https://openjdk.org/projects/valhalla/ primitive

    class Point implements Shape { private double x; private double y; public Point(double x, double y) { this.x = x; this.y = y; } public double x() { return x; } public double y() { return y; } public Point translate(double dx, double dy) { return new Point(x+dx, y+dy); } public boolean contains(Point p) { return equals(p); } } Primitive Classes jshell> synchronized (LocalDateTime.now()){} | 警告: | 値ベース・クラスのインスタンスで同期しようとしました | synchronized (LocalDateTime.now()){} | ^----------------------------------^ Warnings for Value-Based Classes 値ベースのクラス例 • java.langパッケージのプリミティブラッパークラス • java.lang.Runtime.Versionのクラス • java.utilパッケージの Optinal 関連のクラス • java.time API の日時関連のクラス • java.lang.ProcessHandle インターフェースとその実装クラス • java.util パッケージのコレクションクラスの実装クラス
  18. Project Loom 24 Java SEの動向 概要 Project Loom: https://openjdk.org/projects/loom/ •

    ゴール ◦ 使いやすく、高スループットの軽量並行処理や新しいプログ ラミングモデルをサポートすること • スポンサー ◦ HotSpotグループ • 特徴 ◦ 軽量なユーザモードスレッド ◦ 限定継続 ◦ 明示的な末尾呼び出し Job Scheduler OS Thread Java Thread Virtual Thread :スレッド
  19. Project Loom 25 Java SEの動向 JEPs Project Loom: https://openjdk.org/projects/loom/ JEP番号

    名称 ステータス リリース 480 Structured Concurrency (Third Preview) リリース済み 23 481 Scoped Values (Third Preview) リリース済み 23 462 Structured Concurrency (Second Preview) リリース済み 22 464 Scoped Values (Second Preview) リリース済み 22 444 Virtual Threads リリース済み 21 446 Scoped Values (Preview) リリース済み 21 453 Structured Concurrency (Preview) リリース済み 21 429 Scoped Values (Incubator) リリース済み 20 436 Virtual Threads (Second Preview) リリース済み 20 437 Structured Concurrency (Second Incubator) リリース済み 20 425 Virtual Threads (Preview) リリース済み 19 428 Structured Concurrency (Incubator) リリース済み 19
  20. Project Loom 26 Java SEの動向 改善ポイント Project Loom: https://openjdk.org/projects/loom/ Response

    handle() throws ExecutionException, InterruptedException { try (var scope = new StructuredTaskScope.ShutdownOnFailure()) { Future<String> user = scope.fork(() -> findUser()); Future<Integer> order = scope.fork(() -> fetchOrder()); scope.join(); // 両フォークが終了するのを待機します scope.throwIfFailed(); // エラーを伝播します // 両フォークが成功したら、その結果を返します。 return new Response(user.resultNow(), order.resultNow()); } } Structured Concurrency (Second Incubator) try (var executor = Executors.newVirtualThreadPerTaskExecutor()) { executor.submit(() -> { Thread.sleep(Duration.ofSeconds(1)); return i; }); } // executor.close() は暗黙的に呼ばれて、待ちます Virtual Threads (Second Preview) final static ScopedValue<String> sv = ScopedValue.newInstance(); public static void main(String[] args) { ScopedValue.where(sv, "TEST").run(()->output()); } private static void output(){ System.out.println(sv.get()); } Scoped Value (Incubator)
  21. Project Panama 27 Java SEの動向 概要 Project Panama: https://openjdk.org/projects/panama/ •

    ゴール ◦ Java仮想マシンと明確に定義された( Javaではない)外部 APIとの間の接続を改善 • スポンサー ◦ Hotspotグループ • 特徴 ◦ JVMからのネイティブ関数とデータの呼び出し ◦ JVMの新しいデータレイアウト、ネイティブ メタデータ ◦ ネイティブ・ライブラリ管理 ◦ ネイティブとJVM側の "フック" ◦ ネイティブ指向のJIT最適化 ◦ 安全性のためのツールやラッパー java 読み書き Native API 呼び出し Native Memory
  22. Project Panama 28 Java SEの動向 JEPs JEP番号 名称 ステータス リリース

    469 Vector API (Eighth Incubator) リリース済み 23 454 Foreign Function & Memory API リリース済み 22 460 Vector API (Seventh Incubator) リリース済み 22 442 Foreign Function & Memory API (Third Preview) リリース済み 21 448 Vector API (Sixth Incubator) リリース済み 21 434 Foreign Function & Memory API (Second Preview) リリース済み 20 424 Foreign Function & Memory API (Preview) リリース済み 19 426 Vector API (Fourth Incubator) リリース済み 19 419 Foreign Function & Memory API (Second Incubator) リリース済み 18 417 Vector API (Third Incubator) リリース済み 18 412 Foreign Function & Memory API (Incubator) リリース済み 17 414 Vector API (Second Incubator) リリース済み 17 389 Foreign Linker API (Incubator) リリース済み 16 338 Vector API (Incubator) リリース済み 16 393 Foreign-Memory Access API (Third Incubator) リリース済み 16 383 Foreign-Memory Access API (Second Incubator) リリース済み 15 370 Foreign-Memory Access API (Incubator) リリース済み 14 Project Panama: https://openjdk.org/projects/panama/
  23. Project Panama 29 Java SEの動向 改善ポイント Project Panama: https://openjdk.org/projects/panama/ static

    final VectorSpecies<Float> SPECIES = FloatVector.SPECIES_256; void vectorComputation(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i += SPECIES.length()) { VectorMask<Float> m = SPECIES.indexInRange(i, a.length); FloatVector va = FloatVector.fromArray(SPECIES, a, i, m); FloatVector vb = FloatVector.fromArray(SPECIES, b, i, m); FloatVector vc = va.mul(va). add(vb.mul(vb)). neg(); vc.intoArray(c, i, m); } } Vector API try (MemorySegment segment = MemorySegment.allocateNative(100)) { for (int i = 0 ; i < 25 ; i++) { MemoryAccess.setIntAtOffset(i * 4, i); } } Foreign Function & Memory API (Second Incubator)
  24. Project Babylon • ゴール ◦ Javaの範囲を外部のプログラミングモデルへ拡張 ▪ 外部プログラミングモデルとは以下 ▪ SQL、微分可能プログラミング、機械学習モデル、GPUなど

    ◦ リフレクションの拡張によって実現 • スポンサー ◦ コアライブラリ・グループ ◦ コンパイラ・グループ 31 Java SEの動向 概要 Project Babylon: https://openjdk.org/projects/babylon/ • 特徴 ◦ Javaコードを適切な形で参照/解析/変換できる ◦ 外部プログラミングモデルへの変換が容易になる ◦ つまり、JavaコードをGPUのモデルへ変換できる New CPU java Bytecode Class file Native code 別の環境 別の言語 変換 生成 読む
  25. 各プロジェクトの紹介 33 Java 仮想マシン Project Leyden Javaの起動時間の遅さと ピーク性能に達するまでの 時間の長さを改善 Project

    Lilliput オブジェクトが最低限必要とす るメモリサイズを小さくしメモリ 領域の使用効率向上とGCによ る停止時間を改善 Portola Project Javaを、Alpine Linuxとmusl C ライブラリに移植 Project CRaC Linux の Checkpoint/Restore In Userspace (CRIU) を使用し て、Javaを停止/再開する仕組 みを導入 フィールド 12-16 Byte フィールド 8 Byte (64bit) Class pointer, GC, Lock, Hashcode, Forwarding pointer java Linux CRIU Checkpoint / Restore Java musl libc Alpine Linux ByteCode CDS static archive AOT Cache Generate `static` CDS Training Run
  26. Project Leyden 34 Java SEの動向 概要 Project Leyden: https://openjdk.org/projects/leyden/ •

    ゴール ◦ Javaの起動時間とピーク性能までの時間の遅さを対処 ◦ フットプリントの大きさという長期的な問題点に対処 ◦ サイズや起動時間をネイティブ実行と遜色なくする ◦ GCやツールを全てサポート • スポンサー ◦ HotSpot と コアライブラリ・グループ • 特徴 ◦ 静的イメージの概念を導入 ◦ アプリケーションから静的イメージを作成 ◦ 静的イメージは実行時にクラスのロード /生成できない • 検証結果 ◦ テストアプリが893msから423msへ、2倍以上高速 Leyden Early Access Release https://github.com/openjdk/leyden/blob /leyden-ea1-release-notes/README.md ByteCode CDS static archive AOT Cache Generate `static` CDS Training Run
  27. Project Lilliput 35 Java SEの動向 概要 Project Lilliput: https://wiki.openjdk.org/display/lilliput 参考:https://fosdem.org/2024/events/attachments/fosdem-2024-3015-project-lilliput-compact-object-headers/slides/22142/Lilliput-FOSDEM2024_5vgVW4W.pdf

    • ゴール ◦ メモリフットプリントを削減し、パフォーマンス向上 • スポンサー ◦ HotSpotグループ • 最初の導入 ◦ OpenJDK 21 ▪ -XX:+UseCompactObjectHeaders ▪ -XX:LockingMode=2 • 特徴 ◦ オブジェクトヘッダを128ビットから64ビットへ縮小 ◦ 32ビットを目指せるかもしれない ◦ ヘッドレイアウトを柔軟にし、ビルド時や起動時にビットの使 い方を設定できるようにする • 検証結果 ◦ GCの総停止時間 30% 以上低下 ◦ CPU使用率 25%程度低下 ◦ レイテンシ 30%程度低下 フィールド 12-16 Byte フィールド 8 Byte (64bit) Class pointer, GC, Lock, Hashcode, Forwarding pointer
  28. Project Lilliput 36 Java SEの動向 動機 Project Lilliput: https://wiki.openjdk.org/display/lilliput 資料では1

    Word という単位がよく登場するが、 64 bit Hotspot では 1 Word = 64 bit = 8 Byte • 64bit HotspotではJavaオブジェクトは多目的ヘッダ(64bit)とクラスポインタ(64bit)を持つ • 典型的なオブジェクトの平均サイズ(ヘッダ含む)は 40~48Byte(内ヘッダは上記16Byte=128bit) • ヘッダを小さくすることで大規模なアプリも、コンテナなど小規模なアプリでも効率よくできる • 以下を実現可能にする ◦ ヒープ使用量の削減 ◦ オブジェクトの割り当て率の向上 ◦ GCの削減 ◦ CPUキャッシュの向上 通常のクラスヘッダ 配列のヘッダ
  29. Portola Project 37 Java SEの動向 概要 Portola Project: https://openjdk.org/projects/portola/ •

    ゴール ◦ Alpine Linux へのJDKの移植 特にmusl Cライブラリへの移植 • スポンサー ◦ Portersグループ • 特徴 ◦ 非常に軽量な Linux でも動くようにする ◦ コンテナなど軽量が好ましい技術と組み合わせやすい 解散! 2024年5月 Java 18にて導入完了 Java musl libc Alpine Linux
  30. CRaC Project 38 Java SEの動向 概要 CRaC Project: : https://wiki.openjdk.org/display/crac

    SnapStart で AWS Lambda 関数の Java コールドスタートを削減する • ゴール ◦ Javaプログラムの実行中にJavaインスタンスを チェックポイント (イメージ化やスナップショット) する仕組み で、Javaプログラムの連携を研究 • スポンサー ◦ HotSpot グループ • 特徴 ◦ 起動時の問題を解決するために、イメージから復元 ◦ 制約が多く、特定の環境下でのみ活用可能 java Linux CRIU Checkpoint / Restore
  31. Mission Control Project 40 Java SEの動向 概要 JDK Mission Control:

    https://openjdk.org/projects/jmc/ • ゴール ◦ OpenJDK および Oracle JDK 用のツール群で、本番環境 を対象としたプロファイリングと診断に焦点 • スポンサー ◦ HotSpotグループ • 特徴 ◦ JDK Flight Recorderが生成した記録を参照するために使 用されるクライアントツール ◦ JDK Mission Controlには、他にもJMXコンソールや HPROF-dumpアナライザーなどのツールも含まれる
  32. VisualVM Project 41 Java SEの動向 概要 VisualVM Project: https://openjdk.org/projects/visualvm/ •

    ゴール ◦ VisualVMを作成するプロジェクト • スポンサー ◦ JMXグループ • 特徴 ◦ Java 1.4から使える
  33. OpenJFX Project 43 Java SEの動向 概要 OpenJFX Project: https://openjdk.org/projects/openjfx/ •

    ゴール ◦ 次世代Javaクライアントツールキットを構築すること • スポンサー ◦ Swingグループ • 特徴 ◦ 現代的で効率的、そして完全な機能を備えたツールキットを 生み出す
  34. Wakefield 44 Java SEの動向 概要 Wakefield: https://openjdk.org/projects/wakefield/ • ゴール ◦

    Waylandディスプレイサーバーのサポートを実現する • スポンサー ◦ クライアント・ライブラリ・グループ • 特徴 ◦ Wayland上でX11互換モードでJDKを動作させるための短 中期的な解決策 ◦ WaylandのネイティブクライアントとしてJDKを動作させる ための中長期的な解決策
  35. Shenandoah 46 Java SEの動向 概要 Shenandoah: https://openjdk.org/projects/shenandoah/ • ゴール ◦

    超低休止時間で、実行中の業務処理と並行して多くの GC 作業を行うことで、GCによる休止時間を短縮 • スポンサー ◦ HotSpotグループ • JEP ◦ 189: Shenandoah GC • 特徴 ◦ オブジェクトの並行マーキングを行う CMSとG1に 加え、Shenandoahは並行コンパクションを追加 ◦ 休止時間はヒープサイズに正比例しない
  36. ZGC 47 Java SEの動向 概要 ZGC: https://openjdk.org/projects/zgc/ • ゴール ◦

    拡張性に富み、低遅延のGC • スポンサー ◦ HotSpotグループ • JEP ◦ 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental) ◦ 377: ZGC: A Scalable Low-Latency Garbage Collector (Production) ◦ 439: Generational ZGC • 特徴 ◦ 8MBから16TBのヒープを扱える ◦ 最大停止時間はms未満を目指す ◦ 並行処理、リージョンベース、コンパクティング、 NUMAを意 識、カラーポインタとロードバリアを利用
  37. 49 Red Hat is the world’s leading provider of enterprise

    open source software solutions. Award-winning support, training, and consulting services make Red Hat a trusted adviser to the Fortune 500. Thank you