On Fri, 30 Aug 2024 11:15:23 GMT, Stefan Karlsson <stef...@openjdk.org> wrote:

>> I was thinking the same, but there's a problem with that. If we get a 
>> promotion failure in the young gen, we are leaving the dead objects marked 
>> as forwarded. Then when the Full GC scans these regions with dead objects it 
>> will mistakenly think that they have been marked alive because 
>> `is_forwarded() == is_gc_marked()`. The code in `phase2_calculate_new_addr` 
>> will then break when it looks for `is_gc_marked` objects.
>
> FWIW, the ParallelGC does something very similar to what you propose, except 
> that it walks bitmaps instead of paring the space to find the self-forwarded 
> objects. It then has a check inside object_iterate to make sure that it 
> doesn't expose the dead objects (in eden and the from space) to heap dumpers 
> and histogram printers.
> 
> Because of the the code above, the SerialGC clears away the information about 
> what objects are dead in eden and the from space, so heap dumpers and 
> histogram printers will include these dead objects. We might want to fix that 
> as a future RFE.

> If we get a promotion failure in the young gen, we are leaving the dead 
> objects marked as forwarded. 

True; need to do sth like `obj->init_mark();` for the non-self-forwarded case. 
The postcondition is that no forwarded objs in eden/from.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1739218189

Reply via email to