diff --git a/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp b/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp index 81ae36121d236da75577feef6d7649d6bfcc9d06..b18e6daf34637946bb98274b93ba559d529407e6 100644 --- a/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp +++ b/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp @@ -236,8 +236,10 @@ void G1GCPhaseTimes::note_gc_end() { _last_gc_worker_times_ms.verify(); _last_gc_worker_other_times_ms.verify(); - _last_redirty_logged_cards_time_ms.verify(); - _last_redirty_logged_cards_processed_cards.verify(); + if (G1DeferredRSUpdate) { + _last_redirty_logged_cards_time_ms.verify(); + _last_redirty_logged_cards_processed_cards.verify(); + } } void G1GCPhaseTimes::note_string_dedup_fixup_start() { diff --git a/test/gc/g1/TestDeferredRSUpdate.java b/test/gc/g1/TestDeferredRSUpdate.java index 7d2ebdc4eb397d086f0b7fe81fee10878a3a4b04..f00967d1df45de99fbf16674eccd1af8dd08827e 100644 --- a/test/gc/g1/TestDeferredRSUpdate.java +++ b/test/gc/g1/TestDeferredRSUpdate.java @@ -23,7 +23,7 @@ /* * @test TestDeferredRSUpdate - * @bug 8040977 + * @bug 8040977 8052170 * @summary Ensure that running with -XX:-G1DeferredRSUpdate does not crash the VM * @key gc * @library /testlibrary @@ -38,6 +38,7 @@ public class TestDeferredRSUpdate { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", "-Xmx10M", + "-XX:+PrintGCDetails", // G1DeferredRSUpdate is a develop option, but we cannot limit execution of this test to only debug VMs. "-XX:+IgnoreUnrecognizedVMOptions", "-XX:-G1DeferredRSUpdate",