53 void VM_G1CollectFull::doit() { 54 G1CollectedHeap* g1h = G1CollectedHeap::heap(); 55 GCCauseSetter x(g1h, _gc_cause); 56 g1h->do_full_collection(false /* clear_all_soft_refs */); 57 } 58 59 VM_G1IncCollectionPause::VM_G1IncCollectionPause( 60 unsigned int gc_count_before, 61 size_t word_size, 62 bool should_initiate_conc_mark, 63 double target_pause_time_ms, 64 GCCause::Cause gc_cause) 65 : VM_G1OperationWithAllocRequest(gc_count_before, word_size, gc_cause), 66 _should_initiate_conc_mark(should_initiate_conc_mark), 67 _target_pause_time_ms(target_pause_time_ms), 68 _should_retry_gc(false), 69 _old_marking_cycles_completed_before(0) { 70 guarantee(target_pause_time_ms > 0.0, 71 err_msg("target_pause_time_ms = %1.6lf should be positive", 72 target_pause_time_ms)); 73 guarantee(word_size == 0 || gc_cause == GCCause::_g1_inc_collection_pause, 74 "we can only request an allocation if the GC cause is for " 75 "an incremental GC pause"); 76 _gc_cause = gc_cause; 77 } 78 79 bool VM_G1IncCollectionPause::doit_prologue() { 80 bool res = VM_GC_Operation::doit_prologue(); 81 if (!res) { 82 if (_should_initiate_conc_mark) { 83 // The prologue can fail for a couple of reasons. The first is that another GC 84 // got scheduled and prevented the scheduling of the initial mark GC. The 85 // second is that the GC locker may be active and the heap can't be expanded. 86 // In both cases we want to retry the GC so that the initial mark pause is 87 // actually scheduled. In the second case, however, we should stall until 88 // until the GC locker is no longer active and then retry the initial mark GC. 89 _should_retry_gc = true; 90 } 91 } 92 return res; 93 } 94 95 void VM_G1IncCollectionPause::doit() { | 53 void VM_G1CollectFull::doit() { 54 G1CollectedHeap* g1h = G1CollectedHeap::heap(); 55 GCCauseSetter x(g1h, _gc_cause); 56 g1h->do_full_collection(false /* clear_all_soft_refs */); 57 } 58 59 VM_G1IncCollectionPause::VM_G1IncCollectionPause( 60 unsigned int gc_count_before, 61 size_t word_size, 62 bool should_initiate_conc_mark, 63 double target_pause_time_ms, 64 GCCause::Cause gc_cause) 65 : VM_G1OperationWithAllocRequest(gc_count_before, word_size, gc_cause), 66 _should_initiate_conc_mark(should_initiate_conc_mark), 67 _target_pause_time_ms(target_pause_time_ms), 68 _should_retry_gc(false), 69 _old_marking_cycles_completed_before(0) { 70 guarantee(target_pause_time_ms > 0.0, 71 err_msg("target_pause_time_ms = %1.6lf should be positive", 72 target_pause_time_ms)); 73 _gc_cause = gc_cause; 74 } 75 76 bool VM_G1IncCollectionPause::doit_prologue() { 77 bool res = VM_GC_Operation::doit_prologue(); 78 if (!res) { 79 if (_should_initiate_conc_mark) { 80 // The prologue can fail for a couple of reasons. The first is that another GC 81 // got scheduled and prevented the scheduling of the initial mark GC. The 82 // second is that the GC locker may be active and the heap can't be expanded. 83 // In both cases we want to retry the GC so that the initial mark pause is 84 // actually scheduled. In the second case, however, we should stall until 85 // until the GC locker is no longer active and then retry the initial mark GC. 86 _should_retry_gc = true; 87 } 88 } 89 return res; 90 } 91 92 void VM_G1IncCollectionPause::doit() { |