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