-XX:+HeapDumpOnOutOfMemoryError Generate memory snapshot; set path: -XX:HeapDumpPath=<path>
-XX:OnOutOfMemoryError="sh ~/cleanup.sh" Execute script when memory overflows
-XX:+HeapDumpOnOutOfMemoryError Generate memory snapshot; set path: -XX:HeapDumpPath=<path>
-XX:OnOutOfMemoryError="sh ~/cleanup.sh" Execute script when memory overflows