RFR: 8372747: G1: Conservative heap alignment does not account for card table constraint [v2]

Stefan Johansson sjohanss at openjdk.org
Mon Dec 1 10:30:50 UTC 2025


On Mon, 1 Dec 2025 10:16:24 GMT, Joel Sikström <jsikstro at openjdk.org> wrote:

>> Hello,
>> 
>> We removed `GCArguments::compute_heap_alignment` in [JDK-8372150](https://bugs.openjdk.org/browse/JDK-8372150) to simplify the interface a bit, with the expecation that each GC handles alignment on their own. This is true when the default "small" page size is 4K, but with 64K default "small" pages on PPC, this assumption doesn't hold. To fix this, we should make sure to account for the card table constraints in `G1Arguments::conservative_max_heap_alignment`.
>> 
>> I've tested this locally by changing the following line to "emulate" 64K default "small" pages, which I've used to confirm this fix.
>> 
>>  uintx CardTable::ct_max_alignment_constraint() {
>>    // Calculate maximum alignment using GCCardSizeInBytes as card_size hasn't been set yet
>> -  return GCCardSizeInBytes * os::vm_page_size();
>> +  return GCCardSizeInBytes * 64 * K;
>>  }
>> 
>> 
>> Also tested with Oracle's tier1-4.
>
> Joel Sikström has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Simplify return a bit

Marked as reviewed by sjohanss (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/28572#pullrequestreview-3524279110


More information about the hotspot-gc-dev mailing list