`-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)
[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)
- relates to
-
JDK-8349083 Factor out filename handling code from logging
-
- Open
-
-
JDK-8204681 Option to include timestamp in hprof filename
-
- Open
-
- links to
-
Commit(master) openjdk/jdk/7a7b9ed7
-
Review(master) openjdk/jdk/24482