comparison src/share/vm/gc_implementation/g1/vm_operations_g1.cpp @ 3773:5130fa1b24f1

7045751: G1: +ExplicitGCInvokesConcurrent causes excessive single region evacuation pauses Summary: When ExplicitGCInvokesConcurrent is enabled, do not perform an evacuation pause if a marking cycle is already in progress and block the requesting thread until the marking cycle completes. Reviewed-by: tonyp, ysr
author johnc
date Wed, 15 Jun 2011 10:18:04 -0700
parents 1d1603768966
children 20213c8a3c40
comparison
equal deleted inserted replaced
3772:6747fd0512e0 3773:5130fa1b24f1
97 _full_collections_completed_before = g1h->full_collections_completed(); 97 _full_collections_completed_before = g1h->full_collections_completed();
98 98
99 // At this point we are supposed to start a concurrent cycle. We 99 // At this point we are supposed to start a concurrent cycle. We
100 // will do so if one is not already in progress. 100 // will do so if one is not already in progress.
101 bool res = g1h->g1_policy()->force_initial_mark_if_outside_cycle(); 101 bool res = g1h->g1_policy()->force_initial_mark_if_outside_cycle();
102
103 // The above routine returns true if we were able to force the
104 // next GC pause to be an initial mark; it returns false if a
105 // marking cycle is already in progress.
106 //
107 // If a marking cycle is already in progress just return and skip
108 // the pause - the requesting thread should block in doit_epilogue
109 // until the marking cycle is complete.
110 if (!res) {
111 assert(_word_size == 0, "ExplicitGCInvokesConcurrent shouldn't be allocating");
112 return;
113 }
102 } 114 }
103 115
104 _pause_succeeded = 116 _pause_succeeded =
105 g1h->do_collection_pause_at_safepoint(_target_pause_time_ms); 117 g1h->do_collection_pause_at_safepoint(_target_pause_time_ms);
106 if (_pause_succeeded && _word_size > 0) { 118 if (_pause_succeeded && _word_size > 0) {