diff --git a/test-framework/maven/src/main/java/io/quarkus/maven/it/RunAndCheckMojoTestBase.java b/test-framework/maven/src/main/java/io/quarkus/maven/it/RunAndCheckMojoTestBase.java index 5ea0c98be1315..810d934b13852 100644 --- a/test-framework/maven/src/main/java/io/quarkus/maven/it/RunAndCheckMojoTestBase.java +++ b/test-framework/maven/src/main/java/io/quarkus/maven/it/RunAndCheckMojoTestBase.java @@ -25,6 +25,7 @@ public class RunAndCheckMojoTestBase extends MojoTestBase { protected File testDir; protected DevModeClient devModeClient = new DevModeClient(getPort()); private static final int DEFAULT_PORT = 8080; + private static final int DEFAULT_MEMORY_IN_MB = 128; /** * Default to port 8080, but allow subtests to override. @@ -33,6 +34,14 @@ protected int getPort() { return DEFAULT_PORT; } + /** + * Default to quite constrained memory, but allow subclasses to override, for hungrier tests. + */ + + protected int getAllowedHeapInMb() { + return DEFAULT_MEMORY_IN_MB; + } + @AfterEach public void cleanup() { shutdownTheApp(); @@ -101,7 +110,7 @@ protected void run(boolean performCompile, LaunchMode mode, boolean skipAnalytic //running at once, if they add default to 75% of total mem we can easily run out //of physical memory as they will consume way more than what they need instead of //just running GC - args.add("-Djvm.args=-Xmx128m"); + args.add("-Djvm.args=-Xmx" + getAllowedHeapInMb() + "m"); running.execute(args, Map.of()); }