Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8353727

HeapDumpPath doesn't expand %p

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • 8, 25
    • hotspot
    • None
    • svc
    • b18

      `-XX:HeapDumpPath` doesn't replace `%p` with PID, even though it is documented[1] to do so.

      [1] https://docs.oracle.com/en/java/javase/24/docs/specs/man/java.html

      Reproduction
      ========

      cat >HeapDumpTest.java <<EOF
      public class HeapDumpTest {
          public static void main(String[] args) {
              java.util.List<Object> list = new java.util.ArrayList<>();
              while (true) { list.add(new Object()); }
          }
      }
      EOF

      java -Xmx10m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./HeapDumpTest-%p.hprof HeapDumpTest.java

      # Actual: `HeapDumpTest-%p.hprof` file containing the `%p` literal gets created
      # Expected: `HeapDumpTest-1234.hprof`to be created (1234 refers to the PID)

            kevinw Kevin Walls
            vyazici Volkan Yazici
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: