RFR: 8285710: Miscalculation of G1CardSetAllocator unused memory size [v4]

tqxia duke at openjdk.java.net
Sat May 7 02:41:27 UTC 2022


> when calculating the wasted memory size of G1CardSetAllocator, the code erroneously substracted both _segmented_array.num_allocated_slots() and _free_slots_list.pending_count() from _segmented_array.num_available_slots().
> 
> The correct formula should be: num_wasted_slots = _segmented_array.num_available_slots() - (_segmented_array.num_allocated_slots() - (uint)_free_slots_list.pending_count()).
> 
> This can potentially leads to an arithmetic overflow and misleading information will be displayed when G1SummarizeRSetStatsPeriod is set.

tqxia has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:

  8285710: Miscalculation of G1CardSetAllocator unused memory size

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8424/files
  - new: https://git.openjdk.java.net/jdk/pull/8424/files/6b86cbeb..14d8a471

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=8424&range=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=8424&range=02-03

  Stats: 0 lines in 0 files changed: 0 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8424.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8424/head:pull/8424

PR: https://git.openjdk.java.net/jdk/pull/8424



More information about the hotspot-gc-dev mailing list