RFR: 8329203: Parallel: Investigate Mark-Compact for Full GC to decrease memory usage [v4]
Guoxiong Li
gli at openjdk.org
Thu May 16 11:26:06 UTC 2024
On Wed, 15 May 2024 20:29:25 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
> (It's mostly to guard against too small Log2RegionSize.)
OK
> With the new mark-compact algo, it's kind of expected that adjust goes before compact, so the usefulness of this comment is limited. Maybe it's better to remove it completely.
I think it is good to remove the comment too.
>> src/hotspot/share/gc/parallel/psParallelCompact.cpp line 1839:
>>
>>> 1837: if (new_addr != cur_addr) {
>>> 1838: cm->preserved_marks()->push_if_necessary(obj, obj->mark());
>>> 1839: obj->forward_to(cast_to_oop(new_addr));
>>
>> The `live_words` is firstly initialized as `partial_obj_size` of the current region. But then it is added to the `destination` to construct the new address. The `destination` is a precise location of the `dest-region` instead of current region, so the new address may be not right when `partial_obj_size` is not zero. But I don't know why all the tests passed. Do I miss anything?
>
> Maybe there is a misleading re `destination` here.
>
> For non-spliting regions, `destination` is the destination for the first live word in the current region.
>> The live_words is firstly initialized as partial_obj_size of the current region
>
> For non-spliting regions, destination is the destination for the first live word in the current region.
I know `destination` is the first live word of the current region. But the new address seems to should be `destination + <live words>` instead of `destination + <live words> + <partial_obj_size>`.
> The early-return is needed to ensure `cast_to_oop(live_start)->size()` is safe.
Got it. Thanks.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19101#discussion_r1603158793
PR Review Comment: https://git.openjdk.org/jdk/pull/19101#discussion_r1603159949
PR Review Comment: https://git.openjdk.org/jdk/pull/19101#discussion_r1603157129
PR Review Comment: https://git.openjdk.org/jdk/pull/19101#discussion_r1603160444
More information about the hotspot-gc-dev
mailing list