JDK-8041626 : Shutdown tracing event
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: jfr
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-04-23
  • Updated: 2020-06-09
  • Resolved: 2018-02-27
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 8 Other
11 b04Fixed 8u261Fixed openjdk8u262Fixed
Description
Having an event for the shutdown reason could be useful together with the dump on exit flag. 

David Buck introduced a flag for doing verbose shutdown logging in JRockit:
https://blogs.oracle.com/buck/entry/jrockit_s_new_shutdown_verbose
Comments
This would be incredibly helpful. A common case is that the JVM will shut down because the last non-daemon thread exits. If this happens unexpectedly, the JVM simply vanishes, with no messages, stack traces, etc., and it can be quite mystifying. Having this reason by itself would be helpful. It's not clear what additional detail could be included. Since the JVM exit is caused by a thread exiting, there isn't necessarily a stack trace or anything available. But perhaps including the **name** of the last non-daemon thread to exit would help diagnose such situations.
27-07-2017