Skip to content
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

Bigger Quarkus application cannot be build as native executable now with Mandrel update to 23.1.5.0 #44220

Closed
michalvavrik opened this issue Oct 31, 2024 · 3 comments
Assignees
Labels
area/native-image kind/bug Something isn't working

Comments

@michalvavrik
Copy link
Member

michalvavrik commented Oct 31, 2024

Describe the bug

Our application that build into native executable just fine with 23.1 now cannot be build. My native build always run out of memory with 23.1.5.0. We are using quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-21, so it could be bug for the https://github.com/quarkusio/quarkus-images, but I think this is important to have tracker because personally, I am not able to assess where the bug is (if there is one), maybe it needs to be fixed in Quarkus?

Expected behavior

With MANDREL 23.1.5.0 JDK 21.0.5+11-LTS I get:

Build resources:
 - 4.44GB of memory (14.3% of 31.10GB system memory, set via '-Xmx5g')
 - 12 thread(s) (100.0% of 12 available processor(s), determined at start)
Terminating due to java.lang.OutOfMemoryError: Java heap space
The Native Image build process ran out of memory.
Please make sure your build system has more memory available.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  17:11 min
[INFO] Finished at: 2024-10-31T12:13:16+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:build (build) on project many-extensions: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR] 	[error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: io.quarkus.deployment.pkg.steps.NativeImageBuildStep$ImageGenerationFailureException: Image generation failed. Exit code: 3
[ERROR] 	at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:487)
[ERROR] 	at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:278)
[ERROR] 	at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
[ERROR] 	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)
[ERROR] 	at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
[ERROR] 	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR] 	at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)
[ERROR] 	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2654)
[ERROR] 	at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1627)
[ERROR] 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1594)
[ERROR] 	at java.base/java.lang.Thread.run(Thread.java:1583)
[ERROR] 	at org.jboss.threads.JBossThread.run(JBossThread.java:499)
[ERROR] -> [Help 1]

Actual behavior

With GRAALVM 23.1 JDK 21.0.2+13-jvmci-23.1-b30 it worked just fine.

How to Reproduce?

Steps to reproduce the behavior:

git clone git@github.com:quarkus-qe/quarkus-test-suite.git
quarkus-test-suite/super-size/many-extensions
mvn clean verify -Dnative

Output of uname -a or ver

Ubuntu & Fedora

Output of java -version

Temurin-21.0.1+12

Mandrel or GraalVM version (if different from Java)

MANDREL 23.1.5.0

Quarkus version or git rev

999-SNAPSHOT

Build tool (ie. output of mvnw --version or gradlew --version)

Maven 3.9.4

Additional information

This started to failing around 23.10.2024.

@michalvavrik michalvavrik added area/native-image kind/bug Something isn't working labels Oct 31, 2024
Copy link

quarkus-bot bot commented Oct 31, 2024

/cc @Karm (mandrel), @galderz (mandrel), @zakkak (mandrel,native-image)

@zakkak zakkak self-assigned this Oct 31, 2024
@zakkak
Copy link
Contributor

zakkak commented Oct 31, 2024

@michalvavrik I believe this is actually #44216 and as I note there the issue does not seem to be caused by the Mandrel update.

I tried reproducing the issue with 23.1.4.0-Final and I get the same results which confirms my assumption.

m and possible alternatives. If you think an experimental option should be considered as stable, please file an issue.
========================================================================================================================
GraalVM Native Image: Generating 'many-extensions-1.0.0-SNAPSHOT-runner' (executable)...
========================================================================================================================
[1/8] Initializing...                                                                                    (3.6s @ 0.41GB)
 Java version: 21.0.4+7-LTS, vendor version: Mandrel-23.1.4.0-Final
 Graal compiler: optimization level: 2, target machine: x86-64-v3
 C compiler: gcc (redhat, x86_64, 14.2.1)
 Garbage collector: Serial GC (max heap size: 80% of RAM)
 11 user-specific feature(s):
 - com.oracle.svm.thirdparty.gson.GsonFeature
 - io.quarkus.caffeine.runtime.graal.CacheConstructorsFeature
 - io.quarkus.hibernate.orm.runtime.graal.DisableLoggingFeature: Disables INFO logging during the analysis phase
 - io.quarkus.hibernate.validator.runtime.DisableLoggingFeature: Disables INFO logging during the analysis phase for the [org.hibernate.validator.internal.util.Version] categories
 - io.quarkus.jdbc.postgresql.runtime.graal.SQLXMLFeature
 - io.quarkus.runner.Feature: Auto-generated class by Quarkus from the existing extensions
 - io.quarkus.runtime.graal.DisableLoggingFeature: Adapts logging during the analysis phase
 - io.quarkus.websockets.client.runtime.DisableLoggingFeature: Disables INFO logging during the analysis phase
 - org.eclipse.angus.activation.nativeimage.AngusActivationFeature
 - org.eclipse.angus.mail.nativeimage.AngusMailFeature
 - org.hibernate.graalvm.internal.GraalVMStaticFeature: Hibernate ORM's static reflection registrations for GraalVM
------------------------------------------------------------------------------------------------------------------------
 6 experimental option(s) unlocked:
 - '-H:+AllowFoldMethods' (origin(s): command line)
 - '-H:BuildOutputJSONFile' (origin(s): command line)
 - '-H:-UseServiceLoaderFeature' (origin(s): command line)
 - '-H:IncludeResourceBundles' (origin(s): 'META-INF/native-image/org.eclipse/yasson/native-image.properties' in 'file:///tmp/quarkus-test-suite/super-size/many-extensions/target/many-extensions-1.0.0-SNAPSHOT-native-image-source-jar/lib/org.eclipse.yasson-3.0.4.jar')
 - '-H:AdditionalSecurityProviders' (origin(s): command line)
 - '-H:+GenerateBuildArtifactsFile' (origin(s): command line)
------------------------------------------------------------------------------------------------------------------------
Build resources:
 - 4.44GB of memory (7.2% of 61.93GB system memory, set via '-Xmx5g')
 - 32 thread(s) (100.0% of 32 available processor(s), determined at start)
[2/8] Performing analysis...  [Terminating due to java.lang.OutOfMemoryError: Java heap space
The Native Image build process ran out of memory.
Please make sure your build system has more memory available.

Closing as duplicate.

@zakkak zakkak closed this as completed Oct 31, 2024
@michalvavrik
Copy link
Member Author

@zakkak I am fine with closing this, but I am not fine with your issue description, let me comment there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/native-image kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants