JDK-7166894 : Add gc cause to GC logging for all collectors
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs24
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-05-07
  • Updated: 2017-02-11
  • Resolved: 2012-05-23
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 7 JDK 8 Other
7u40Fixed 8Fixed hs24Fixed
Related Reports
Relates :  
Description
As part of 7163848 the gc cause was added to all PrintGC logging for G1. It was suggested to do the same for the other collectors.

We do risk invalidating parsers with a change like this, but for the Full GC logging there was already "(System)" added to the logging when we did a System.gc(). So it seems lower risk to only add the gc cause to Full GC than to all GCs.
Suggested release note:

The log output when using -XX:+PrintGC will now list the GC cause in brackets if the flag -XX:+PrintGCCause is set. This flag is off by default in JDK7 and on by default in JDK8. Full GCs triggered by a call to System.gc() used to log "(System.gc)" or "(System)" when -XX:+PrintGC was on. Now this will only be included if -XX:+PrintGCCause is also on.

Comments
Verified by: JDK:1.7.0_40 b29 HS:24.0 b47 with tests: closed/com/oracle/jfr/gc/TestObjectCountAfterGCEvent.java closed/com/oracle/jfr/gc/TestObjectCountEvent.java
14-06-2013

EVALUATION http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/9d679effd28c
29-06-2012

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/9d679effd28c
26-05-2012

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-gc/hotspot/rev/9d679effd28c
16-05-2012

EVALUATION Add the gc cause to all Full GC log messages
07-05-2012