On Mon, 9 Sep 2024 12:49:05 GMT, Roman Kennke <rken...@openjdk.org> wrote:

>>> 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).

(Just to clarify if others are reading this)

Right, what I referred to above was how we found the object to forward, which 
is done via the bitmaps:

          while (cur_addr < region_end) {
            cur_addr = mark_bitmap()->find_obj_beg(cur_addr, region_end);

If the Parallel Old collector didn't do that, but instead parsed the heap like 
Serial does, then the Parallel Young collector would also have to fix the from 
space copies of moved objects when when it hits a promotion failure, just like 
Serial does. This was just meant to point out the differences between the two 
collectors and why the young GC code is different.

I realize that in earlier comments I called the from-space copy of the objects 
"dead objects", but they are not dead they are just the stale objects that are 
discoverable because of promotion failure keeping the eden and from spaces.

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

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

Reply via email to