RFR: 8343658: Parallel: Implement block_start for Young generation

Volker Simonis simonis at openjdk.org
Wed Nov 6 14:17:32 UTC 2024


On Wed, 6 Nov 2024 08:04:17 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> Simple block_start implementation for Parallel young-gen. Related to https://github.com/openjdk/jdk/pull/21870
> 
> Test: tier1-3

src/hotspot/share/gc/parallel/mutableSpace.cpp line 239:

> 237: 
> 238:   HeapWord* cur_addr = bottom();
> 239:   while (cur_addr <= addr) {

As already described in https://github.com/openjdk/jdk/pull/21870#issuecomment-2454964142, this will not work in the general case, if the heap is not walkable. In a debug build you'll run into the assertion once you arrive in the unallcoated TLAB area (which you don't want during error reporting).
Even worse, in the product build you can crash or run this loop infinitely, depending on what data `obj->size()` will find in the unallocated TLAB space.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21919#discussion_r1831091387


More information about the hotspot-gc-dev mailing list