[lworld] RFR: 8364107: [lworld] Revise memory limit in compiler/startup/StartupOutput.java

Christian Hagedorn chagedorn at openjdk.org
Mon Nov 24 09:09:52 UTC 2025


On Thu, 20 Nov 2025 08:43:58 GMT, Marc Chevalier <mchevalier at openjdk.org> wrote:

> Let's do a similar job as in https://github.com/openjdk/valhalla/pull/1509 and see what evolved since [JDK-8350209: Preserve adapters in AOT cache](https://bugs.openjdk.org/browse/JDK-8350209) landed in Valhalla.
> 
> For each tick in the list, I give a range that behaves homogeneously, and compare it to a Mainline and/or Valhalla range of https://github.com/openjdk/valhalla/pull/1509
> 
> - [4, 24] ~ Mainline [4, 28]
>   ```
>   # There is insufficient memory for the Java Runtime Environment to continue.
>   # Native memory allocation (malloc) failed to allocate 3000 bytes. Error detail: `CodeCache: no room for StubRoutines` (continuation stubs)
>   ```
> - [25, 28] ~ Mainline [29, 32] | Valhalla [29, 32]
>   `fatal error: Initial size of CodeCache is too small`
> - [29, 1164] ~ Mainline [33, 1112] | Valhalla [33, 1164]
>   ```
>   # There is insufficient memory for the Java Runtime Environment to continue.
>   # Native memory allocation (malloc) failed to allocate 1108928 bytes. Error detail: CodeCache: no room for Interpreter
>   ```
> - [1165, 1172] ~ Mainline [1117, 1128] | Valhalla [1165, 1172]
>   `fatal error: Initial size of CodeCache is too small`
> - [1173, 1176] ~ Valhalla [1225, 1228] (out of order, weird, uh!)
>   SIGSEGV in `CodeSection::emit_int8(unsigned char)`
> - [1177, 1224] ~ Mainline [1129, 1144] | Valhalla [1173, 1220]
>   `assert(_buffer != nullptr) failed: should be initialized`
> - [1225, 1228] ~ Mainline [1145, 1148] | Valhalla [1221, 1224]
>   `assert(_no_arg_handler != nullptr && _obj_arg_handler != nullptr && _int_arg_handler != nullptr && _obj_int_arg_handler != nullptr && _obj_obj_arg_handler != nullptr) failed: Initial adapter handlers must be properly created`
> - [1229, ~1250] ~ Mainline [1149, ~1700]
>   Often works, sometimes
>   ```
>   java.lang.OutOfMemoryError: Out of space in CodeCache for adapters
>   ```
> - [~1250, 1276]
>   Mostly works
> - [1277, 1432]
>   ```
>   java.lang.OutOfMemoryError: Out of space in CodeCache for adapters
>   ```
> - [1433, 1438] ~ Valhalla [1301, 1308]
>   ```
>   java.lang.InternalError: java.lang.NoSuchMethodException: no such method: java.lang.invoke.MethodHandle.linkToStatic(Object,Object,MemberName)Object/invokeStatic
>   Caused by: java.lang.NoSuchMethodException: no such method: java.lang.invoke.MethodHandle.linkToStatic(Object,Object,MemberName)Object/invokeStatic
>   ```
> - [1439, ~1600]
>   works but
>   ```
>   CodeCache is full. Compiler has been disabled.
>   ```
> - Above 1600, compiler shutdown starts to be rare, but again around 2800k Like it was for Valha...

Looks reasonable, thanks for the thorough analysis!

-------------

Marked as reviewed by chagedorn (Committer).

PR Review: https://git.openjdk.org/valhalla/pull/1749#pullrequestreview-3499118718


More information about the valhalla-dev mailing list