-
Enhancement
-
Resolution: Unresolved
-
P4
-
18
This code
template <class T>
inline void G1ScanEvacuatedObjClosure::do_oop_work(T* p) {
[...]
} else if (!HeapRegion::is_in_same_region(p, obj)) {
handle_non_cset_obj_common(region_attr, p, obj);
assert(_scanning_in_young != Uninitialized, "Scan location has not been initialized.");
if (_scanning_in_young == True) {
return;
}
_par_scan_state->enqueue_card_if_tracked(region_attr, p, obj); // !----------------------
}
}
is going to enqueue cards into the refinement buffers (slightly abridged) that contain "interesting" references, i.e. need reference update.
The check above is a shortcut to avoid the method call (and its additional checks) for cases that "obviously" do not need cards.
Another check that could be done (and should probably be added to the assignment of _scanning_in_young) is that if there is absolutely no non-young gen region with a remembered set, then this attempt to enqueue will also always fail.
So the idea is to somewhere store whether this is the case (i.e. store and maintain the number of non-young regions with remset), and use it in the G1ScanInYoungSetter.
This could be interesting as the case when there is no non-young gen region with remembered sets may be fairly common (i.e. during young-only phase, up until the remark pause) as long as there are no humongous object candidates.
Investigate and test
template <class T>
inline void G1ScanEvacuatedObjClosure::do_oop_work(T* p) {
[...]
} else if (!HeapRegion::is_in_same_region(p, obj)) {
handle_non_cset_obj_common(region_attr, p, obj);
assert(_scanning_in_young != Uninitialized, "Scan location has not been initialized.");
if (_scanning_in_young == True) {
return;
}
_par_scan_state->enqueue_card_if_tracked(region_attr, p, obj); // !----------------------
}
}
is going to enqueue cards into the refinement buffers (slightly abridged) that contain "interesting" references, i.e. need reference update.
The check above is a shortcut to avoid the method call (and its additional checks) for cases that "obviously" do not need cards.
Another check that could be done (and should probably be added to the assignment of _scanning_in_young) is that if there is absolutely no non-young gen region with a remembered set, then this attempt to enqueue will also always fail.
So the idea is to somewhere store whether this is the case (i.e. store and maintain the number of non-young regions with remset), and use it in the G1ScanInYoungSetter.
This could be interesting as the case when there is no non-young gen region with remembered sets may be fairly common (i.e. during young-only phase, up until the remark pause) as long as there are no humongous object candidates.
Investigate and test
- relates to
-
JDK-8213142 Use RAII to set the scanning source in G1ScanEvacuatedObjClosure
- Resolved
-
JDK-8340827 G1: Improve Application Throughput with a More Efficient Write-Barrier
- Submitted