JDK-8138745 : Implement ExitOnOutOfMemory and CrashOnOutOfMemory in HotSpot
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 8,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-10-02
  • Updated: 2021-09-23
  • Resolved: 2015-12-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
7u101Fixed 8u101Fixed 9 b99Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Sub Tasks
JDK-8152669 :  
Right now, we have a flag "OnOutOfMemoryError=..." You can do a lot of things with it, for example -XX:OnOutOfMemoryError='kill -9 %p' to generate a core file on OOM.

However, exiting and generating core files are two common cases that you may want to use when debugging. Instead of relying on command line tools (which is also harder on Windows), I suggest we implement two special cases. These were present in JRockit, so I suggest we use the same syntax (see http://docs.oracle.com/cd/E15289_01/doc.40/e15062/optionxx.htm )

There two options in JRockit were:

When you enable this option, the JVM exits on the first occurrence of an out-of-memory error. It can be used if you prefer restarting an instance of the JVM rather than handling out of memory errors.

If this option is enabled, when an out-of-memory error occurs, the JVM crashes and produces text and binary crash files.

URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/cbc2d5fbdae1 User: lana Date: 2015-12-23 23:04:20 +0000

URL: http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/cbc2d5fbdae1 User: kevinw Date: 2015-12-09 14:56:32 +0000