apupier opened a new pull request, #30674:
URL: https://github.com/apache/camel/pull/30674

   ## Description
   
   The CI build of `camel-jbang-core` crashed a test fork (Camel Core build and 
test, main #2530):
   
   ```
   [ERROR] ExecutionException There was an error in the forked process
   [ERROR] java.lang.InternalError: java.lang.NoSuchMethodException: no such 
method: 
java.lang.invoke.MethodHandle.linkToStatic(long,long,Object,MemberName)Object/invokeStatic
   ...
   [ERROR] Caused by: java.lang.VirtualMachineError: Out of space in CodeCache 
for method handle intrinsic
   ```
   
   The log of that build also contains `CodeCache is full. Compiler has been 
disabled.`
   
   ### Cause
   
   CAMEL-26818 added `-XX:TieredStopAtLevel=1` (the C1 compiler only) to the 
test forks to use less CPU. With the C1 compiler only, the JVM does not use the 
segmented code cache and lowers `ReservedCodeCacheSize` from 240m to 48m 
(checked with `-XX:+PrintFlagsFinal` on JDK 25). The forks are reused 
(`reuseForks=true`, `forkCount=4`) and each runs a large share of the 3345 
tests, so a fork can fill 48m. When the JUnit launcher then links a lambda, the 
JVM cannot allocate the method handle stub and reports it as a missing method. 
It depends on which tests a fork gets and on the load of the machine, hence 
intermittent.
   
   ### Change
   
   Set `-XX:ReservedCodeCacheSize=240m` (the default with tiered compilation) 
next to `-XX:TieredStopAtLevel=1`. Only the reserved virtual size changes.
   
   ### Measurements
   
   The C1 option was added for speed, so I checked it still pays off. Full 
module (3345 tests, both surefire executions), 22 cores, idle machine, two runs 
each, with `-Dcamel.surefire.fork.additional-vmargs=...`:
   
   | Configuration | Wall time | CPU time (user) |
   |---|---|---|
   | current (`TieredStopAtLevel=1` + SerialGC) | 92.0s / 90.5s | 324s / 326s |
   | this change | 90.7s / 89.0s | 325s / 320s |
   | JVM defaults | 83.2s / 82.6s | 533s / 576s |
   
   The change costs nothing and C1 + SerialGC still uses about 40% less CPU 
than the defaults (the wall time is about 8% longer on an idle machine, which 
is the trade-off CAMEL-26818 chose for the shared CI machine). No `CodeCache is 
full` in any of the six runs, so the failure itself was not reproduced locally; 
the diagnosis relies on the CI log and the flag values above.
   
   Five tests (`CliHelpGoldenTest`, `RunExportGoldenTest`) failed in all runs, 
whatever the JVM options, so they are not related to this change.
   
   No test or documentation is added: this is a build property of the test 
forks.
   
   ---
   _Claude Code on behalf of apupier_ (AI-generated with IBM Bob 2.2.1)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to