RFR: 8272773: Investigate making card table size configurable

Thomas Schatzl tschatzl at openjdk.java.net
Fri Oct 8 09:51:13 UTC 2021


On Fri, 8 Oct 2021 08:32:25 GMT, Vishal Chand <github.com+10235864+vish-chan at openjdk.org> wrote:

>> src/hotspot/share/gc/parallel/objectStartArray.cpp line 48:
>> 
>>> 46:   // size blocks as the card table.
>>> 47:   assert((int)block_size == (int)CardTable::card_size, "Sanity");
>>> 48:   assert((int)block_size <= 1024, "block_size must be less than or equal to 1024");
>> 
>> The maximum of `1024` is derived from that we need an extra bit for possible offsets in the byte for backskip values (at least that's a hard limit). Please factor out a constant and comment it.
>> Maybe for now, also check that card element size and offset table element size are equal (although they need not be, but the code may assume that).
>
> What is meant by "factor out" a constant?

Instead of embedding the value "1024" everywhere, use a (private) static const that is named appropriately, and can be documented as suggested.

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

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



More information about the hotspot-gc-dev mailing list