When using -XX:+HeapDumpOnOutOfMemoryError
the JVM will not overwrite the heap dump if there is already a dump file under the specified path. I want to be able
You should add which Java you use. These options depends on the JVM vendor (IBM, Oracle, etc.)
OnOutOfMemoryError says WHEN to perform the dump. HeapDumpPath says WHERE to put the dump. I think the use of HeapDumpPath turns on the first, but I advice to use both for clarity.
About the original question, use the pid in the dump file name is a good practice. It can help in particular to corolate and analyse what happens after multiple issues/restarts.
The exact syntax is explained here.
That can be a path to a file OR directory. If you have a path to a directory, the generated file name will have pid in it by default.
http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html