On Wed, 13 May 2026 00:15:14 GMT, Ioi Lam <[email protected]> wrote: > When running very small Java programs in the AOT training mode, the 3 lambda > expressions in ModuleBootstrap.java are evaluated. However, when running > without the AOT training mode, these lambda expressions are not evaluated. > > As a result, the AOT training mode captures a much large profile (due to the > complex implementation of the lambda framework). This causes the AOT cache of > very small Java programs to be much larger than necessary. > > The fix is to rewrite these 3 lambda expressions (streams) back to tradition > iterative code (contributed by @AlanBateman) > > Changes in ModuleBootstrap.java revealed a bug in > `AOTArtifactFinder::find_artifacts()`: some AOT-initialized classes may be > incorrectly excluded. > > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai).
This pull request has now been integrated. Changeset: a37b02ba Author: Ioi Lam <[email protected]> URL: https://git.openjdk.org/jdk/commit/a37b02baa220b4434b1fb59f123fd3f5ce97aab0 Stats: 36 lines in 2 files changed: 19 ins; 0 del; 17 mod 8381710: Avoid using lambdas in ModuleBootstrap in AOT training mode Co-authored-by: Alan Bateman <[email protected]> Reviewed-by: kvn, liach ------------- PR: https://git.openjdk.org/jdk/pull/31142
