hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
changeset 9334 640f1a6f0b85
parent 8928 e5c53268bef5
child 9338 05ee447bd420
equal deleted inserted replaced
9186:7e9f22667cfc 9334:640f1a6f0b85
  2111   return
  2111   return
  2112     ((cause == GCCause::_gc_locker           && GCLockerInvokesConcurrent) ||
  2112     ((cause == GCCause::_gc_locker           && GCLockerInvokesConcurrent) ||
  2113      (cause == GCCause::_java_lang_system_gc && ExplicitGCInvokesConcurrent));
  2113      (cause == GCCause::_java_lang_system_gc && ExplicitGCInvokesConcurrent));
  2114 }
  2114 }
  2115 
  2115 
       
  2116 #ifndef PRODUCT
       
  2117 void G1CollectedHeap::allocate_dummy_regions() {
       
  2118   // Let's fill up most of the region
       
  2119   size_t word_size = HeapRegion::GrainWords - 1024;
       
  2120   // And as a result the region we'll allocate will be humongous.
       
  2121   guarantee(isHumongous(word_size), "sanity");
       
  2122 
       
  2123   for (uintx i = 0; i < G1DummyRegionsPerGC; ++i) {
       
  2124     // Let's use the existing mechanism for the allocation
       
  2125     HeapWord* dummy_obj = humongous_obj_allocate(word_size);
       
  2126     if (dummy_obj != NULL) {
       
  2127       MemRegion mr(dummy_obj, word_size);
       
  2128       CollectedHeap::fill_with_object(mr);
       
  2129     } else {
       
  2130       // If we can't allocate once, we probably cannot allocate
       
  2131       // again. Let's get out of the loop.
       
  2132       break;
       
  2133     }
       
  2134   }
       
  2135 }
       
  2136 #endif // !PRODUCT
       
  2137 
  2116 void G1CollectedHeap::increment_full_collections_completed(bool concurrent) {
  2138 void G1CollectedHeap::increment_full_collections_completed(bool concurrent) {
  2117   MonitorLockerEx x(FullGCCount_lock, Mutex::_no_safepoint_check_flag);
  2139   MonitorLockerEx x(FullGCCount_lock, Mutex::_no_safepoint_check_flag);
  2118 
  2140 
  2119   // We assume that if concurrent == true, then the caller is a
  2141   // We assume that if concurrent == true, then the caller is a
  2120   // concurrent thread that was joined the Suspendible Thread
  2142   // concurrent thread that was joined the Suspendible Thread
  3335         // running. Note: of course, the actual marking work will
  3357         // running. Note: of course, the actual marking work will
  3336         // not start until the safepoint itself is released in
  3358         // not start until the safepoint itself is released in
  3337         // ConcurrentGCThread::safepoint_desynchronize().
  3359         // ConcurrentGCThread::safepoint_desynchronize().
  3338         doConcurrentMark();
  3360         doConcurrentMark();
  3339       }
  3361       }
       
  3362 
       
  3363       allocate_dummy_regions();
  3340 
  3364 
  3341 #if YOUNG_LIST_VERBOSE
  3365 #if YOUNG_LIST_VERBOSE
  3342       gclog_or_tty->print_cr("\nEnd of the pause.\nYoung_list:");
  3366       gclog_or_tty->print_cr("\nEnd of the pause.\nYoung_list:");
  3343       _young_list->print();
  3367       _young_list->print();
  3344       g1_policy()->print_collection_set(g1_policy()->inc_cset_head(), gclog_or_tty);
  3368       g1_policy()->print_collection_set(g1_policy()->inc_cset_head(), gclog_or_tty);