JDK-8265119 : G1: update_remset_before_rebuild mixes liveness in words with liveness in bytes
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 11.0.2,17
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-04-13
  • Updated: 2021-04-22
  • Resolved: 2021-04-16
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.
JDK 17
17 b19Fixed
Related Reports
Relates :  
Relates :  
Description
size_t const live_bytes = _cm->liveness(hr->hrm_index());
selected_for_rebuild = tracking_policy->update_before_rebuild(hr, live_bytes);

The code erroneously uses the liveness count (i.e. the amount of live words between bottom and nTAMS) instead of the liveness_in_bytes  for the selection of regions for remembered set rebuilding. The effect is that more regions will be selected for rebuild than necessary.

Fix and add a test for G1MixedGCLiveThresholdPercent
Comments
Changeset: fc89fe64 Author: Ivan Walulya <iwalulya@openjdk.org> Date: 2021-04-16 07:29:55 +0000 URL: https://git.openjdk.java.net/jdk/commit/fc89fe64
16-04-2021

Maybe rename ConcurrentMark::liveness() to live_words() to make this clear; or change its return value to WordSize to completely avoid unintentional mixups in the future.
14-04-2021