Since I upgrade the project in 2.7 I get a build error for my app.
“cannot allocate memory”
I already modify the line in error in my Dockerfile to 8192m but I always have the cannot allocate memory.
RUN NODE_OPTIONS="–max-old-space-size=8192" gradle -Pvaadin.productionMode=true -Dorg.gradle.jvmargs=-Xmx8192m --build-cache --no-daemon --init-script=init.gradle vaadinClean clean bootJar
Log
#5 [build 5/6] RUN NODE_OPTIONS="--max-old-space-size=8192" gradle -Pvaadin...
#5 4.382
#5 4.382 Welcome to Gradle 8.12.1!
#5 4.382
#5 4.382 Here are the highlights of this release:
#5 4.382 - Enhanced error and warning reporting with the Problems API
#5 4.383 - File-system watching support on Alpine Linux
#5 4.383 - Build and test Swift 6 libraries and apps
#5 4.383
#5 4.383 For more details see https://docs.gradle.org/8.12.1/release-notes.html
#5 4.383
#5 4.580 To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/8.12.1/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
#5 6.080 Daemon will be stopped at the end of the build
#5 602.5 > Task :clean UP-TO-DATE
#5 619.0 > Task :vaadinClean
#5 619.0 > Task :bootBuildInfo
#5 619.0 > Task :checkKotlinGradlePluginConfigurationErrors
#5 649.0 > Task :compileKotlin
#5 667.6 > Task :vaadinPrepareFrontend
#5 672.0 > Task :processResources
#5 672.0 > Task :hillaConfigure
#5 672.1
#5 672.1 > Task :compileKotlin
#5 672.1 Enhancing entities in root project 'bac' for source set 'main'
#5 672.3 Project entities:
#5 672.3 JPA: [];
#5 672.3 DTO: [];
#5 672.3 Project converters: [].
#5 687.1 Running EclipseLink enhancer in root project 'bac' for source set 'main'
#5 690.4 Running Jmix enhancer in root project 'bac' for source set 'main'
#5 691.3
#5 691.3 > Task :compileJava NO-SOURCE
#5 691.3 > Task :classes
#5 721.3 > Task :vaadinBuildFrontend
#5 780.0 Use the './' prefix for files in the '/usr/src/app/bac/./src/main/frontend' folder: 'generated/jar-resources/theme/lumo/checkbox/jmix-switch-styles.js', please update your annotations.
#5 914.7 The message received from the daemon indicates that the daemon has disappeared.
#5 914.7 Build request sent: Build{id=dd46114f-d839-4a0f-9cc9-0431bd3263be, currentDir=/usr/src/app/bac}
#5 914.7 Attempting to read last messages from the daemon log...
#5 914.7
#5 914.9 Daemon pid: 44
#5 914.9 log file: /usr/src/app/bac/.gradle/daemon/8.12.1/daemon-44.out.log
#5 914.9 ----- Last 20 lines from daemon log file - daemon-44.out.log -----
#5 914.9 2025-11-04T11:10:03.449+0000 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.
#5 914.9 2025-11-04T11:10:03.450+0000 [INFO] [org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy] Daemon is about to start building Build{id=dd46114f-d839-4a0f-9cc9-0431bd3263be, currentDir=/usr/src/app/bac}. Dispatching build started information...
#5 914.9 2025-11-04T11:10:03.451+0000 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 22: dispatching org.gradle.launcher.daemon.protocol.BuildStarted@5fa86780
#5 914.9 2025-11-04T11:10:03.453+0000 [DEBUG] [org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment] Configuring env variables: [NEXUS_ADMIN_USER, PATH, LANGUAGE, GRADLE_VERSION, JAVA_HOME, NODE_OPTIONS, LANG, GRADLE_HOME, NEXUS_ADMIN_PASSWORD, GRADLE_USER_HOME, LC_ALL, LD_LIBRARY_PATH, PWD, JAVA_VERSION, HOME, SHLVL]
#5 914.9 2025-11-04T11:10:03.459+0000 [DEBUG] [org.gradle.launcher.daemon.server.exec.LogToClient] About to start relaying all logs to the client via the connection.
#5 914.9 2025-11-04T11:10:03.460+0000 [INFO] [org.gradle.launcher.daemon.server.exec.LogToClient] The client will now receive all logging from the daemon (pid: 44). The daemon log file: /usr/src/app/bac/.gradle/daemon/8.12.1/daemon-44.out.log
#5 914.9 2025-11-04T11:10:03.462+0000 [DEBUG] [org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon] Requesting daemon stop after processing Build{id=dd46114f-d839-4a0f-9cc9-0431bd3263be, currentDir=/usr/src/app/bac}
#5 914.9 2025-11-04T11:10:03.463+0000 [LIFECYCLE] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] Daemon will be stopped at the end of the build
#5 914.9 2025-11-04T11:10:03.464+0000 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] Stop as soon as idle requested. The daemon is busy
#5 914.9 2025-11-04T11:10:03.464+0000 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon stop has been requested. Sleeping until state changes.
#5 914.9 2025-11-04T11:10:03.465+0000 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] The daemon has started executing the build.
#5 914.9 2025-11-04T11:10:03.466+0000 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] Executing build with daemon context: DefaultDaemonContext[uid=99d88775-8519-4240-83c8-dcc98143a618,javaHome=/opt/java/openjdk,javaVersion=17,javaVendor=Eclipse Adoptium,daemonRegistryDir=/usr/src/app/bac/.gradle/daemon,pid=44,idleTimeout=120000,priority=NORMAL,applyInstrumentationAgent=true,nativeServicesMode=ENABLED,daemonOpts=-Xmx8192m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
#5 914.9 Enhancing entities in root project 'bac' for source set 'main'
#5 914.9 Project entities:
#5 914.9 JPA: [];
#5 914.9 DTO: [];
#5 914.9 Project converters: [].
#5 914.9 Running EclipseLink enhancer in root project 'bac' for source set 'main'
#5 914.9 Running Jmix enhancer in root project 'bac' for source set 'main'
#5 914.9 Use the './' prefix for files in the '/usr/src/app/bac/./src/main/frontend' folder: 'generated/jar-resources/theme/lumo/checkbox/jmix-switch-styles.js', please update your annotations.----- End of the daemon log -----
#5 914.9
#5 915.1
#5 915.1 FAILURE: Build failed with an exception.
#5 915.1
#5 915.1 * What went wrong:
#5 915.1 Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
#5 915.1
#5 915.1 * Try:
#5 915.1 > Run with --stacktrace option to get the stack trace.
#5 915.1 > Run with --info or --debug option to get more log output.
#5 915.1 > Run with --scan to get full insights.
#5 915.1 > Get more help at https://help.gradle.org.
#5 ERROR: process "/bin/sh -c NODE_OPTIONS=\"--max-old-space-size=8192\" gradle -Pvaadin.productionMode=true -Dorg.gradle.jvmargs=-Xmx8192m --build-cache --no-daemon --init-script=init.gradle vaadinClean clean bootJar" did not complete successfully: cannot allocate memory
------
> [build 5/6] RUN NODE_OPTIONS="--max-old-space-size=8192" gradle -Pvaadin.productionMode=true -Dorg.gradle.jvmargs=-Xmx8192m --build-cache --no-daemon --init-script=init.gradle vaadinClean clean bootJar:
------
process "/bin/sh -c NODE_OPTIONS=\"--max-old-space-size=8192\" gradle -Pvaadin.productionMode=true -Dorg.gradle.jvmargs=-Xmx8192m --build-cache --no-daemon --init-script=init.gradle vaadinClean clean bootJar" did not complete successfully: cannot allocate memory
Cleaning up project directory and file based variables
00:08
ERROR: Job failed: exit code 1
Dockerfile
# Build and run app
FROM gradle:8.12.1-jdk17-alpine AS build
ARG NEXUS_ADMIN_USER
ARG NEXUS_ADMIN_PASSWORD
ENV GRADLE_USER_HOME=/usr/src/app/bac/.gradle
COPY . /usr/src/app/bac/
COPY ./init.gradle ./init.gradle
WORKDIR /usr/src/app/bac/
RUN NODE_OPTIONS="--max-old-space-size=8192" gradle -Pvaadin.productionMode=true -Dorg.gradle.jvmargs=-Xmx8192m --build-cache --no-daemon --init-script=init.gradle vaadinClean clean bootJar
RUN rm ./init.gradle
FROM bellsoft/liberica-openjdk-alpine-musl:17-cds
RUN apk add --no-cache msttcorefonts-installer fontconfig font-carlito libreoffice
RUN update-ms-fonts
ARG CI_COMMIT_REF_SLUG
ARG CI_COMMIT_SHA
ARG CI_COMMIT_TIMESTAMP
# we need to put ARGs in ENV variables if we want to use them in the ENTRYPOINT
ENV CI_COMMIT_REF_SLUG=$CI_COMMIT_REF_SLUG
ENV CI_COMMIT_SHA=$CI_COMMIT_SHA
ENV CI_COMMIT_TIMESTAMP=$CI_COMMIT_TIMESTAMP
COPY --from=build /usr/src/app/bac/build/libs/* /usr/src/app/bac/
WORKDIR /usr/src/app/bac/
RUN ls -la
EXPOSE 8080
EXPOSE 8081
RUN echo $CI_COMMIT_REF_SLUG
RUN echo $CI_COMMIT_SHA
RUN echo $CI_COMMIT_TIMESTAMP
ENTRYPOINT ["java", "-jar", "bac.jar", "-Xmx8g"]
All the addons were migrated in 2.7 and build is OK on gitlab, only the app has the memory bug