[15] RFR 8243564: Shenandoah: Add degen entry after concurrent weak roots
Zhengyu Gu
zgu at redhat.com
Fri Apr 24 19:11:39 UTC 2020
On 4/24/20 2:42 PM, Aleksey Shipilev wrote:
> 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.
>
_degenerated_weak_roots is the only entry point that carries flags, we
cleanup those flags there.
> *) 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()) {
We are trying to disarm nmethods that armed for concurrent marking. If
we get to here due to degenerated_mark,
is_concurrent_unloading_in_progress flag may not be set, but we still
need to disarm nmethods here.
>
> *) 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
>
concurrent version is more expensive than STW version (different
implementation)
-Zhengyu
More information about the shenandoah-dev
mailing list