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

Joel Sikström jsikstro at openjdk.org
Mon Dec 1 09:37:46 UTC 2025


On Mon, 1 Dec 2025 09:26:20 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.

@TheRealMDoerr could you verify this at your end as well? Thank you!

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

PR Comment: https://git.openjdk.org/jdk/pull/28572#issuecomment-3595510206


More information about the hotspot-gc-dev mailing list