< prev index next >

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

Print this page
rev 53926 : imported patch 8219748-add-and-use-timing-object


  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  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_GC_G1_G1COLLECTEDHEAP_INLINE_HPP
  26 #define SHARE_GC_G1_G1COLLECTEDHEAP_INLINE_HPP
  27 
  28 #include "gc/g1/g1BarrierSet.hpp"
  29 #include "gc/g1/g1CollectedHeap.hpp"
  30 #include "gc/g1/g1CollectorState.hpp"

  31 #include "gc/g1/heapRegionManager.inline.hpp"
  32 #include "gc/g1/heapRegionSet.inline.hpp"
  33 #include "gc/shared/taskqueue.inline.hpp"
  34 #include "runtime/orderAccess.hpp"




  35 
  36 G1EvacStats* G1CollectedHeap::alloc_buffer_stats(InCSetState dest) {
  37   switch (dest.value()) {
  38     case InCSetState::Young:
  39       return &_survivor_evac_stats;
  40     case InCSetState::Old:
  41       return &_old_evac_stats;
  42     default:
  43       ShouldNotReachHere();
  44       return NULL; // Keep some compilers happy
  45   }
  46 }
  47 
  48 size_t G1CollectedHeap::desired_plab_sz(InCSetState dest) {
  49   size_t gclab_word_size = alloc_buffer_stats(dest)->desired_plab_sz(workers()->active_workers());
  50   // Prevent humongous PLAB sizes for two reasons:
  51   // * PLABs are allocated using a similar paths as oops, but should
  52   //   never be in a humongous region
  53   // * Allowing humongous PLABs needlessly churns the region free lists
  54   return MIN2(_humongous_object_threshold_in_words, gclab_word_size);




  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  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_GC_G1_G1COLLECTEDHEAP_INLINE_HPP
  26 #define SHARE_GC_G1_G1COLLECTEDHEAP_INLINE_HPP
  27 
  28 #include "gc/g1/g1BarrierSet.hpp"
  29 #include "gc/g1/g1CollectedHeap.hpp"
  30 #include "gc/g1/g1CollectorState.hpp"
  31 #include "gc/g1/g1Policy.hpp"
  32 #include "gc/g1/heapRegionManager.inline.hpp"
  33 #include "gc/g1/heapRegionSet.inline.hpp"
  34 #include "gc/shared/taskqueue.inline.hpp"
  35 #include "runtime/orderAccess.hpp"
  36 
  37 G1GCPhaseTimes* G1CollectedHeap::phase_times() const {
  38   return _policy->phase_times();
  39 }
  40 
  41 G1EvacStats* G1CollectedHeap::alloc_buffer_stats(InCSetState dest) {
  42   switch (dest.value()) {
  43     case InCSetState::Young:
  44       return &_survivor_evac_stats;
  45     case InCSetState::Old:
  46       return &_old_evac_stats;
  47     default:
  48       ShouldNotReachHere();
  49       return NULL; // Keep some compilers happy
  50   }
  51 }
  52 
  53 size_t G1CollectedHeap::desired_plab_sz(InCSetState dest) {
  54   size_t gclab_word_size = alloc_buffer_stats(dest)->desired_plab_sz(workers()->active_workers());
  55   // Prevent humongous PLAB sizes for two reasons:
  56   // * PLABs are allocated using a similar paths as oops, but should
  57   //   never be in a humongous region
  58   // * Allowing humongous PLABs needlessly churns the region free lists
  59   return MIN2(_humongous_object_threshold_in_words, gclab_word_size);


< prev index next >