JDK-8138752 : G1CollectorPolicy::should_should_update_surv_rate_group_predictors() uses wrong predicate
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-10-02
  • Updated: 2015-11-12
  • Resolved: 2015-10-15
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.
9 b89Fixed
Related Reports
Relates :  
Relates :  
G1CollectorPolicy::should_should_update_surv_rate_group_predictors() determines whether the survivor rate group predictors should be updated.

The current method uses CollectorState::last_young_gc() && !CollectorState::in_marking_window(), which means "only the gc between GC cleanup and mixed GC".

The first term is wrong, particularly when looking at the original code before JDK-7097567: it should be CollectorState::last_gc_was_young() && !CollectorState::in_marking_window(), i.e. all young gcs where no marking is running.

Fix this.
The original code in JDK-7097567 looks like - bool propagate = _last_gc_was_young && !_in_marking_window; + bool propagate = collector_state()->should_propagate(); (http://hg.openjdk.java.net/jdk9/jdk9/hotspot/file/23cc50392e04/src/share/vm/gc/g1/g1CollectorPolicy.hpp) where CollectorState::should_propagate() has been wrongly changed to: bool should_propagate() { // XXX should have a more suitable state name or abstraction for this return (_last_young_gc && !_in_marking_window); } (http://hg.openjdk.java.net/jdk9/jdk9/hotspot/file/23cc50392e04/src/share/vm/gc/g1/g1CollectorState.hpp)

noreg-hard justification: this is a bug that concerns updates of prediction that may or may not have any real impact on the application. It's very hard to measure this.