RFR: 8273559: Shenandoah: Shenandoah should support multi-threaded heap dump

Severin Gehwolf sgehwolf at openjdk.java.net
Mon Sep 13 10:11:50 UTC 2021


On Fri, 10 Sep 2021 18:17:50 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:

> At the point when Shenandoah implemented heap dump, there was no ClassLoaderData::_claim_other flag. To avoid CLDG iteration interfering concurrent GC, we chosen single-threaded CLDG iteration with ClassLoaderData::_claim_none and ensured that by asserting calling thread has to be VMThread.
> 
>  JDK-8237354 broke the assumption, as it uses safepoint worker to execute heap dump, so that the thread executes CLDG iteration is not necessary VMThread.
> 
> Now, with new ClassLoaderData::_claim_other, we can enable multi-threaded CLDG iteration during heap dump.
> 
> Test:
> 
> - [x] hotspot_gc_shenandoah
> - [x] tier1 with Shenandoah GC

src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp line 263:

> 261:    assert(Thread::current()->is_VM_thread(), "Only by VM thread");
> 262:    // Must use _claim_none to avoid interfering with concurrent CLDG iteration
> 263:    CLDToOopClosure clds(oops, ClassLoaderData::_claim_other);

Nit: Update/remove comment? `Must use _claim_none ...` seems to conflict with code.

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

PR: https://git.openjdk.java.net/jdk/pull/5473



More information about the hotspot-gc-dev mailing list