On Fri, 30 Aug 2024 18:10:44 GMT, Albert Mingkun Yang <ay...@openjdk.org> wrote:
>> 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. ParallelGC actually doesn't use bitmaps, it pushes all forwarded objs to preserved-marks-table, and uses that to find forwarded objects, which is why we can't remove the preserved-marks table in ParallelGC (IOW, after this patch, the preserved-marks-stuff in Parallel scavenger is *only* used to find forwarded objects. We might want to think about more efficient solutions for this). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1750199051