< prev index next >

src/share/vm/gc/g1/g1CollectorPolicy.cpp

Print this page
rev 9404 : 8143251: HeapRetentionTest.java Test is failing on jdk9/dev
Reviewed-by:

@@ -1619,10 +1619,15 @@
                   GCCause::to_string(gc_cause));
     return false;
   }
 }
 
+void G1CollectorPolicy::initiate_conc_mark() {
+  collector_state()->set_during_initial_mark_pause(true);
+  collector_state()->set_initiate_conc_mark_if_possible(false);
+}
+
 void G1CollectorPolicy::decide_on_conc_mark_initiation() {
   // We are about to decide on whether this pause will be an
   // initial-mark pause.
 
   // First, collector_state()->during_initial_mark_pause() should not be already set. We

@@ -1635,21 +1640,25 @@
     // We had noticed on a previous pause that the heap occupancy has
     // gone over the initiating threshold and we should start a
     // concurrent marking cycle. So we might initiate one.
 
     if (!about_to_start_mixed_phase() && collector_state()->gcs_are_young()) {
-      // Initiate a new initial mark only if there is no marking or reclamation going
-      // on.
-
-      collector_state()->set_during_initial_mark_pause(true);
-      // And we can now clear initiate_conc_mark_if_possible() as
-      // we've already acted on it.
-      collector_state()->set_initiate_conc_mark_if_possible(false);
-
+      // Initiate a new initial mark if there is no marking or reclamation going on.
+      initiate_conc_mark();
       ergo_verbose0(ErgoConcCycles,
                   "initiate concurrent cycle",
                   ergo_format_reason("concurrent cycle initiation requested"));
+    } else if (_g1->user_requested_concurrent_full_gc(_g1->gc_cause())) {
+      // Initiate a user requested initial mark and update the collector state to
+      // reflect this.
+      collector_state()->set_gcs_are_young(true);
+      collector_state()->set_last_young_gc(false);
+
+      initiate_conc_mark();
+      ergo_verbose0(ErgoConcCycles,
+                    "initiate concurrent cycle",
+                    ergo_format_reason("user requested concurrent cycle"));
     } else {
       // The concurrent marking thread is still finishing up the
       // previous cycle. If we start one right now the two cycles
       // overlap. In particular, the concurrent marking thread might
       // be in the process of clearing the next marking bitmap (which
< prev index next >