RFR: 8319376: ParallelGC: Forwarded objects found during heap inspection [v3]

Roman Kennke rkennke at openjdk.org
Mon Nov 6 19:48:29 UTC 2023


On Mon, 6 Nov 2023 18:15:00 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

>> See JBS issue for details.
>> 
>> Testing:
>>  - [x] gc/logging/TestUnifiedLoggingSwitchStress.java -XX:+UseParallelGC
>>  - [x] tier1 -XX:+UseParallelGC
>>  - [ ] tier2 -XX:+UseParallelGC
>>  - [ ] hotspot_gc
>
> Roman Kennke has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Restore forwardings after failed promotions

> I don't get the assertion any more after adding the following to `PSScavenge::clean_up_failed_promotion`:
> 
> ```c++
>   ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
> 
>   struct ResetForwardedMarkWord : ObjectClosure {
>     void do_object(oop obj) override {
>       if (obj->is_forwarded()) {
>         obj->init_mark();
>       }
>     }
>   } cl;
> 
>   heap->young_gen()->eden_space()->object_iterate(&cl);
>   heap->young_gen()->from_space()->object_iterate(&cl);
> ```
> 
> (Essentially copied from Serial.)

Nice, I changed this PR accordingly.

I'm curious (and puzzled), though. How would this situation normally have been repaired without this explicit header-resetting code? Would the failed-promotion slide directly into full-GC which repairs it? OTOH, I don't even see code in paralle mark-compact which would explicitely repair forwardings.

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

PR Comment: https://git.openjdk.org/jdk/pull/16494#issuecomment-1796198151


More information about the hotspot-gc-dev mailing list