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