I would not try to recover from OutOfMemoryError as some objects may end up in an undefined state (only thinks of an ArrayList, which could not allocate its own array for today, for example).
As for your question, I suspect that -XX: + HeapDumpOnOutOfMemoryError is only intentionally creating a single dump to prevent multiple dump heaps: just thinking about multiple OOME throwing threads at the same time, causing a heap dump for each exception to throw an exception.
As a summary: don't try to recover with OOME and don't expect the JVM to write more than one heap pile. However, if you still feel the need to create a heap dump, you can try to manually handle the OOME exception and call jmap to dump or use "-XX: + HeapDumpOnCtrlBreak" (not sure though, how to simulate CtrlBreak programmatically).
source share