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

OpenJDKエコシステムと開発中の機能を紹介 2025夏版

OpenJDKエコシステムと開発中の機能を紹介 2025夏版

Avatar for Chihiro Ito

Chihiro Ito

June 07, 2025
Tweet

More Decks by Chihiro Ito

Other Decks in Technology

Transcript

  1. ▸ Javaの仕様 ▸ ここ数年の進化 ▸ Javaのプロジェクト ・ 大型プロジェクト ・ Java仮想マシン

    ・ 可観測性 ・ ユーザインターフェース ・ ガベージ・コレクション 4 目次
  2. Javaの仕様 5 Java SEの動向 Javaのバージョンの推移 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 9/16 リリース
  3. Javaの仕様 • Java 言語仕様 (JLS) • Java 仮想マシン仕様 (JVMS) •

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

    Java SEの動向 実装の種類 OpenJDK OpenJ9 GraalVM 実装
  5. Javaを提供しているベンダー 8 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
  6. ここ数年の進化 10 Java SEの動向 Java 11 ~ 17 • 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 17 • 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
  7. ここ数年の進化 11 Java SEの動向 Java 18~21 18 19 • 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) 21 • 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)
  8. ここ数年の進化 12 Java SEの動向 Java 22~25 22 23 • 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 • 470: PEM Encodings of Cryptographic Objects (Preview) • 502: Stable Values (Preview) • 503: Remove the 32-bit x86 Port • 505: Structured Concurrency (Fifth Preview) • 506: Scoped Values • 507: Primitive Types in Patterns, instanceof, and switch (Third Preview) • 508: Vector API (Tenth Incubator) • 509: JFR CPU-Time Profiling (Experimental) • 510: Key Derivation Function API • 511: Module Import Declarations • 512: Compact Source Files and Instance Main Methods • 513: Flexible Constructor Bodies • 514: Ahead-of-Time Command-Line Ergonomics • 515: Ahead-of-Time Method Profiling • 518: JFR Cooperative Sampling • 519: Compact Object Headers • 520: JFR Method Timing & Tracing • 521: Generational Shenandoah 25
  9. Javaのプロジェクト 14 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
  10. 各プロジェクトの紹介 17 大型プロジェクト Project Amber Java言語に新しい記法を導入 Project Loom 使いやすく、安全かつ軽量でス ループットが高い並行処理を導

    入 Project Panama Javaとその外部の間で、 データ共有と処理実行を安全に 行う仕組みを導入 Project Valhalla オブジェクト型の抽象化と プリミティブ型の性能特性を組 み合わる仕組みを導入 Project Babylon バイトコードを高級言語や 低水準言語に変換する仕組み を導入 x instanceof Integer i var a = new ArrayList(); 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
  11. Project Amber • ゴール ◦ Java言語の改革 ◦ 生産性を重視した小規模なJava言語機能を調査・改善 • スポンサー

    ◦ コンパイラ・グループ 18 Java SEの動向 概要 Project Amber: https://openjdk.org/projects/amber/ • 特徴 ◦ 少なくとも2回プレビュー ◦ JEPだけではなく、ガイドや設計メモが公開 var a = new ArrayList(); x instanceof Integer i sealed class Shape permits Circle, Rectangle
  12. Project Amber 19 Java SEの動向 JEPs Project Amber: https://openjdk.org/projects/amber/ JEP番号

    名称 ステータス リリース 468 Derived Record Creation (Preview) 候補 513 Flexible Constructor Bodies 512 Compact Source Files and Instance Main Methods 511 Module Import Declarations 507 Primitive Types in Patterns, instanceof, and switch (Third Preview) 495 Simple Source Files and Instance Main Methods (Fourth Preview) リリース済み 24 494 Module Import Declarations (Second Preview) リリース済み 24 492 Flexible Constructor Bodies (Third Preview) リリース済み 24 488 Primitive Types in Patterns, instanceof, and switch (Second Preview) リリース済み 24
  13. Project Amber 20 Java SEの動向 JEPs Project Amber: https://openjdk.org/projects/amber/ JEP番号

    名称 ステータス リリース 482 Flexible Constructor Bodies (Second Preview) リリース済み 23 477 Implicitly Declared Classes and Instance main Methods (Third Preview) リリース済み 23 476 Module Import Declarations (Preview) リリース済み 23 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 458 Launch Multi-File Source-Code Programs リリース済み 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
  14. Project Amber 21 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
  15. Project Amber 22 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 クローズ/差し戻し -
  16. Project Amber 23 Java SEの動向 改善ポイント Project Amber: https://openjdk.org/projects/amber/ String

    r = switch (string) { case String s when s.length() > 4 -> "..."; case String s -> s; case null -> "null"; default -> "not String"; }; Pattern Matching for switch public sealed class Shape permits Circle, Rectangle, Square { // Shapeの実装 } Sealed Classes record Foo(int x, int y) {} Records if (x instanceof Integer i) { // ここで i を使用できる System.out.println(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
  17. Project Amber 24 Java SEの動向 改善ポイント Project Amber: https://openjdk.org/projects/amber/ String

    s = switch (obj) { case 0 -> "OK"; case int i when i >= 100 -> "Warning"; case int _ -> "Unknown"; }; Primitive Types in Patterns, instanceof, and switch (Second Preview) public Employee(int age) { if (age < 18 || age > 67) throw new IllegalArgumentException(); // super()/this()の前に処理が実行できる super(age); } Flexible Constructor Bodies void main() { IO.println("Hello, World!"); } Simple Source Files and Instance Main Methods import module java.base; Module Import Declarations if (obj instanceof Point(int x, int _)) { System.out.println(x); } Unnamed Variables and Patterns if (obj instanceof Point(int x, int y)) { System.out.println(x+y); } Record Patterns
  18. Project Valhalla 25 Java SEの動向 概要 Project Valhalla: https://openjdk.org/projects/valhalla/ •

    ゴール ◦ Javaオブジェクトモデルを値オブジェクトで補強 ◦ オブジェクト指向プログラミングの抽象化と プリミティブ型の性能特性を組み合わせる • スポンサー ◦ HotSpotグループ • 特徴 ◦ ID を持たないオブジェクトを導入 ◦ NULL を意識した型の言語サポートと、 NULL 制限の実行 時の強制 ◦ プリミティブをオブジェクトのように扱えるように x y x y 0 1 2 x y :アドレス 0 1 2 0 1 2 x y x y x y 0 1 2 オブジェクトの配列 プリミティブの性能特性をもつ オブジェクトの配列 プリミティブの配列
  19. Project Valhalla 26 Java SEの動向 JEPs JEP番号 名称 ステータス リリース

    - Null-Restricted Value Class Types (Preview) 下書き - 401 Value Classes and Objects (Preview) 下書き - 402 Enhanced Primitive Boxing (Preview) 下書き - 390 Warnings for Value-Based Classes リリース済み 16 371 Hidden Classes リリース済み 15 334 JVM Constants API リリース済み 12 309 Dynamic Class-File Constants リリース済み 11 181 Nest-Based Access Control リリース済み 11 - Project Valhalla: https://openjdk.org/projects/valhalla/
  20. Project Valhalla 27 Java SEの動向 いま目に見える変化 Project Valhalla: https://openjdk.org/projects/valhalla/ 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 パッケージのコレクションクラスの実装クラス
  21. Project Valhalla 28 Java SEの動向 改善ポイント Project Valhalla: https://openjdk.org/projects/valhalla/ Value

    class は Valhalla の Early access build で試せます https://jdk.java.net/valhalla/ value class Point { 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 static void main(String[] args) { Point p1 = new Point(0, 0); Point p2 = new Point(0, 0); // これまでのクラスでは次の処理は false になる System.out.println("(p1 == p2) = " + (p1==p2)); } Value Classes and Objects (Preview) int i = 12; int iSize = i.SIZE; double iAsDouble = i.doubleValue(); Supplier<String> iSupp = i::toString; Enhanced Primitive Boxing (Preview) Point! p1 //nullにならない Draft : Null-Restricted Value Class Types (Preview)
  22. Project Loom 29 Java SEの動向 概要 Project Loom: https://openjdk.org/projects/loom/ •

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

    名称 ステータス リリース 506 Scoped Values 25 505 Structured Concurrency (Fifth Preview) 25
  24. Project Loom 31 Java SEの動向 JEPs Project Loom: https://openjdk.org/projects/loom/ JEP番号

    名称 ステータス リリース 499 Structured Concurrency (Forth Preview) リリース済み 24 487 Scoped Values (Fourth Preview) リリース済み 24 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
  25. Project Loom 32 Java SEの動向 改善ポイント Project Loom: https://openjdk.org/projects/loom/ try(StructuredTaskScope

    scope = StructuredTaskScope.open()){ Subtask<String> fork1 = scope.fork(new MyTask1()); Subtask<Void> _ = scope.fork(new MyTask2()); scope.join(); System.out.println(fork1.get()); } catch (InterruptedException e ) { throw new RuntimeException( e); } Structured Concurrency (fifth preview) try (var executor = Executors.newVirtualThreadPerTaskExecutor()) { IntStream.range(0, 10).forEach( i -> executor.submit(new MyIoTask()) ); } // executor.close() は暗黙的に呼ばれて、待ちます Virtual Threads final static ScopedValue<String> LOCAL = ScopedValue.newInstance(); public static void main(String[] args) { ScopedValue.where(LOCAL, "TEST").run(()->output()); } private static void output(){ System.out.println(LOCAL.get()); } Scoped Value
  26. Project Panama 33 Java SEの動向 概要 Project Panama: https://openjdk.org/projects/panama/ •

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

    508 Vector API (Tenth Incubator) リリース済み 25 489 Vector API (Nineth Incubator) リリース済み 24 469 Vector API (Eighth Incubator) リリース済み 23 454 Foreign Function & Memory API リリース済み 22 460 Vector API (Seventh Incubator) リリース済み 22 Project Panama: https://openjdk.org/projects/panama/
  28. Project Panama 35 Java SEの動向 JEPs JEP番号 名称 ステータス リリース

    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/
  29. Project Panama 36 Java SEの動向 改善ポイント Project Panama: https://openjdk.org/projects/panama/ static

    final VectorSpecies<Float> SPECIES = FloatVector.SPECIES_PREFERRED; static void vectorComputation (float[] a, float[] b, float[] c) { int i = 0; int upperBound = SPECIES.loopBound(a.length); for (; i < upperBound; i += SPECIES.length()) { // FloatVector va, vb, vc; var va = FloatVector.fromArray(SPECIES, a, i); var vb = FloatVector.fromArray(SPECIES, b, i); var vc = va.mul(va) . add(vb.mul(vb)) . neg(); vc.intoArray(c, i); } for (; i < a.length; i++) { c[i] = (a[i] * a[i] + b[i] * b[i]) * -1.0f; } } Vector API Foreign Function & Memory API Linker linker = Linker.nativeLinker(); MethodHandle strlen = linker.downcallHandle( linker.defaultLookup().find("strlen").get(), FunctionDescriptor.of(JAVA_LONG, ADDRESS) ); try (Arena arena = Arena.ofConfined()) { MemorySegment str = arena.allocateFrom("Hello"); long len = (long)strlen.invoke(str); System.out.println(len); }
  30. Project Babylon • ゴール ◦ Javaの範囲を外部のプログラミングモデルへ拡張 ▪ 外部プログラミングモデルとは以下 ▪ SQL、微分可能プログラミング、機械学習モデル、GPUなど

    ◦ リフレクションの拡張によって実現 • スポンサー ◦ コアライブラリ・グループ ◦ コンパイラ・グループ 37 Java SEの動向 概要 Project Babylon: https://openjdk.org/projects/babylon/ • 特徴 ◦ Javaコードを適切な形で参照/解析/変換できる ◦ 外部プログラミングモデルへの変換が容易になる ◦ つまり、JavaコードをGPUのモデルへ変換できる New CPU java Bytecode Class file Native code 別の環境 別の言語 変換 生成 読む
  31. 各プロジェクトの紹介 39 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
  32. Project Leyden 40 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
  33. Project Leyden 41 Java SEの動向 JEPs Project Loom: https://openjdk.org/projects/loom/ JEP番号

    名称 ステータス リリース Ahead-of-Time Code Compilation Draft 24 515 Ahead-of-Time Method Profiling Proposed to Target 25 514 Ahead-of-Time Command-Line Ergonomics Proposed to Target 25 483 Ahead-of-Time Class Loading & Linking Closed / Delivered 24
  34. Project Leyden 42 Java SEの動向 トレーニングによってキャッシュを作成し、実行時にそれを読み込むことでロード時間を短縮 Project Leyden: https://openjdk.org/projects/leyden/ ByteCode

    CDS static archive AOT Cache Generate `static` CDS Training Run これまで Leyden プロセス ファイル Run ByteCode 初期化処理の中で、クラスローディングが 占める割合が大きいと、効果が大きい
  35. Project Lilliput 43 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グループ • オプションを2つ指定 ◦ -XX:+UnlockExperimentalVMOptions(24まで) ◦ -XX:+UseCompactObjectHeaders • JEP ◦ 450: Compact Object Headers (Experimental) ◦ 519: Compact Object Headers • 特徴 ◦ オブジェクトヘッダを128ビットから64ビットへ縮小 ◦ 32ビットを目指せるかもしれない ◦ ヘッドレイアウトを柔軟にし、ビルド時や起動時にビットの使 い方を設定できるようにする • 検証結果 ◦ GCの総停止時間 30% 以上低下 ◦ CPU使用率 25%程度低下 ◦ レイテンシ 30%程度低下 128 bit フィールド 64 bit フィールド
  36. Project Lilliput 44 Java SEの動向 動機 Project Lilliput: https://wiki.openjdk.org/display/lilliput 資料では1

    Word という単位がよく登場するが、 64 bit Hotspot では 1 Word = 64 bit = 8 Byte ヘッダはClass pointer, GC, Lock, Hashcode, Forwarding pointerなどを含みます。 • 64bit HotspotではJavaオブジェクトは多目的ヘッダ(64bit)とクラスポインタ(64bit)を持つ • 典型的なオブジェクトの平均サイズ(ヘッダ含む)は 40~48Byte(内ヘッダは上記16Byte=128bit) • ヘッダを小さくすることで大規模なアプリも、コンテナなど小規模なアプリでも効率よくできる • 以下を実現可能にする ◦ ヒープ使用量の削減 ◦ オブジェクトの割り当て率の向上 ◦ GCの削減 ◦ CPUキャッシュの向上 良くあるオブジェクトの例 16 Byte (128bit) 24 Byte (192bit) Header 8 Byte (64bit) これまで (40Byte) これまで (32Byte) 全体で20%削減!
  37. Portola Project 45 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
  38. CRaC Project 46 Java SEの動向 概要 CRaC Project: : https://wiki.openjdk.org/display/crac

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

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

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

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

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

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

    拡張性に富み、低遅延のGC • スポンサー ◦ HotSpotグループ • JEP ◦ 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental) ◦ 351: ZGC: Uncommit Unused Memory ◦ 364/365: ZGC on macOS/Windows ◦ 377: ZGC: A Scalable Low-Latency Garbage Collector (Production) ◦ 376: ZGC: Concurrent Thread-Stack Processing ◦ 439: Generational ZGC ◦ 474: ZGC: Generational Mode by Default ◦ 490: ZGC: Remove the Non-Generational Mode • 特徴 ◦ 8MBから16TBのヒープを扱える ◦ 最大停止時間はms未満を目指す ◦ 並行処理、リージョンベース、コンパクティング、 NUMAを意 識、カラーポインタとロードバリアを利用
  45. 57 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