This is an automated email from the ASF dual-hosted git repository.
scwhittle pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new 4f2411e999e Revert "[Java Portable SDK] Configure JVM so that it exits
upon OutOfMemoryEr…" (#38567)
4f2411e999e is described below
commit 4f2411e999e6b9ab0cc3c0433ee27d4de228aa65
Author: Sam Whittle <[email protected]>
AuthorDate: Thu May 21 13:48:53 2026 +0200
Revert "[Java Portable SDK] Configure JVM so that it exits upon
OutOfMemoryEr…" (#38567)
This reverts commit 37ae1ffc176e56bc4e21bf989ffc7389bfbbdfa5.
---
sdks/java/container/boot.go | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/sdks/java/container/boot.go b/sdks/java/container/boot.go
index 3ce79e4927e..ad29f8d940a 100644
--- a/sdks/java/container/boot.go
+++ b/sdks/java/container/boot.go
@@ -195,9 +195,6 @@ func main() {
"-XX:+UseParallelGC",
"-XX:+AlwaysActAsServerClassMachine",
"-XX:-OmitStackTraceInFastThrow",
- // Crash and restart instead of throwing OutOfMemoryError which
may be caught by user or
- // framework code and leave things in a degraded state.
- "-XX:+ExitOnOutOfMemoryError",
}
enableGoogleCloudProfiler := strings.Contains(options,
enableGoogleCloudProfilerOption)
@@ -227,18 +224,16 @@ func main() {
args = append(args, jammAgentArgs)
}
- enableHeapDumpsOnOom := false
// If heap dumping is enabled, configure the JVM to dump it on oom
events.
if pipelineOptions, ok :=
info.GetPipelineOptions().GetFields()["options"]; ok {
if heapDumpOption, ok :=
pipelineOptions.GetStructValue().GetFields()["enableHeapDumps"]; ok {
- enableHeapDumpsOnOom = heapDumpOption.GetBoolValue()
+ if heapDumpOption.GetBoolValue() {
+ args = append(args,
"-XX:+HeapDumpOnOutOfMemoryError",
+
"-Dbeam.fn.heap_dump_dir="+filepath.Join(dir, "heapdumps"),
+ "-XX:HeapDumpPath="+filepath.Join(dir,
"heapdumps", "heap_dump.hprof"))
+ }
}
}
- if enableHeapDumpsOnOom {
- args = append(args, "-XX:+HeapDumpOnOutOfMemoryError",
- "-Dbeam.fn.heap_dump_dir="+filepath.Join(dir,
"heapdumps"),
- "-XX:HeapDumpPath="+filepath.Join(dir, "heapdumps",
"heap_dump.hprof"))
- }
// Apply meta options
const metaDir = "/opt/apache/beam/options"