JDK-8277373: Make maximum card table size dependent on ObjectAlignmentInBytes

Vishal Chand vishalchand2492 at gmail.com
Mon Mar 28 12:55:22 UTC 2022


Hi,

This is regarding the open issue - JDK-8277373
<https://bugs.openjdk.java.net/browse/JDK-8277373>.
By making the necessary changes to the code and running a test program with
G1GC, CardSize=2048, ObjectAlignment=16, I observed the following guarantee
in
*/home/javauser/vishal/jdk_dev/jdk/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp:175*
failing -  guarantee(_bot->offset_array(start_card) ==
BOTConstants::card_size_in_words()) failed: Wrong value in second card. 0
observed, 256 expected. This is expected as a bot entry is only 1 byte.

Digging deeper into the code made it clear that the HeapWord size puts the
restriction on max. card size to 1024 bytes on 64-bit machines and 512
bytes on 32-bit machines.

There are two options to proceed from here:

   1. Increase the bot entry size. Seems like a straightforward change with
   straightforward issues.
   2. Introduce ObjectAlignment in offset calculations. Seems like this was
   the original goal of  JDK-8277373
   <https://bugs.openjdk.java.net/browse/JDK-8277373>.

Is there any other option that might have been missed and which option
would be preferred? Looking forward to hearing from the community soon.

Thanks and Regards,
Vishal



More information about the hotspot-gc-dev mailing list