JDK-8204338 : Improve output of discovered/cleared references during reference processing
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 11
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2018-06-05
  • Updated: 2022-10-29
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
tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
Currently after JDK-8202845 we print Discovered and Cleared references for every reference type after reference processing in a very verbose way:

   SoftReference:
     Discovered: 0
     Cleared: 0
   WeakReference:
     Discovered: 30
     Cleared: 30
   FinalReference:
     Discovered: 0
     Cleared: 0
   PhantomReference:
     Discovered: 5
     Cleared: 5
I.e. there is not much information on every line.

Further issues:
- this is printed using gc+phases+ref log tags. This information is not really related to gc phases; it would be nicer to have some output with gc+ref too (which jdk9 has).
- it would also be nice to print the number of encountered refs (during discovery) and instead of the number of Cleared refs (or in addition) the number of Enqueued ones.

Comments
The multiple-line issue has been resolved by JDK-8278581. Not sure if we'd still want to address the "Further issues" using this RFE. Perhaps this can be closed as a duplicate?
29-10-2022

I will work on this. I'd also like to put the numbers on the same line, e.g. "SoftReference: Discovered: 100, Cleared: 42", so it will be easier to parse with regex.
31-01-2020