Skip to content

Commit e6c2bb0

Browse files
committed
[GR-41869] showOutOfMemoryWarning if builder is OOMKilled.
PullRequest: graal/16561
2 parents 233ec7c + 985cc32 commit e6c2bb0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/util/ExitStatus.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ public enum ExitStatus {
3232

3333
// 3 used by `-XX:+ExitOnOutOfMemoryError` (see src/hotspot/share/utilities/debug.cpp)
3434
OUT_OF_MEMORY(3),
35+
// Used by OOMKilled in containers
36+
OUT_OF_MEMORY_KILLED(137),
3537

3638
BUILDER_INTERRUPT_WITHOUT_REASON(4),
3739
DRIVER_ERROR(20),

substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,7 +1634,7 @@ protected int buildImage(List<String> javaArgs, LinkedHashSet<Path> cp, LinkedHa
16341634
/* Exit, builder has handled error reporting. */
16351635
throw NativeImage.showError(null, null, exitStatusCode);
16361636
}
1637-
case OUT_OF_MEMORY -> {
1637+
case OUT_OF_MEMORY, OUT_OF_MEMORY_KILLED -> {
16381638
showOutOfMemoryWarning();
16391639
throw NativeImage.showError(null, null, exitStatusCode);
16401640
}
@@ -1882,7 +1882,7 @@ private static void build(BuildConfiguration config, Function<BuildConfiguration
18821882
LogUtils.warning("Image '" + nativeImage.imageName + "' is a fallback image that requires a JDK for execution (use --" + SubstrateOptions.OptionNameNoFallback +
18831883
" to suppress fallback image generation and to print more detailed information why a fallback image was necessary).");
18841884
break;
1885-
case OUT_OF_MEMORY:
1885+
case OUT_OF_MEMORY, OUT_OF_MEMORY_KILLED:
18861886
nativeImage.showOutOfMemoryWarning();
18871887
throw showError(null, null, exitStatusCode);
18881888
default:

0 commit comments

Comments
 (0)