src/hotspot/share/gc/g1/g1CollectedHeap.cpp
changeset 52918 f94c7929a44b
parent 52905 bec57b4a6d69
child 52955 f0f3dc30e3bb
equal deleted inserted replaced
52917:0c637249d934 52918:f94c7929a44b
  1148   bool dummy = do_full_collection(true,                /* explicit_gc */
  1148   bool dummy = do_full_collection(true,                /* explicit_gc */
  1149                                   clear_all_soft_refs);
  1149                                   clear_all_soft_refs);
  1150 }
  1150 }
  1151 
  1151 
  1152 void G1CollectedHeap::resize_heap_if_necessary() {
  1152 void G1CollectedHeap::resize_heap_if_necessary() {
       
  1153   assert_at_safepoint_on_vm_thread();
       
  1154 
  1153   // Capacity, free and used after the GC counted as full regions to
  1155   // Capacity, free and used after the GC counted as full regions to
  1154   // include the waste in the following calculations.
  1156   // include the waste in the following calculations.
  1155   const size_t capacity_after_gc = capacity();
  1157   const size_t capacity_after_gc = capacity();
  1156   const size_t used_after_gc = capacity_after_gc - unused_committed_regions_in_bytes();
  1158   const size_t used_after_gc = capacity_after_gc - unused_committed_regions_in_bytes();
  1157 
  1159 
  1989 
  1991 
  1990 bool G1CollectedHeap::should_do_concurrent_full_gc(GCCause::Cause cause) {
  1992 bool G1CollectedHeap::should_do_concurrent_full_gc(GCCause::Cause cause) {
  1991   switch (cause) {
  1993   switch (cause) {
  1992     case GCCause::_gc_locker:               return GCLockerInvokesConcurrent;
  1994     case GCCause::_gc_locker:               return GCLockerInvokesConcurrent;
  1993     case GCCause::_g1_humongous_allocation: return true;
  1995     case GCCause::_g1_humongous_allocation: return true;
       
  1996     case GCCause::_g1_periodic_collection:  return G1PeriodicGCInvokesConcurrent;
  1994     default:                                return is_user_requested_concurrent_full_gc(cause);
  1997     default:                                return is_user_requested_concurrent_full_gc(cause);
  1995   }
  1998   }
  1996 }
  1999 }
  1997 
  2000 
  1998 #ifndef PRODUCT
  2001 #ifndef PRODUCT