Skip to content

Commit

Permalink
Set MaxRAM and MaxRAMPercentage in launcher for native-image driver
Browse files Browse the repository at this point in the history
See oracle#7277 (comment) for
motivation.

We have been using this as the default in Mandrel since the 23.1
release.
  • Loading branch information
zakkak committed Feb 13, 2024
1 parent 118d07e commit 67a3be2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sdk/mx.sdk/vm/launcher_template.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ for /f "delims=" %%i in ("%relcp:;=!newline!%") do (
)
)

set "jvm_args=-Dorg.graalvm.launcher.shell=true "-Dorg.graalvm.launcher.executablename=%executablename%""
set "jvm_args=-Dorg.graalvm.launcher.shell=true -XX:MaxRAM=256m -XX:MaxRAMPercentage=80 "-Dorg.graalvm.launcher.executablename=%executablename%""
set "launcher_args=<launcher_args>"

:: Check option-holding variables.
Expand Down
2 changes: 1 addition & 1 deletion sdk/mx.sdk/vm/launcher_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ for e in "${relative_cp[@]}"; do
absolute_cp+=("${location}/${e}")
done

jvm_args=("-Dorg.graalvm.launcher.shell=true" "-Dorg.graalvm.launcher.executablename=$0")
jvm_args=("-Dorg.graalvm.launcher.shell=true" "-XX:MaxRAM=256m" "-XX:MaxRAMPercentage=80" "-Dorg.graalvm.launcher.executablename=$0")
launcher_args=(<launcher_args>)

# Unfortunately, parsing of `--vm.*` arguments has to be done blind:
Expand Down

0 comments on commit 67a3be2

Please sign in to comment.