RFR: 8334010: VM crashes with ObjectAlignmentInBytes > GCCardSizeInBytes

Aleksey Shipilev shade at openjdk.org
Tue Oct 15 08:41:13 UTC 2024


On Tue, 15 Oct 2024 08:10:09 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> Hi all,
> 
>   please review this change that makes VM initialization reject invalid combinations of `ObjectAlignmentInBytes` and `GCCardSizeInBytes`.
> 
> ObjectAlignmentInBytes larger than GCCardSizeInBytes causes issues with setting correct BOT offsets.
> 
> Testing: new test case, gha
> 
> Hth,
>   Thomas

This looks fine, I only have comments about the test.

test/hotspot/jtreg/gc/TestObjectAlignmentCardSize.java line 43:

> 41:         "-XX:GCCardSizeInBytes=" + cardSize,
> 42:         "-Xmx32m",
> 43:         "-Xms32m",

I wonder if we are playing close to heap limits here, especially with large `ObjectAlignmentInBytes`. Do you have a feeling how much of the heap is used with `ObjectAlignmentInBytes=512`? Should this be `128m` instead, maybe?

test/hotspot/jtreg/gc/TestObjectAlignmentCardSize.java line 51:

> 49:       output.shouldHaveExitValue(0);
> 50:     } else {
> 51:       output.shouldContain("Error occurred during initialization of VM");

Check for `Invalid combination of GCCardSizeInBytes and ObjectAlignmentInBytes` message explicitly?

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

PR Review: https://git.openjdk.org/jdk/pull/21515#pullrequestreview-2368567001
PR Review Comment: https://git.openjdk.org/jdk/pull/21515#discussion_r1800707594
PR Review Comment: https://git.openjdk.org/jdk/pull/21515#discussion_r1800705971


More information about the hotspot-gc-dev mailing list