JDK-8278305 : Expose the number of StackOverflowErrors encountered by JVM
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 8-pool
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2021-12-06
  • Updated: 2025-04-14
  • Resolved: 2025-04-14
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.
Other
tbdResolved
Related Reports
Duplicate :  
Description
src/hotspot/share/utilities/exceptions.cpp
A variable "_stack_overflow_errors" tracks StackOverflowErrors. 

Knowing whether a JVM has experienced StackOverflowError(s) is an important data point in debugging lost (java.util.concurrent) Locks, hangs etc. There's a JFR option but recordings at time of Error may not be possible.

Exposing "_stack_overflow_errors" via a hotspot/VM MXBean seems like something that could be straightforward to achieve and benefit cases where such data is required.
Comments
With JDK-8027429 now available in 8u361, StackOverflowError counts are available in JDK 8 and later via the "jcmd <pid> VM.info" command.
14-04-2025

Just realised that jcmd VM.info does this already for JDK 11+ : e.g. === OutOfMemory and StackOverflow Exception counts: StackOverflowErrors=42 LinkageErrors=9 === maybe this enhancement needs to focus more on a JDK 8u solution.
08-12-2021