When java is executed with -XX:+HeapDumpOnOutOfMemoryError and -XX:HeapDumpPath=... arguments, heap is dump into the specified file when OutOfMemoryError occurs. However if the user does not have enough disk space for the whole heap (which can easily happen considering the size of the file), just a partial file is saved (which have no value at all) and user disk is filled to 100%. This cause problems to other applications and system stability, since no files can be saved any more.
The implementation should check whether there's enough disk space before saving the file.
The implementation should check whether there's enough disk space before saving the file.