On Fri, 30 Aug 2024 07:25:54 GMT, Stefan Karlsson <stef...@openjdk.org> wrote:
>> src/hotspot/share/gc/serial/serialArguments.cpp line 33: >> >>> 31: void SerialArguments::initialize_heap_flags_and_sizes() { >>> 32: GenArguments::initialize_heap_flags_and_sizes(); >>> 33: GCForwarding::initialize_flags(MaxNewSize + MaxOldSize); >> >> Can one use `MaxHeapSize` here? > > Good catch. This is actually a bug that is causing the CDS tests to fail. The > used variables have not yet been initialized at this point. I tried making > the suggested change and that fixed at least one of the CDS failures. Yes, one must, since MaxNewSize and MaxOldSize are still on their initial values, so way too large to allow the GC forwarding, and therefore CompactObjectHeaders get automatically disabled for SerialGC. That explains a bunch of the problems @lmesnik saw. This fixes SerialGC for me: Suggestion: GCForwarding::initialize_flags(MaxHeapSize); ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1738123826