RFR: 8306992: [JVMCI] mitigate more against JVMCI related OOME causing VM to exit [v4]

Doug Simon dnsimon at openjdk.org
Mon May 22 12:59:06 UTC 2023


> This PR makes the following changes to mitigate against an OOME or other recoverable error in JVMCI from causing the VM to exit:
> * Tracks upcalls into libjvmci or creation of libjvmci.
> * If 10% or more of these calls fail with an uncaught exception, then JVMCI compilation is disabled (i.e. future compilations fall back to Tier 1).
> 
> When JVMCI compilation is disabled, a warning is emitted:
> 
> [0.064s][warning][jit,compilation] JVMCI compiler disabled after 11 of 15 upcalls had errors (Last error: "uncaught exception in call_HotSpotJVMCIRuntime_compileMethod"). Use -Xlog:jit+compilation for more detail.
> 
> 
> With `-Xlog:jit+compilation`, the extra detail shown is:
> 
> [0.182s][info][jit,compilation] uncaught exception in call_HotSpotJVMCIRuntime_compileMethod while compiling java.util.stream.StreamOpFlag.fromCharacteristics(Ljava/util/Spliterator;)I
> Exception in thread "JVMCI-native CompilerThread0": java.lang.InternalError
> java.lang.InternalError: aborting compilation of HotSpotMethod<Object.<init>()>
> 	at jdk.internal.vm.ci at 20.0.2-internal/jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.compileMethod(HotSpotJVMCIRuntime.java:923)
> 
> 
> Note that the errors treated by the changes in the PR are expected to be exceedingly rare. For example, an OOME while starting a libgraal isolate or initializing the JVMCI compiler. Exceptions thrown during compilation are already handled by the Graal [CompilationWrapper](https://github.com/oracle/graal/blob/431ecf7d26f56cee49708854fe0e89b05514492b/compiler/src/jdk.internal.vm.compiler/src/org/graalvm/compiler/core/CompilationWrapper.java#L65).

Doug Simon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:

 - Merge remote-tracking branch 'openjdk-jdk/master' into JDK-8306992
 - avoid VM exit in more cases when creating or attaching to a libjvmci isolate
 - Merge remote-tracking branch 'openjdk-jdk/master' into JDK-8306992
 - make JMCI more robust in low resource conditions

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/13905/files
  - new: https://git.openjdk.org/jdk/pull/13905/files/ef9ac32d..94f4ba18

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=13905&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=13905&range=02-03

  Stats: 15911 lines in 500 files changed: 9445 ins; 4757 del; 1709 mod
  Patch: https://git.openjdk.org/jdk/pull/13905.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13905/head:pull/13905

PR: https://git.openjdk.org/jdk/pull/13905


More information about the hotspot-compiler-dev mailing list