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 26, 2021
1 parent 8205e5e commit 514fac4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,17 @@ public static class Debug {
@ConfigItem
public boolean enableDashboardDump;

/**
* Instruct GraalVM / Mandrel to parse compiler graphs only once before static analysis. When false, compiler graphs
* are parsed once for the static analysis and once again for the AOT compilation.
*
* This is set to {@code false} by default 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.
*/
@ConfigItem(defaultValue = "false")
public boolean enableParseOnce;

/**
* Supported Container runtimes
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,10 @@ public NativeImageInvokerInfo build() {
nativeImageArgs.add("-H:+DashboardAll");
}

if (!nativeConfig.enableParseOnce) {
nativeImageArgs.add("-H:-ParseOnce");
}

if (nativeImageSecurityProviders != null && !nativeImageSecurityProviders.isEmpty()) {
String additionalSecurityProviders = nativeImageSecurityProviders.stream()
.map(p -> p.getSecurityProvider())
Expand Down

0 comments on commit 514fac4

Please sign in to comment.