문제

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

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top