Chapter 3. Native executable configuration properties

Configuration properties define how the native executable is generated. You can configure your Quarkus application using the application.properties file.

Configuration properties

The following table lists the configuration properties that you can set to define how the native executable is generated:

PropertyDescriptionTypeDefault

quarkus.native.additional-build-args

Additional arguments to pass to the build process.

list of string

 

quarkus.native.enable-http-url-handler

Enables HTTP URL handler. This allows you to do URL.openConnection() for HTTP URLs.

boolean

true

quarkus.native.enable-https-url-handler

Enables HTTPS URL handler. This allows you to do URL.openConnection() for HTTPS URLs.

boolean

false

quarkus.native.enable-all-security-services

Adds all security services to the native image.

boolean

false

quarkus.native.add-all-charsets

Adds all character sets to the native image. This increases image size.

boolean

false

quarkus.native.graalvm-home

Contains the path of the Graal distribution.

string

${GRAALVM_HOME:}

quarkus.native.java-home

Contains the path of the JDK.

File

${java.home}

quarkus.native.native-image-xmx

The maximum Java heap used to generate the native image.

string

 

quarkus.native.debug-build-process

Waits for a debugger to attach to the build process before running the native image build. This is an advanced option for those familiar with GraalVM internals.

boolean

false

quarkus.native.publish-debug-build-process-port

Publishes the debug port when building with docker and debug-build-process is true.

boolean

true

quarkus.native.cleanup-server

Restarts the native image server.

boolean

false

quarkus.native.enable-isolates

Enables isolates to improve the memory management.

boolean

true

quarkus.native.enable-fallback-images

Creates a JVM based fallback image if native image fails.

boolean

false

quarkus.native.enable-server

Uses native image server. This can speed up compilation but can cause changes to drop due to cache invalidation issues.

boolean

false

quarkus.native.auto-service-loader-registration

Automatically registers all META-INF/services entries.

boolean

false

quarkus.native.dump-proxies

Dumps the bytecode of all proxies for inspection.

boolean

false

quarkus.native.container-build

Builds using a container runtime. Docker is used by default.

boolean

false

quarkus.native.builder-image

The docker image to build the image.

string

registry.access.redhat.com/quarkus/mandrel-20-rhel8:20.3

quarkus.native.container-runtime

The container runtime used build the image. For example, Docker.

string

 

quarkus.native.container-runtime-options

Options to pass to the container runtime.

list of string

 

quarkus.native.enable-vm-inspection

Enables VM introspection in the image.

boolean

false

quarkus.native.full-stack-traces

Enables full stack traces in the image.

boolean

true

quarkus.native.enable-reports

Generates reports on call paths and included packages/classes/methods.

boolean

false

quarkus.native.report-exception-stack-traces

Reports exceptions with a full stack trace.

boolean

true

quarkus.native.report-errors-at-runtime

Reports errors at runtime. This may cause your application to fail at runtime if you are using unsupported feature.

boolean

false

quarkus.native.resources.includes

A comma separated list of globs to match resource paths that should be added to the native image. Use slash (/) as a path separator on all platforms. Globs must not start with slash. For example you have src/main/resources/ignored.png and src/main/resources/foo/selected.png in your source tree and one of your dependency JARs contains bar/some.txt file, with the following configuration quarkus.native.resources.includes = foo/,bar//*.txt the files src/main/resources/foo/selected.png and bar/some.txt will be included in the native image, while src/main/resources/ignored.png will not be included. To find out more about the glob features see the Supported glob features and its description.

list of string

 

quarkus.native.debug.enabled

Enables debug and generates debug symbols in a separate .debug file. When used with quarkus.native.container-build, Red Hat build of Quarkus only supports Red Hat Enterprise Linux or other Linux distributions as they contain the binutils package that installs the objcopy utility to split the debug info from the native image.

boolean

false

Supported glob features and its description

The following table lists the supported glob features and its description:

Character

Feature description

*

Matches a possibly empty sequence of characters that does not contain slash (/).

**

Matches a possibly empty sequence of characters that might contain slash (/).

?

Matches one character, but not slash.

[abc]

Matches one character from the range specified in the bracket, but not slash.

[a-z]

Matches one character from the range specified in the bracket, but not slash.

[!abc]

Matches one character not specified in the bracket; does not match slash.

[a-z]

Matches one character outside the range specified in the bracket; does not match slash.

{one,two,three}

Matches any of the alternating tokens separated by comma; the tokens may contain wildcards, nested alternations and ranges.

\

The escape character. There are three levels of escaping: application.properties parser, MicroProfile Config list converter, and Glob parser. All three levels use the backslash as the escaping character.

3.1. Configuring memory consumption for Quarkus native compilation

Compiling a Quarkus application to a native executable consumes a lot of memory during analysis and optimization. You can limit the amount of memory used during native compilation by setting the quarkus.native.native-image-xmx configuration property. Setting low memory limits might increase the build time.

Procedure

  • Use one of the following methods to set a value for the quarkus.native.native-image-xmx property to limit the memory consumption during the native image build time:

    • Using the application.properties file:

      quarkus.native.native-image-xmx=<maximum_memory>
    • Setting system properties:

      mvn -Pnative -Dquarkus.native.container-build=true -Dquarkus.native.native-image-xmx=<maximum_memory>

      This command builds the native executable with Docker. Add -Dquarkus.native.container-runtime=podman argument to use Podman.

Note

For example, to set the memory limit to 6 GB, enter quarkus.native.native-image-xmx=6g. The value must be a multiple of 1024 greater than 2MB. Append the letter m or M to indicate megabytes, or g or G to indicate gigabytes.