Skip to content

Commit

Permalink
build: Fix native-image args
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospereira committed Nov 28, 2023
1 parent 1e3cb22 commit cd49459
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -129,21 +129,22 @@ graalvmNative {
fallback.set(false)
richOutput.set(true)
buildArgs.addAll("--verbose", "-march=native")
buildArgs.addAll("--gc=G1", "-XX:MaxRAMPercentage=100")
buildArgs.addAll("--gc=G1")
jvmArgs.add("-XX:MaxRAMPercentage=100")
if (ci) {
// A little extra verbose on CI to prevent jobs being killed
// due to the lack of output (since native-image creation can
// take a long time to complete).
jvmArgs.add("-Xlog:gc*")
// 7GB is what is available when using Github-hosted runners:
// https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
buildArgs.addAll("-J-Xmx7G")
jvmArgs.addAll("-Xmx7G")
} else {
// `gc` is less verbose than `gc*`, and good enough for local builds.
jvmArgs.add("-Xlog:gc")
// 16G is a good chunk of memory, but reducing GC speeds up
// the native image generation.
buildArgs.addAll("-J-Xmx16G")
jvmArgs.addAll("-Xmx16G")
}
}
}
Expand Down

0 comments on commit cd49459

Please sign in to comment.