< prev index next >

src/share/vm/gc/g1/g1CollectedHeap.inline.hpp

Print this page
rev 8816 : imported patch 8073013-add-detailed-information-about-plab-memory-usage


  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_G1_G1COLLECTEDHEAP_INLINE_HPP
  26 #define SHARE_VM_GC_G1_G1COLLECTEDHEAP_INLINE_HPP
  27 
  28 #include "gc/g1/concurrentMark.hpp"
  29 #include "gc/g1/g1CollectedHeap.hpp"
  30 #include "gc/g1/g1CollectorPolicy.hpp"
  31 #include "gc/g1/g1CollectorState.hpp"
  32 #include "gc/g1/g1SATBCardTableModRefBS.hpp"
  33 #include "gc/g1/heapRegionManager.inline.hpp"
  34 #include "gc/g1/heapRegionSet.inline.hpp"
  35 #include "gc/shared/taskqueue.hpp"
  36 #include "runtime/orderAccess.inline.hpp"
  37 
  38 PLABStats* G1CollectedHeap::alloc_buffer_stats(InCSetState dest) {
  39   switch (dest.value()) {
  40     case InCSetState::Young:
  41       return &_survivor_plab_stats;
  42     case InCSetState::Old:
  43       return &_old_plab_stats;
  44     default:
  45       ShouldNotReachHere();
  46       return NULL; // Keep some compilers happy
  47   }
  48 }
  49 
  50 size_t G1CollectedHeap::desired_plab_sz(InCSetState dest) {
  51   size_t gclab_word_size = alloc_buffer_stats(dest)->desired_plab_sz(G1CollectedHeap::heap()->workers()->active_workers());
  52   // Prevent humongous PLAB sizes for two reasons:
  53   // * PLABs are allocated using a similar paths as oops, but should
  54   //   never be in a humongous region
  55   // * Allowing humongous PLABs needlessly churns the region free lists
  56   return MIN2(_humongous_object_threshold_in_words, gclab_word_size);
  57 }
  58 
  59 // Inline functions for G1CollectedHeap
  60 
  61 inline AllocationContextStats& G1CollectedHeap::allocation_context_stats() {
  62   return _allocation_context_stats;
  63 }




  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_G1_G1COLLECTEDHEAP_INLINE_HPP
  26 #define SHARE_VM_GC_G1_G1COLLECTEDHEAP_INLINE_HPP
  27 
  28 #include "gc/g1/concurrentMark.hpp"
  29 #include "gc/g1/g1CollectedHeap.hpp"
  30 #include "gc/g1/g1CollectorPolicy.hpp"
  31 #include "gc/g1/g1CollectorState.hpp"
  32 #include "gc/g1/g1SATBCardTableModRefBS.hpp"
  33 #include "gc/g1/heapRegionManager.inline.hpp"
  34 #include "gc/g1/heapRegionSet.inline.hpp"
  35 #include "gc/shared/taskqueue.hpp"
  36 #include "runtime/orderAccess.inline.hpp"
  37 
  38 G1EvacStats* G1CollectedHeap::alloc_buffer_stats(InCSetState dest) {
  39   switch (dest.value()) {
  40     case InCSetState::Young:
  41       return &_survivor_evac_stats;
  42     case InCSetState::Old:
  43       return &_old_evac_stats;
  44     default:
  45       ShouldNotReachHere();
  46       return NULL; // Keep some compilers happy
  47   }
  48 }
  49 
  50 size_t G1CollectedHeap::desired_plab_sz(InCSetState dest) {
  51   size_t gclab_word_size = alloc_buffer_stats(dest)->desired_plab_sz(G1CollectedHeap::heap()->workers()->active_workers());
  52   // Prevent humongous PLAB sizes for two reasons:
  53   // * PLABs are allocated using a similar paths as oops, but should
  54   //   never be in a humongous region
  55   // * Allowing humongous PLABs needlessly churns the region free lists
  56   return MIN2(_humongous_object_threshold_in_words, gclab_word_size);
  57 }
  58 
  59 // Inline functions for G1CollectedHeap
  60 
  61 inline AllocationContextStats& G1CollectedHeap::allocation_context_stats() {
  62   return _allocation_context_stats;
  63 }


< prev index next >