< prev index next >

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

Print this page


 223     _gc_heap_log = NULL;
 224   }
 225 }
 226 
 227 // This interface assumes that it's being called by the
 228 // vm thread. It collects the heap assuming that the
 229 // heap lock is already held and that we are executing in
 230 // the context of the vm thread.
 231 void CollectedHeap::collect_as_vm_thread(GCCause::Cause cause) {
 232   assert(Thread::current()->is_VM_thread(), "Precondition#1");
 233   assert(Heap_lock->is_locked(), "Precondition#2");
 234   GCCauseSetter gcs(this, cause);
 235   switch (cause) {
 236     case GCCause::_heap_inspection:
 237     case GCCause::_heap_dump:
 238     case GCCause::_metadata_GC_threshold : {
 239       HandleMark hm;
 240       do_full_collection(false);        // don't clear all soft refs
 241       break;
 242     }

 243     case GCCause::_metadata_GC_clear_soft_refs: {
 244       HandleMark hm;
 245       do_full_collection(true);         // do clear all soft refs
 246       break;
 247     }
 248     default:
 249       ShouldNotReachHere(); // Unexpected use of this function
 250   }
 251 }
 252 
 253 MetaWord* CollectedHeap::satisfy_failed_metadata_allocation(ClassLoaderData* loader_data,
 254                                                             size_t word_size,
 255                                                             Metaspace::MetadataType mdtype) {
 256   uint loop_count = 0;
 257   uint gc_count = 0;
 258   uint full_gc_count = 0;
 259 
 260   assert(!Heap_lock->owned_by_self(), "Should not be holding the Heap_lock");
 261 
 262   do {




 223     _gc_heap_log = NULL;
 224   }
 225 }
 226 
 227 // This interface assumes that it's being called by the
 228 // vm thread. It collects the heap assuming that the
 229 // heap lock is already held and that we are executing in
 230 // the context of the vm thread.
 231 void CollectedHeap::collect_as_vm_thread(GCCause::Cause cause) {
 232   assert(Thread::current()->is_VM_thread(), "Precondition#1");
 233   assert(Heap_lock->is_locked(), "Precondition#2");
 234   GCCauseSetter gcs(this, cause);
 235   switch (cause) {
 236     case GCCause::_heap_inspection:
 237     case GCCause::_heap_dump:
 238     case GCCause::_metadata_GC_threshold : {
 239       HandleMark hm;
 240       do_full_collection(false);        // don't clear all soft refs
 241       break;
 242     }
 243     case GCCause::_archive_time_gc:
 244     case GCCause::_metadata_GC_clear_soft_refs: {
 245       HandleMark hm;
 246       do_full_collection(true);         // do clear all soft refs
 247       break;
 248     }
 249     default:
 250       ShouldNotReachHere(); // Unexpected use of this function
 251   }
 252 }
 253 
 254 MetaWord* CollectedHeap::satisfy_failed_metadata_allocation(ClassLoaderData* loader_data,
 255                                                             size_t word_size,
 256                                                             Metaspace::MetadataType mdtype) {
 257   uint loop_count = 0;
 258   uint gc_count = 0;
 259   uint full_gc_count = 0;
 260 
 261   assert(!Heap_lock->owned_by_self(), "Should not be holding the Heap_lock");
 262 
 263   do {


< prev index next >