RFR: 8272773: Investigate making card table size configurable
Thomas Schatzl
tschatzl at openjdk.java.net
Fri Oct 8 12:52:08 UTC 2021
On Thu, 7 Oct 2021 11:04:09 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
>> Hi,
>>
>> Please review the changes to make CardTable entry size configurable. The changes primarily consists of:
>>
>> 1. Addition of a cmdline flag **GCCardSizeInBytes** to make the card size startup time configurable.
>> 2. Setting the card size based on the flag in G1, Parallel and Serial GC memory initialization paths.
>> 3. Setting BlockOffsetTable size and ObjectStartArray size based on the card size.
>
> src/hotspot/share/gc/g1/heapRegion.cpp line 96:
>
>> 94: // Initialize card size based on the region size.
>> 95: // Maximum no. of cards per region is 2^16.
>> 96: CardTable::initialize_card_size(1 << (region_size_log - 16));
>
> Please make a constant out of the `16`; the reason is the size of the `G1CardSetArray::EntryDataType` being 16 bit.
Another question we need to answer is whether smaller card size than 512 gains anything - if not, I recommend keeping to use 512 at minimum, as otherwise the card table will obviously use much more memory for no gain.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5838
More information about the hotspot-gc-dev
mailing list