Skip to content

Commit

Permalink
Merge pull request #21018 from zakkak/disable-parseonce
Browse files Browse the repository at this point in the history
Disable single parsing of compiler graphs by default
  • Loading branch information
gsmet authored Oct 29, 2021
2 parents e867d5d + 201b9a6 commit efaff14
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,22 @@ public NativeImageInvokerInfo build() {
enableHttpsUrlHandler = true;
}

/*
* 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");

handleAdditionalProperties(nativeImageArgs);

nativeImageArgs.add(
"-H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime"); //the default collection policy results in full GC's 50% of the time
nativeImageArgs.add("-H:+JNI");
Expand Down

0 comments on commit efaff14

Please sign in to comment.