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

Thomas Schatzl thomas.schatzl at oracle.com
Mon Mar 28 15:26:43 UTC 2022


Hi,

On 28.03.22 14:55, Vishal Chand wrote:
> 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.
> 

   it is preferred to avoid the additional significant memory overhead 
by doubling card table entry size. This seems to be a fairly uncommon 
use case. So please investigate approach 2 first.

Thanks,
   Thomas

Thanks,
   Thomas



More information about the hotspot-gc-dev mailing list