RFR: 8328075: Shenandoah: Avoid forwarding when objects don't move in full-GC

Aleksey Shipilev shade at openjdk.org
Thu Mar 14 17:43:46 UTC 2024


On Wed, 13 Mar 2024 16:26:30 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

> Currently, in Shenandoah's full-GC, we forward all marked objects (and preserve their headers), even if they don't move. This typically happens for a certain amount of 'sediment' that accumulates at the bottom of the heap. This results in wasted CPU cycles and memory accesses and usage. It can easily be avoided by not forwarding objects that don't move.
> 
> The fix is to simply not forward objects when they don't move.
> 
> Testing:
>  - [x] hotspot_gc_shenandoah
>  - [x] tier1 +UseShenandoahGC

A few nits. I think we do the same thing for humongous objects already (where it is really painful), no particular reason not to do the same for regular ones. Any performance tests for Full GC improve?

src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp line 367:

> 365:     }
> 366: 
> 367:     // Object fits into current region, record new location:

", record new location if object needs to move:"?

src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp line 869:

> 867:       HeapWord* compact_from = cast_from_oop<HeapWord*>(p);
> 868:       HeapWord* compact_to = cast_from_oop<HeapWord*>(p->forwardee());
> 869:       assert(compact_from != compact_to, "forwarded object doesn't move");

"Forwarded object should move"?

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

Marked as reviewed by shade (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/18280#pullrequestreview-1937293992
PR Review Comment: https://git.openjdk.org/jdk/pull/18280#discussion_r1525228752
PR Review Comment: https://git.openjdk.org/jdk/pull/18280#discussion_r1525275438


More information about the shenandoah-dev mailing list