Skip to content

Commit

Permalink
Re-enable ParseOnce starting with GraalVM / Mandrel 22.2
Browse files Browse the repository at this point in the history
We no longer need to disable `ParseOnce` as memory usage with it enabled
has improved in GraalVM 22.2.

See
https://docs.google.com/spreadsheets/d/15PJ1Qd7kgneuP61N1T2_AyJ3WBsbXpVHIPKbxgH1qfM/edit#gid=1672873268
for a comparison between using and not using `ParseOnce` with 22.2.

Relates to oracle/graal#3435 and
graalvm/mandrel#316

Fixes quarkusio#25944
  • Loading branch information
zakkak authored and fercomunello committed Aug 31, 2022
1 parent 62441a8 commit 6b192ed
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 6b192ed

Please sign in to comment.