Skip to content

Commit

Permalink
Disable single parsing of compiler graphs by default
Browse files Browse the repository at this point in the history
Disable single parsing of compiler graphs till the impact of it on heap
usage decreases see oracle/graal#3435 and
graalvm/mandrel#304 (comment)

quarkusio#19511 didn't take into account
runs with constraint memory.  Bringing back `-H:-ParseOnce` reduces the
heap usage significantly, from 3.9G down to 2.7G in
integration-tests/main.
  • Loading branch information
zakkak committed Oct 28, 2021
1 parent 05c8824 commit 201b9a6
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 201b9a6

Please sign in to comment.