RFR: Revert "Print special cause for Metadata GC"
Roman Kennke
rkennke at redhat.com
Sun Nov 4 20:32:53 UTC 2018
Ok.
Roman
> Zhengyu got it right originally, we need to print "Trigger" in heuristics, otherwise we break the UX
> invariant that every cycle has a Trigger. This is a clean revert of:
> http://hg.openjdk.java.net/shenandoah/jdk/rev/08b968d6f8af.
>
> diff -r 9cf8cbfd3ba1 src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp
> --- a/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp Sat Nov 03 23:59:21 2018 +0100
> +++ b/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp Sun Nov 04 20:36:33 2018 +0100
> @@ -179,15 +179,10 @@
>
> bool gc_requested = (mode != none);
> assert (!gc_requested || cause != GCCause::_last_gc_cause, "GC cause should be set");
>
> if (gc_requested) {
> - if (heuristics->has_metaspace_oom()) {
> - // Some of vmTestbase/metaspace tests depend on following line to count GC cycles
> - log_info(gc)("Cause: %s", GCCause::to_string(GCCause::_metadata_GC_threshold));
> - }
> -
> heap->reset_bytes_allocated_since_gc_start();
>
> // If GC was requested, we are sampling the counters even without actual triggers
> // from allocation machinery. This captures GC phases more accurately.
> set_forced_counters_update(true);
> diff -r 9cf8cbfd3ba1 src/hotspot/share/gc/shenandoah/shenandoahHeuristics.cpp
> --- a/src/hotspot/share/gc/shenandoah/shenandoahHeuristics.cpp Sat Nov 03 23:59:21 2018 +0100
> +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeuristics.cpp Sun Nov 04 20:36:33 2018 +0100
> @@ -228,11 +228,14 @@
> bool ShenandoahHeuristics::should_start_update_refs() {
> return _update_refs_early;
> }
>
> bool ShenandoahHeuristics::should_start_normal_gc() const {
> + // Perform GC to cleanup metaspace
> if (has_metaspace_oom()) {
> + // Some of vmTestbase/metaspace tests depend on following line to count GC cycles
> + log_info(gc)("Trigger: %s", GCCause::to_string(GCCause::_metadata_GC_threshold));
> return true;
> }
>
> double last_time_ms = (os::elapsedTime() - _last_cycle_end) * 1000;
> bool periodic_gc = (last_time_ms > ShenandoahGuaranteedGCInterval);
>
>
> Testing: tier3_gc_shenandoah, vmTestbase/metaspace
>
> Thanks,
> -Aleksey
>
More information about the shenandoah-dev
mailing list