RFR (S): 8009232: Improve stats gathering code for reference processor

Erik Helin erik.helin at oracle.com
Tue Mar 5 01:36:08 PST 2013


based on internal feedback, I've updated the change.

The ReferenceProcessorStats class is now no longer a C++ "friend" with 
the ReferenceProcessor class. Furthermore, the method
ReferenceProcessor::process_discovered_reflist now returns the number of
discovered references.

I have also renamed GCTrace::report_gc_reference_processing to
GCTrace::report_gc_reference_stats and
GCTrace::send_gc_reference_processing_event to
GCTrace::send_gc_reference_stats_event. This was done because the name
of the event was previously changed from vm/gc/reference/processing to

New webrev:


On 03/01/2013 12:34 PM, Erik Helin wrote:
> Hi all,
> this change refactors the way the reference processing statistics are
> being collected from the reference processor.
> Summary:
> Before, the statistics were collected by calling
> ReferenceProcessor::collect_statistics immediately after a call to
> ReferenceProcessor::process_discovered_references. With this change, the
> method process_discovered_references instead returns
> the statistics.
> The benefit is that there is now no need to keep track of an internal
> state in ReferenceProcessor since the ReferenceProcessorStats can be put
> on the stack in process_discovered_references. Furthermore, the code is
> more maintainable, since the old code required the calls to
> process_discovered_references and collect_statistics to go "hand in
> hand". Now, one only has to care about the call to
> process_discovered_references.
> Webrev:
> http://cr.openjdk.java.net/~ehelin/8009232/webrev.00/
> Bug:
> https://jbs.oracle.com/bugs/browse/JDK-8009232
> Testing:
> Thanks,
> Erik

More information about the hotspot-gc-dev mailing list