RFR: 8316632: Shenandoah: Raise OOME when gc threshold is exceeded [v4]

Aleksey Shipilev shade at openjdk.org
Mon Oct 16 17:45:31 UTC 2023


On Mon, 2 Oct 2023 21:31:13 GMT, William Kemper <wkemper at openjdk.org> wrote:

>> Shenandoah will run back-to-back full GCs and _almost_ grind mutator progress to a halt before eventually exhausting memory. This change will have Shenandoah raise a gc threshold exceeded exception if the collector fails to make progress after `ShenandoahNoProgressThreshold` full GC cycles (default is 3).
>
> William Kemper has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Merge check for no-progress into retry allocation block
>  - Revert change to TEST.groups

src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 887:

> 885:       size_t original_count = get_gc_no_progress_count() + 1;
> 886:       while (result == nullptr && original_count > get_gc_no_progress_count()) {
> 887:         if (!req.is_lab_alloc() && get_gc_no_progress_count() > ShenandoahNoProgressThreshold) {

I am confused by this logic. 

So we come in here. Let's assume we come in with good conditions, `no_progress_count` (`npc`) is `0`. So `original_count` is `1`. We proceed to the loop. `original_count > npc` is true, so we enter. Suppose we finish the cycle without progress. `npc` is now `1`. We circle back to the loop. `original_count > npc` now fails, and we exit. At which point the `npc > ShenandoahNoProgressThreshold` comes into picture?

I think the new code got `gc_count` confused with `no_progress_count`, really?

test/jdk/com/sun/jdi/EATests.java line 274:

> 272:         public final boolean DeoptimizeObjectsALot;
> 273:         public final boolean DoEscapeAnalysis;
> 274:         public final boolean ConcurrentGCIsSelected;

Let's do explicit `ZGCIsSelected` and `ShenandoahIsSelected`. Unfortunately, "Concurrent GC" is fairly ambiguous.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15852#discussion_r1361045071
PR Review Comment: https://git.openjdk.org/jdk/pull/15852#discussion_r1361023475


More information about the shenandoah-dev mailing list