`G1RemSetArrayOfCardsEntriesBase` controls the max number of array entries based on the region size. For example, `G1RemSetArrayOfCardsEntries` should be `128 (32 * 4)` when region size == 32M.
However, `java -XX:+UnlockExperimentalVMOptions -XX:G1HeapRegionSize=32M -XX:+PrintFlagsFinal --version | grep -i -e regionsize -e G1RemSetArrayOfCardsEntries` prints:
```
size_t G1HeapRegionSize = 33554432 {product} {command line}
uint G1RemSetArrayOfCardsEntries = 256 {experimental} {ergonomic}
```
The bug is in `G1Arguments::initialize_card_set_configuration`:
```
G1RemSetArrayOfCardsEntriesBase * (1u << (region_size_log_mb + 1))
```
should be
```
G1RemSetArrayOfCardsEntriesBase << region_size_log_mb
```
The `+ 1` is incorrect and should be removed.
However, `java -XX:+UnlockExperimentalVMOptions -XX:G1HeapRegionSize=32M -XX:+PrintFlagsFinal --version | grep -i -e regionsize -e G1RemSetArrayOfCardsEntries` prints:
```
size_t G1HeapRegionSize = 33554432 {product} {command line}
uint G1RemSetArrayOfCardsEntries = 256 {experimental} {ergonomic}
```
The bug is in `G1Arguments::initialize_card_set_configuration`:
```
G1RemSetArrayOfCardsEntriesBase * (1u << (region_size_log_mb + 1))
```
should be
```
G1RemSetArrayOfCardsEntriesBase << region_size_log_mb
```
The `+ 1` is incorrect and should be removed.
- relates to
-
JDK-8292654 G1 remembered set memory footprint regression after JDK-8286115
-
- Closed
-