JDK-8133818 : Additional number of processed references printed with -XX:+PrintReferenceGC after JDK-8047125
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P5
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2015-08-18
  • Updated: 2015-11-09
  • Resolved: 2015-09-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 9
9 b83Fixed
Related Reports
Cloners :  
Relates :  
Description
JDK-8047125 separated processing of j.l.ref.PhantomReference and Cleaner into two separate phases during reference processing.

This resulted in -XX:+PrintReferenceGC output to be scrambled slightly, adding a new "refs: <count>" string to the PhantomReference section.

Example:
7.642: [SoftReference, 0 refs, 0.0006965 secs]7.643: [WeakReference, 40 refs, 0.0003039 secs]7.643: [FinalReference, 3477 refs, 0.0036191 secs]7.647: [PhantomReference, 0 refs, 0 refs, 0.0006649 secs]7.647: [JNI Weak Reference, 0.0000119 secs], 0.0173298 secs]

Cleaners should have their own section in the printout.

Comments
I've attached a webrev/patch for this which splits out cleaner ref timing and counts, as well as counting jni weak refs on the fly and reporting them. I'm happy to offer to get this reviewed over the hotspot-gc-dev mailing list, or if someone else can shepherd the changes into OpenJDK, they are welcome. These changes are wrt JDK 9 (I was told that is the best way to get this into OpenJDK), but these changes should apply fairly cleanly to JDK 8 as well (in fact at Twitter we have these changes running on JDK 8). Thanks for shepherding the patch, and let me know (ysr1729@gmail.com) if there are any questions.
27-08-2015

The main reason for suggesting that Cleaners should have their own section in the printout is that this helps diagnosing issues about the origin of these references. There may be some confusion about what Cleaners are, but I think users that know -XX:+PrintReferenceGC could also just ask if it is important.
18-08-2015