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

Joel Sikström jsikstro at openjdk.org
Tue Dec 2 11:58:59 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.

This pull request has now been integrated.

Changeset: 3f046f6d
Author:    Joel Sikström <jsikstro at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/3f046f6dec72392d0693655c0f0ef9189529ce45
Stats:     5 lines in 1 file changed: 1 ins; 0 del; 4 mod

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

Reviewed-by: mdoerr, stefank, tschatzl, sjohanss

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

PR: https://git.openjdk.org/jdk/pull/28572


More information about the hotspot-gc-dev mailing list