apache/beam · info

Heap dumped to

Error message

Heap dumped to {}

What it means

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.

Solutions

  1. No action needed; use the logged file path to analyze the dump (jhat, VisualVM, Eclipse MAT).
  2. If uploads are configured, expect a following 'Heap dump ... uploaded to' line; otherwise copy the file off the worker before it terminates.
Defensive patterns

Strategy: fallback

Prevention

When it happens

Trigger: Memory pressure triggered dumping, the reserved memory block was used, and dumpHeap() completed writing the .hprof to the configured local dump folder.

Common situations: 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.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/d0cd1f068997fe44. Report an issue: GitHub.

Appendix: source

Thrown at sdks/java/harness/src/main/java/org/apache/beam/fn/harness/status/MemoryMonitor.java:669

    MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
    ObjectName oname = new ObjectName("com.sun.management:type=HotSpotDiagnostic");
    Object[] parameters = {fileName.getPath(), liveObjectsOnly};
    String[] signatures = {String.class.getName(), boolean.class.getName()};
    mbs.invoke(oname, "dumpHeap", parameters, signatures);

    if (java.nio.file.FileSystems.getDefault().supportedFileAttributeViews().contains("posix")) {
      Files.setPosixFilePermissions(
          fileName.toPath(),
          ImmutableSet.of(
              PosixFilePermission.OWNER_READ,
              PosixFilePermission.GROUP_READ,
              PosixFilePermission.OTHERS_READ));
    } else {
      fileName.setReadable(true, true);
    }

    LOG.warn("Heap dumped to {}", fileName);

    return fileName;
  }

  /** Return a string describing the current memory state of the server. */
  public String describeMemory() {
    Runtime runtime = Runtime.getRuntime();
    long maxMemory = runtime.maxMemory();
    long totalMemory = runtime.totalMemory();
    long usedMemory = totalMemory - runtime.freeMemory();
    return String.format(
        "used/total/max = %d/%d/%d MB, GC last/max = %.2f/%.2f %% (configured threshold: %.2f%%), #pushbacks=%d, gc thrashing=%s",
        usedMemory >> 20,
        totalMemory >> 20,
        maxMemory >> 20,
        lastMeasuredGCPercentage.get(),
        maxGCPercentage.get(),
        gcThrashingPercentagePerPeriod,

View on GitHub (pinned to 12126d8942)