RFR(s): 8066822: Remove PSMarkSweep::set_reference_processor

Bengt Rutisson bengt.rutisson at oracle.com
Thu Dec 11 18:52:35 UTC 2014

On 12/11/14 7:34 PM, Kim Barrett wrote:
> Thanks for your review.
> On Dec 11, 2014, at 2:24 AM, Bengt Rutisson <bengt.rutisson at oracle.com> wrote:
>> The counters() method is only used as a private accessor. Do you want to move that to the private section as part of this cleanup? Alternatively it could be removed and the only use of it in PSMarkSweep::invoke_no_policy() could access the instance variable _counters directly.
> This counters() method seems to be a common thread through all of the parallelScavange collector classes.  There are no callers of any of those public accessors.  The Generation class provides a similar virtual counters() function.  I didn’t discover users of that function either, but might not have looked hard enough.  It might be that Generation::counters() *is* used, and that the bug is that the parallelScavange collector counters are not hooked into the same mechanism.   It might instead be that nobody presently uses any of them, but they can provide useful information for development.  Or this might all be vestigial code that should be eliminated.  Given the broader scope of enquiry and potential code changes, I’d like to keep the counters() stuff separate from the small localized change under review.

The counters are being used but it is not that easy to track down. The 
counters are of class, CollectorCounters and if you look at the 
constructor for that class, CollectorCounters::CollectorCounters(), you 
see that it registers itself with the PerfDataManager. The is a way to 
expose some "perf counters" to consumers outside of the JVM. I am not 
100% sure of all uses, but I think there are for example MBeans to ask 
for these values.

Thus, I don't think we can remove the counters instances. But I think we 
could clean up the access methods and exposure of the counters. However, 
I'm fine with doing that at another time.

I'll push your change as is.

Thanks again for cleaning things like this up!

>> I can sponsor the fix.
> Thanks.

More information about the hotspot-gc-dev mailing list