This is an automated email from the ASF dual-hosted git repository.

apupier pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new f4aaee8de26c CAMEL-26818: camel-jbang-core - set the code cache size 
of the test forks, as -XX:TieredStopAtLevel=1 shrinks it to 48m
f4aaee8de26c is described below

commit f4aaee8de26cefef57e9e36254215856d227d319
Author: AurĂ©lien Pupier <[email protected]>
AuthorDate: Mon Nov 23 16:33:20 2026 +0100

    CAMEL-26818: camel-jbang-core - set the code cache size of the test forks, 
as -XX:TieredStopAtLevel=1 shrinks it to 48m
    
    The test forks of camel-jbang-core run with -XX:TieredStopAtLevel=1 (the C1 
compiler only), added
    to use less CPU. With the C1 compiler only the JVM no longer uses the 
segmented code cache, and
    reduces 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 the 48m. The CI build then logged "CodeCache is full. 
Compiler has been
    disabled" and the JVM could not allocate the stub of a method handle when 
the JUnit launcher
    linked a lambda:
    
      java.lang.VirtualMachineError: Out of space in CodeCache for method 
handle intrinsic
      java.lang.NoSuchMethodError: 
java.lang.invoke.MethodHandle.linkToStatic(long, long, Object, MemberName)
      java.lang.InternalError: java.lang.NoSuchMethodException: no such method: 
...linkToStatic...
    
    Surefire reported "There was an error in the forked process" and the module 
failed. It depends
    on which tests a fork gets and on the load of the machine, so it is 
intermittent.
    
    Set -XX:ReservedCodeCacheSize=240m, the default of the tiered compilation, 
to keep the CPU saving
    of C1 and SerialGC without the risk.
    
    Measured on 22 cores, full module (3345 tests, both surefire executions), 
two runs each:
    
      configuration                        wall         CPU (user)
      current (C1 + SerialGC)              92.0s/90.5s  324s/326s
      with 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.
    
    Co-authored-by: IBM Bob 2.2.1 <[email protected]>
    Signed-off-by: AurĂ©lien Pupier <[email protected]>
---
 dsl/camel-jbang/camel-jbang-core/pom.xml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/dsl/camel-jbang/camel-jbang-core/pom.xml 
b/dsl/camel-jbang/camel-jbang-core/pom.xml
index f49bc368dae6..c077d26c09d4 100644
--- a/dsl/camel-jbang/camel-jbang-core/pom.xml
+++ b/dsl/camel-jbang/camel-jbang-core/pom.xml
@@ -47,8 +47,10 @@
         <camel.surefire.parallel>false</camel.surefire.parallel>
         <!-- the tests are short and start many CamelContexts: the C1 compiler 
only and the serial GC cost far less CPU
              than the defaults (about 30% less in total), which matters as the 
CI machine runs other modules at the
-             same time -->
-        <camel.surefire.fork.additional-vmargs>-XX:TieredStopAtLevel=1 
-XX:+UseSerialGC</camel.surefire.fork.additional-vmargs>
+             same time. With the C1 compiler only the JVM reserves a code 
cache of 48m instead of 240m, which the
+             reused forks can fill ("CodeCache is full", then "Out of space in 
CodeCache for method handle intrinsic"
+             and a crashed fork), so the default size is set explicitly -->
+        <camel.surefire.fork.additional-vmargs>-XX:TieredStopAtLevel=1 
-XX:ReservedCodeCacheSize=240m 
-XX:+UseSerialGC</camel.surefire.fork.additional-vmargs>
     </properties>
 
     <dependencies>

Reply via email to