Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions sdks/java/container/boot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The pull request title indicates that the objective is to configure the JVM to exit on OutOfMemoryError. However, this change removes the -XX:+ExitOnOutOfMemoryError flag and its associated explanatory comment. This appears to be a mistake in the cherry-pick process, as it directly contradicts the stated goal of the PR. If the intention is to ensure the JVM exits on OOM to avoid degraded states, these lines should be retained.

Suggested change
}
// 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)
Expand Down Expand Up @@ -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"
Expand Down
Loading