132 void VM_GC_HeapInspection::doit() {
133 Universe::heap()->ensure_parsability(false); // must happen, even if collection does
134 // not happen (e.g. due to GCLocker)
135 // or _full_gc being false
136 if (_full_gc) {
137 if (!collect()) {
138 // The collection attempt was skipped because the gc locker is held.
139 // The following dump may then be a tad misleading to someone expecting
140 // only live objects to show up in the dump (see CR 6944195). Just issue
141 // a suitable warning in that case and do not attempt to do a collection.
142 // The latter is a subtle point, because even a failed attempt
143 // to GC will, in fact, induce one in the future, which we
144 // probably want to avoid in this case because the GC that we may
145 // be about to attempt holds value for us only
146 // if it happens now and not if it happens in the eventual
147 // future.
148 log_warning(gc)("GC locker is held; pre-dump GC was skipped");
149 }
150 }
151 HeapInspection inspect;
152 inspect.heap_inspection(_out);
153 }
154
155
156 void VM_GenCollectForAllocation::doit() {
157 SvcGCMarker sgcm(SvcGCMarker::MINOR);
158
159 GenCollectedHeap* gch = GenCollectedHeap::heap();
160 GCCauseSetter gccs(gch, _gc_cause);
161 _result = gch->satisfy_failed_allocation(_word_size, _tlab);
162 assert(_result == NULL || gch->is_in_reserved(_result), "result not in heap");
163
164 if (_result == NULL && GCLocker::is_active_and_needs_gc()) {
165 set_gc_locked();
166 }
167 }
168
169 void VM_GenCollectFull::doit() {
170 SvcGCMarker sgcm(SvcGCMarker::FULL);
171
172 GenCollectedHeap* gch = GenCollectedHeap::heap();
|
132 void VM_GC_HeapInspection::doit() {
133 Universe::heap()->ensure_parsability(false); // must happen, even if collection does
134 // not happen (e.g. due to GCLocker)
135 // or _full_gc being false
136 if (_full_gc) {
137 if (!collect()) {
138 // The collection attempt was skipped because the gc locker is held.
139 // The following dump may then be a tad misleading to someone expecting
140 // only live objects to show up in the dump (see CR 6944195). Just issue
141 // a suitable warning in that case and do not attempt to do a collection.
142 // The latter is a subtle point, because even a failed attempt
143 // to GC will, in fact, induce one in the future, which we
144 // probably want to avoid in this case because the GC that we may
145 // be about to attempt holds value for us only
146 // if it happens now and not if it happens in the eventual
147 // future.
148 log_warning(gc)("GC locker is held; pre-dump GC was skipped");
149 }
150 }
151 HeapInspection inspect;
152 inspect.heap_inspection(_out, _parallel_thread_num);
153 }
154
155
156 void VM_GenCollectForAllocation::doit() {
157 SvcGCMarker sgcm(SvcGCMarker::MINOR);
158
159 GenCollectedHeap* gch = GenCollectedHeap::heap();
160 GCCauseSetter gccs(gch, _gc_cause);
161 _result = gch->satisfy_failed_allocation(_word_size, _tlab);
162 assert(_result == NULL || gch->is_in_reserved(_result), "result not in heap");
163
164 if (_result == NULL && GCLocker::is_active_and_needs_gc()) {
165 set_gc_locked();
166 }
167 }
168
169 void VM_GenCollectFull::doit() {
170 SvcGCMarker sgcm(SvcGCMarker::FULL);
171
172 GenCollectedHeap* gch = GenCollectedHeap::heap();
|