No, there is no way to overwrite the file.
The relevant code is here: http://hg.openjdk.java.net/jdk/jdk/file/1ae823617395/src/hotspot/share/services/heapDumper.cpp#l465
Pergunta
I am dumping heap (OpenJDK 7) on OOM with
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/jvm.hprof
startup opts for my VM. I dont have enough space on the disk and cant afford to store multiple dumps (heap size is 6g). Is there a way to force JVM to overwrite the dump file? Currently it will complain about 'file exists' and leave the existing dump intact. I have read Sun's docs but there doesnt seem to be any option to force overwrite
Solução
No, there is no way to overwrite the file.
The relevant code is here: http://hg.openjdk.java.net/jdk/jdk/file/1ae823617395/src/hotspot/share/services/heapDumper.cpp#l465