Skip to content

[GR-52129] Extend javadoc and set driver memory limit. #8384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ public static void initializeAtRunTime(String... packages) {
/**
* Registers all classes in provided packages as eagerly initialized during image-build time.
* <p>
* Passing {@code ""} as a package, registers all packages and classes for initialization at
* build time. This might have unintended side-effects and should thus be used with great
* caution.
* <p>
* All static initializers of {@code classes} will be executed during image-build time and
* static fields that are assigned values will be available at runtime. {@code static final}
* fields will be considered as constant.
Expand Down
6 changes: 4 additions & 2 deletions substratevm/mx.substratevm/mx_substratevm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ def _native_image_launcher_extra_jvm_args():
Gets the extra JVM args needed for running com.oracle.svm.driver.NativeImage.
"""
# Support for running as Java module
res = []
res = [f'-XX:{max_heap_size_flag}']
if not mx_sdk_vm.jdk_enables_jvmci_by_default(get_jdk()):
res.extend(['-XX:+UnlockExperimentalVMOptions', '-XX:+EnableJVMCI'])
return res
Expand All @@ -1065,11 +1065,13 @@ def _native_image_launcher_extra_jvm_args():
'--link-at-build-time=com.oracle.svm.driver,com.oracle.svm.driver.metainf',
]

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={256 * 1024 * 1024}',
f'-R:{max_heap_size_flag}',
])

additional_ni_dependencies = []
Expand Down