From 6c406e37d8f0263cc4ad15e264ca75b3cce3bdb9 Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Fri, 15 Sep 2023 11:42:08 +0300 Subject: [PATCH] Set MaxRAM and MaxRAMPercentage in launcher for native-image driver Closes https://github.com/graalvm/mandrel/issues/557 --- build.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.java b/build.java index c9ee43d..4931c17 100644 --- a/build.java +++ b/build.java @@ -390,6 +390,8 @@ private static void patchNativeImageLauncher(Path nativeImage, String mandrelVer logger.debugf("launcherMatcher.group(1): %s", launcherMatcher.group(1)); logger.debugf("launcherMatcher.group(2): %s", launcherMatcher.group(2)); final String launcherLine = launcherMatcher.group(1) + + " -XX:MaxRAM=256m" + + " -XX:MaxRAMPercentage=80" + " -Dorg.graalvm.version=\"" + mandrelVersion + "\"" + " -Dorg.graalvm.vendorversion=\"Mandrel-" + mandrelVersion + "\"" + " -Dorg.graalvm.vendor=\"" + (vendor != null ? vendor : defaultVendor) + "\"" +