When reference discovery is enabled during concurrent marking reference objects whose referents are alive are enqueued on the discovered reference lists unnecessarily. This can increase the times of the remark pauses - where the discovered reference lists are walked and references with live referents removed.
In the ReferenceProcessor class there is a field called _is_alive_non_header. This field is initialized with a closure that, given an object, determines whether that object is alive using the concurrent marking data structures.
The query method of the _is_alive_non_header closure is called during concurrent reference discovery (by ReferenceProcessor::discover_reference) and is used to filter those reference objects whose referents are already known to be alive according to the non object header based marking.
Specifying a value for this closure can have two potential benefits:
* the most obvious is that less objects will be placed on the discovered reference
lists, reducing the amount of time doing actual reference processing.
* it causes the ReferenceProcessor::discover_reference routine to return
early (short circuit some of the later checks in discover_reference).
Since ReferenceProcessor::discover_reference is called for every reference
object, this may have tiny positive affect on the duration of concurrent