< prev index next >

src/hotspot/share/gc/shared/gcVMOperations.cpp

Print this page




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




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


< prev index next >