Skip to content

Commit

Permalink
Merge pull request quarkusio#27462 from zakkak/parse-once
Browse files Browse the repository at this point in the history
Re-enable `ParseOnce` starting with GraalVM / Mandrel 22.2
  • Loading branch information
gsmet authored Aug 24, 2022
2 parents 85d06ba + 03ea11c commit 815c466
Showing 1 changed file with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -677,19 +677,21 @@ public NativeImageInvokerInfo build() {
}
nativeImageArgs.add("--features=" + String.join(",", featuresList));

/*
* Instruct GraalVM / Mandrel parse compiler graphs twice, once for the static analysis and once again
* for the AOT compilation.
*
* We do this because single parsing significantly increases memory usage at build time
* see https://github.com/oracle/graal/issues/3435 and
* https://github.com/graalvm/mandrel/issues/304#issuecomment-952070568 for more details.
*
* Note: This option must come before the invocation of
* {@code handleAdditionalProperties(nativeImageArgs)} to ensure that devs and advanced users can
* override it by passing -Dquarkus.native.additional-build-args=-H:+ParseOnce
*/
nativeImageArgs.add("-H:-ParseOnce");
if (graalVMVersion.isOlderThan(GraalVM.Version.VERSION_22_2_0)) {
/*
* Instruct GraalVM / Mandrel parse compiler graphs twice, once for the static analysis and once again
* for the AOT compilation.
*
* We do this because single parsing significantly increases memory usage at build time
* see https://github.com/oracle/graal/issues/3435 and
* https://github.com/graalvm/mandrel/issues/304#issuecomment-952070568 for more details.
*
* Note: This option must come before the invocation of
* {@code handleAdditionalProperties(nativeImageArgs)} to ensure that devs and advanced users can
* override it by passing -Dquarkus.native.additional-build-args=-H:+ParseOnce
*/
nativeImageArgs.add("-H:-ParseOnce");
}

/**
* This makes sure the Kerberos integration module is made available in case any library
Expand Down

0 comments on commit 815c466

Please sign in to comment.