native build JVM options

8 views
Skip to first unread message

Qbyte Consulting

unread,
Mar 30, 2021, 3:41:51 AMMar 30
to Kogito development mailing list
For the GraalVM native build I notice -JXmx4g is the default, so I try to increase this amount but not sure how? I believe this should speed up compilation?

<properties>
<failsafe.include>**/Native*IT.java</failsafe.include>
<failsafe.exclude></failsafe.exclude>
<quarkus.package.type>native</quarkus.package.type>
<quarkus.native.additional-build-args>-J-Xmx16G</quarkus.native.additional-build-args>
<quarkus.native.native-image-xmx>16G</quarkus.native.native-image-xmx>
...
</properties>

After increasing the additional arg is added but the original is kept - how to override the 4g limit?

[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] /Library/Java/JavaVirtualMachines/graalvm-ce-java11-21.0.0.2/Contents/Home/bin/native-image -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=1 -J-Duser.language=en -J-Dfile.encoding=UTF-8 -J-Xmx16G --initialize-at-build-time= -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy\$BySpaceAndTime -H:+JNI -jar promotion-engine-runner.jar -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -J-Xmx4g -H:-AddAllCharsets -H:EnableURLProtocols=http --no-server -H:-UseServiceLoaderFeature -H:+StackTrace promotion-engine-runner

Tristan Radisson

unread,
Mar 30, 2021, 3:47:04 AMMar 30
to Kogito development mailing list, qbyteco...@gmail.com
Hello,

Would you have an example to test this ?

Note that if you test from https://github.com/kiegroup/kogito-examples repository, some have the `quarkus.native.native-image-xmx` property directly set in 'src/main/resources/application.properties' file. Example: https://github.com/kiegroup/kogito-examples/blob/b4c398cf8130c1f899a7e7103a2e5c477dca5bd0/ruleunit-quarkus-example/src/test/resources/application.properties
And this may be the cause you cannot override it.

Regards,

Tristan Radisson

Senior Software Quality Engineer

Business Automation Cloud

Red Hat France

trad...@redhat.com   




--
You received this message because you are subscribed to the Google Groups "Kogito development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kogito-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kogito-development/c479263f-7868-4d1b-a5da-b93c4aae576en%40googlegroups.com.

Qbyte Consulting

unread,
Mar 30, 2021, 4:00:30 AMMar 30
to Kogito development mailing list
thanks!

mma...@redhat.com

unread,
Mar 30, 2021, 6:25:54 AMMar 30
to kogito-de...@googlegroups.com
Hi,

just one suggestion for the future regarding Quarkus. The properties you set are Maven properties, which (up to some exceptions like quarkus.package.type) won't be recognized by Quarkus Maven Plugin.

The order and source of properties which are recognized by Quarkus during the build time or runtime is defined here:


Since the Xmx property is a property needed before running of the application, it would be difficult/clumsy to set it as a system property for Quarkus Maven Plugin. It would need to be set as a system property for the JVM where the Maven is running.
So you have option to either defined it as an environment variable or specifying it directly in the application.properties file.

Marian
Reply all
Reply to author
Forward
0 new messages