RFR: 8305896: Alternative full GC forwarding [v15]

Aleksey Shipilev shade at openjdk.org
Tue May 2 14:23:27 UTC 2023


On Tue, 2 May 2023 12:47:26 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

>> src/hotspot/share/gc/shared/genCollectedHeap.cpp line 136:
>> 
>>> 134:   GCInitLogger::print();
>>> 135: 
>>> 136:   GCForwarding::initialize(_reserved, SpaceAlignment);
>> 
>> The second argument is not "shift" anymore, right? So this should be the actual reserved space size?
>
> I think SpaceAlignment is correct. We want to pass a region-size there, and the (default) region size for Serial should be the space alignment, because that is what eden, survivors and old-space will be aligned at. Unfortunately, Serial GC doesn't generally slide from top to bottom: it starts to slide old into old, then young into old until old is full, then slide the rest into young. Even worse, the survivor spaces are swapped with every GC cycle, so we really don't know that sliding goes top -> bottom. Using 'virtual' regions that align at SpaceAlignment solves the problem, though.
> (One exception is when the whole heap fits into our 2^28 words range, in which case we can treat the whole heap as single region)
> That said, I see a bug in the line: GCForwarding::initialize() takes region size *in words* but SpaceAlignment is *in bytes*. I'm fixing that to passing space-alignment in words instead.

Ah, that is _region size_, okay. `SpaceAlignment` seems okay then.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13582#discussion_r1182618027


More information about the shenandoah-dev mailing list