JDK-8371990 : Remove two second delayed OOME after GC shutdown
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-11-17
  • Updated: 2025-11-24
  • Resolved: 2025-11-21
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.
JDK 26
26 masterFixed
Related Reports
Causes :  
Relates :  
Description
In JDK-8366865 the shutdown code was tweaked so that allocating code would try to block for two seconds and if the JVM didn't shut down within that time, an OOME was thrown from the allocating thread.

One of the reason why this code was introduced was to deal with shutdown problem where the thread that were shutting down the JVM would first initiate the shutdown of the GC and *after* that the thread would call the JVMTI shutdown events and callbacks. The JVMTI callbacks could call arbitrary Java code that could try to allocate memory, and if the heap was filled up, it would have to wait for a GC to do its thing and hand back memory. But the GC had initiated its termination protocol and could be unresponsive to that request, which in term would lead to hanging JVM process.

The problem described above was finally fixed with JDK-8367902.

So, I propose that we get rid of the workaround put into place with JDK-8366865.
Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/28349 Date: 2025-11-17 13:15:14 +0000
21-11-2025

Changeset: 5922c3cb Branch: master Author: Stefan Karlsson <stefank@openjdk.org> Date: 2025-11-21 08:21:20 +0000 URL: https://git.openjdk.org/jdk/commit/5922c3cbac43795275422f2484082d1e725e4bcc
21-11-2025