scwhittle commented on code in PR #37764:
URL: https://github.com/apache/beam/pull/37764#discussion_r2993879500
##########
sdks/java/container/boot.go:
##########
@@ -221,16 +224,18 @@ 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 {
- 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"))
- }
+ enableHeapDumpsOnOom = heapDumpOption.GetBoolValue()
}
}
+ if enableHeapDumpsOnOom {
+ args = append(args, "-XX:+HeapDumpOnOutOfMemoryError",
+ "-Dbeam.fn.heap_dump_dir="+filepath.Join(dir,
"heapdumps"),
Review Comment:
Beam may still choose to initiate a heap dump itself based upon detected
memory crashing which is separate from the JVM or it may do so in reaction to
catching an OutOfMemoryError. Despite it's name of HeapDumpOnOutOfMemoryError,
this option only handles OOM from the JVM, not cases where this error is thrown
by libraries (for example attempted String construction over INT_MAX will just
throw directly).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]