Skip to content

Commit

Permalink
Align MaxHeapSize of native and bash drivers.
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Feb 19, 2024
1 parent 83e92fd commit ff471bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions substratevm/mx.substratevm/mx_substratevm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand All @@ -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 = []
Expand Down

0 comments on commit ff471bb

Please sign in to comment.