{"record":{"id":"d0cd1f068997fe44","repo":"apache/beam","slug":"heap-dumped-to","errorCode":null,"errorMessage":"Heap dumped to {}","messagePattern":"Heap dumped to (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"sdks/java/harness/src/main/java/org/apache/beam/fn/harness/status/MemoryMonitor.java","lineNumber":669,"sourceCode":"\n    MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();\n    ObjectName oname = new ObjectName(\"com.sun.management:type=HotSpotDiagnostic\");\n    Object[] parameters = {fileName.getPath(), liveObjectsOnly};\n    String[] signatures = {String.class.getName(), boolean.class.getName()};\n    mbs.invoke(oname, \"dumpHeap\", parameters, signatures);\n\n    if (java.nio.file.FileSystems.getDefault().supportedFileAttributeViews().contains(\"posix\")) {\n      Files.setPosixFilePermissions(\n          fileName.toPath(),\n          ImmutableSet.of(\n              PosixFilePermission.OWNER_READ,\n              PosixFilePermission.GROUP_READ,\n              PosixFilePermission.OTHERS_READ));\n    } else {\n      fileName.setReadable(true, true);\n    }\n\n    LOG.warn(\"Heap dumped to {}\", fileName);\n\n    return fileName;\n  }\n\n  /** Return a string describing the current memory state of the server. */\n  public String describeMemory() {\n    Runtime runtime = Runtime.getRuntime();\n    long maxMemory = runtime.maxMemory();\n    long totalMemory = runtime.totalMemory();\n    long usedMemory = totalMemory - runtime.freeMemory();\n    return String.format(\n        \"used/total/max = %d/%d/%d MB, GC last/max = %.2f/%.2f %% (configured threshold: %.2f%%), #pushbacks=%d, gc thrashing=%s\",\n        usedMemory >> 20,\n        totalMemory >> 20,\n        maxMemory >> 20,\n        lastMeasuredGCPercentage.get(),\n        maxGCPercentage.get(),\n        gcThrashingPercentagePerPeriod,","sourceCodeStart":651,"sourceCodeEnd":687,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/status/MemoryMonitor.java#L651-L687","documentation":"Success log emitted by MemoryMonitor.dumpHeap() after a heap dump file was successfully written to the given file name, with read permissions set for owner/group/others (or readable for all on non-POSIX filesystems). It marks the end of a successful in-process heap dump; the file can subsequently be uploaded by tryUploadHeapDumpIfItExists.","triggerScenarios":"Memory pressure triggered dumping, the reserved memory block was used, and dumpHeap() completed writing the .hprof to the configured local dump folder.","commonSituations":"Normal outcome of OOM-triggered or manually triggered heap dumps in Beam harness workers; the path in the log is the artifact to retrieve or that will be uploaded.","solutions":["No action needed; use the logged file path to analyze the dump (jhat, VisualVM, Eclipse MAT).","If uploads are configured, expect a following 'Heap dump ... uploaded to' line; otherwise copy the file off the worker before it terminates."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure workers stay alive long enough for the dump to be uploaded or copied","Configure uploadFilePath so successful dumps are persisted off-worker"],"tags":["java","apache-beam","heap-dump","jvm"],"backgroundTag":"heap-dump-created","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}