diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd0e3f95..8776f75d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,6 +56,9 @@ jobs: runs-on: ubuntu-latest + env: + SBT_OPTS: "-Xms2048m -Xmx2048m -XX:+AlwaysPreTouch -XX:ReservedCodeCacheSize=128M -XX:MaxMetaspaceSize=512M -Xss2m -XX:+TieredCompilation -XX:+UseParallelGC" + steps: - uses: actions/checkout@v4 @@ -126,6 +129,7 @@ jobs: env: CI: true + SBT_OPTS: "-Xms1024m -Xmx1024m -XX:+AlwaysPreTouch -XX:ReservedCodeCacheSize=128M -XX:MaxMetaspaceSize=512M -Xss2m -XX:+TieredCompilation -XX:+UseParallelGC" steps: - uses: actions/checkout@v4 @@ -138,8 +142,8 @@ jobs: - uses: graalvm/setup-graalvm@v1 with: - version: '22.3.1' java-version: '17' + distribution: 'graalvm' components: 'native-image' github-token: ${{ secrets.GITHUB_TOKEN }} native-image-job-reports: 'true' diff --git a/backend/.sbtopts b/backend/.sbtopts index e5e59b89..3b630f6a 100644 --- a/backend/.sbtopts +++ b/backend/.sbtopts @@ -1,9 +1 @@ --J-Xms1536m --J-Xmx1536m --J-XX:+AlwaysPreTouch --J-XX:ReservedCodeCacheSize=128M --J-XX:MaxMetaspaceSize=512M --J-Xss2m --J-XX:+TieredCompilation --J-XX:+UseParallelGC -Dsbt.io.implicit.relative.glob.conversion=allow diff --git a/backend/build.sbt b/backend/build.sbt index f180f9a9..a81df776 100644 --- a/backend/build.sbt +++ b/backend/build.sbt @@ -143,9 +143,11 @@ lazy val `mockingbird-native` = (project in file("mockingbird-native")) Compile / run / mainClass := Some("ru.tinkoff.tcb.mockingbird.Mockingbird"), Compile / packageDoc / mappings := Seq(), GraalVMNativeImage / mainClass := Some("ru.tinkoff.tcb.mockingbird.Mockingbird"), - GraalVMNativeImage / graalVMNativeImageOptions ++= Seq("-H:+StaticExecutableWithDynamicLibC").filter(_ => - dockerize.value - ), + GraalVMNativeImage / graalVMNativeImageOptions ++= Seq( + "-J-Xmx5632m", // Required to fit native-image runtime heap in Standard GitHub-hosted runners + "-H:+StaticExecutableWithDynamicLibC", + "--gc=G1" + ).filter(_ => dockerize.value), nativeImageInstalled := true, nativeImageAgentMerge := true, run / javaOptions += "-Dconfig.resource=local.conf", diff --git a/backend/mockingbird-native/src/main/resources/META-INF/native-image/ru.tinkoff.tcb/mockingbird/native-image.properties b/backend/mockingbird-native/src/main/resources/META-INF/native-image/ru.tinkoff.tcb/mockingbird/native-image.properties index 7eddc68a..db126c40 100644 --- a/backend/mockingbird-native/src/main/resources/META-INF/native-image/ru.tinkoff.tcb/mockingbird/native-image.properties +++ b/backend/mockingbird-native/src/main/resources/META-INF/native-image/ru.tinkoff.tcb/mockingbird/native-image.properties @@ -1,4 +1,5 @@ Args = -H:+AddAllCharsets \ +-H:+BuildReport \ --no-fallback \ --initialize-at-run-time=io.netty.bootstrap.Bootstrap,\ io.netty.bootstrap.ServerBootstrap,\