JDK-8260926 : Trace resource exhausted events unconditionally
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 17
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-02-02
  • Updated: 2025-01-16
  • Resolved: 2021-02-05
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 11 JDK 17
11.0.12Fixed 17 b09Fixed
Related Reports
Relates :  
Description
Analyzing out-of-resource situations in cloud scenarios is no fun. With CloudFoundry, a JVMTI agent (jvmkill) is hooked up intercepting the jvmti "resource exhausted" event, then attempts to write up a heap report. That may fail, e.g. due to bugs in the agent [1], but also because that report runs java code and may suffer from the same resource exhaustion. Successful or not, it unceremoniously kills the VM when done, often leaving us with no information about the actual resource.

It would be very helpful if we had unconditional tracing here. We do have tracing, but it requires a non-product build and is triggered with TraceJVMTI. Also, it traces at trace level which is way to fine granular.

I'd like to introduce another, unconditional trace line here. Arguably, resource exhausted is fatal enough that it justifies unconditional tracing. 

[1] https://github.com/cloudfoundry/jvmkill/issues/18
Comments
Fix Request: This patch adds output which is useful to us in CloudFoundry scenarios. Nature of the fix: just adds an UL output line just before we invoke hooks on JVMTI resource exhausted. The patch had to be changed for 11u (nullptr -> NULL) but is very low risk. 11u Patch: http://cr.openjdk.java.net/~stuefe/webrevs/backports/8260926-trace-resource-exhausted-events-unconditionally-11u RFR thread: https://mail.openjdk.java.net/pipermail/jdk-updates-dev/2021-April/005928.html Testing done: Nightlies at SAP
23-04-2021

Changeset: ee2f2055 Author: Thomas Stuefe <stuefe@openjdk.org> Date: 2021-02-05 07:31:06 +0000 URL: https://git.openjdk.java.net/jdk/commit/ee2f2055
05-02-2021

Since this changes only JVM/TI code, I think this one belongs in hotspot/jvmti.
02-02-2021