From ff471bbeec3e557c58503a85823d9fd38fbeaefc Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Mon, 19 Feb 2024 14:21:38 +0100 Subject: [PATCH] Align `MaxHeapSize` of native and bash drivers. --- substratevm/mx.substratevm/mx_substratevm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/substratevm/mx.substratevm/mx_substratevm.py b/substratevm/mx.substratevm/mx_substratevm.py index 942f35d80471c..c505d2c816ed0 100644 --- a/substratevm/mx.substratevm/mx_substratevm.py +++ b/substratevm/mx.substratevm/mx_substratevm.py @@ -1055,7 +1055,7 @@ def _native_image_launcher_extra_jvm_args(): """ # Support for running as Java module res = [ - f'-XX:MaxRAM={driver_max_memory_in_mb}m', '-XX:MaxRAMPercentage=80', + f'-XX:{max_heap_size_flag}', '-XX:MaxRAMPercentage=80', ] if not mx_sdk_vm.jdk_enables_jvmci_by_default(get_jdk()): res.extend(['-XX:+UnlockExperimentalVMOptions', '-XX:+EnableJVMCI']) @@ -1067,13 +1067,13 @@ def _native_image_launcher_extra_jvm_args(): '--link-at-build-time=com.oracle.svm.driver,com.oracle.svm.driver.metainf', ] -driver_max_memory_in_mb = 256 +max_heap_size_flag = f"MaxHeapSize={round(0.8 * 256 * 1024 * 1024)}" # 80% of 256MB driver_exe_build_args = driver_build_args + svm_experimental_options([ '-H:+AllowJRTFileSystem', '-H:IncludeResources=com/oracle/svm/driver/launcher/.*', '-H:-ParseRuntimeOptions', - f'-R:MaxHeapSize={driver_max_memory_in_mb * 1024 * 1024}', + f'-R:{max_heap_size_flag}', ]) additional_ni_dependencies = []