[15] RFR 8243564: Shenandoah: Add degen entry after concurrent weak roots

Aleksey Shipilev shade at redhat.com
Fri Apr 24 18:42:33 UTC 2020


On 4/24/20 6:50 PM, Zhengyu Gu wrote:
> When Shenandoah encounters OOM during concurrent weak roots, it is 
> better and cheaper to enter degenerated GC and perform STW class 
> unloading than concurrent class unloading.
> 
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-8243564
> Webrev: http://cr.openjdk.java.net/~zgu/JDK-8243564/webrev.00/index.html

This looks good, except a few nits:

 *) Shouldn't we still drop the flags in ShenandoahMarkCompact::do_it? The code in full_gc_prepare
block below makes a point to drop all the flags when going into Full GC.

 *) In op_degenerated here, shouldn't we check for is_concurrent_unloading_in_progress instead?
 1948       if (!has_forwarded_objects() &&
ShenandoahConcurrentRoots::can_do_concurrent_class_unloading()) {

 *) In op_degenerated, I think the point was to call op_*(). Why can't we call
op_conc_class_unloading() and remove this whole block?

1957       // No fallthrough
1958       if (point == _degenerated_weak_roots) {
1959         // Perform STW class unloading
1960         if (is_concurrent_class_unloading_in_progress()) {
1961           stw_unload_classes(false /* full gc*/);
1962           set_concurrent_class_unloading_in_progress(false);
1963         }
1964
1965         // cleanup flags that may be carried into degenerated GC
1966         set_concurrent_weak_root_in_progress(false);
1967         set_concurrent_strong_root_in_progress(false);
1968       }
1969

-- 
Thanks,
-Aleksey



More information about the shenandoah-dev mailing list