src/share/vm/memory/tenuredGeneration.hpp

Print this page


   1 /*
   2  * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  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 // TenuredGeneration models the heap containing old (promoted/tenured) objects.
  26 
  27 class ParGCAllocBufferWithBOT;
  28 
  29 class TenuredGeneration: public OneContigSpaceCardGeneration {
  30   friend class VMStructs;
  31  protected:
  32   // current shrinking effect: this damps shrinking when the heap gets empty.
  33   size_t _shrink_factor;
  34   // Some statistics from before gc started.
  35   // These are gathered in the gc_prologue (and should_collect)
  36   // to control growing/shrinking policy in spite of promotions.
  37   size_t _capacity_at_prologue;
  38   size_t _used_at_prologue;
  39 
  40 #ifndef SERIALGC
  41   // To support parallel promotion: an array of parallel allocation
  42   // buffers, one per thread, initially NULL.
  43   ParGCAllocBufferWithBOT** _alloc_buffers;
  44 #endif // SERIALGC


  89   // Overrides.
  90   virtual oop par_promote(int thread_num,
  91                           oop obj, markOop m, size_t word_sz);
  92   virtual void par_promote_alloc_undo(int thread_num,
  93                                       HeapWord* obj, size_t word_sz);
  94   virtual void par_promote_alloc_done(int thread_num);
  95 #endif // SERIALGC
  96 
  97   // Performance Counter support
  98   void update_counters();
  99 
 100   // Statistics
 101 
 102   virtual void update_gc_stats(int level, bool full);
 103 
 104   virtual bool promotion_attempt_is_safe(size_t max_promoted_in_bytes,
 105     bool younger_handles_promotion_failure) const;
 106 
 107   void verify_alloc_buffers_clean();
 108 };


   1 /*
   2  * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  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_VM_MEMORY_TENUREDGENERATION_HPP
  26 #define SHARE_VM_MEMORY_TENUREDGENERATION_HPP
  27 
  28 #include "gc_implementation/shared/cSpaceCounters.hpp"
  29 #include "gc_implementation/shared/gcStats.hpp"
  30 #include "gc_implementation/shared/generationCounters.hpp"
  31 #include "memory/generation.hpp"
  32 
  33 // TenuredGeneration models the heap containing old (promoted/tenured) objects.
  34 
  35 class ParGCAllocBufferWithBOT;
  36 
  37 class TenuredGeneration: public OneContigSpaceCardGeneration {
  38   friend class VMStructs;
  39  protected:
  40   // current shrinking effect: this damps shrinking when the heap gets empty.
  41   size_t _shrink_factor;
  42   // Some statistics from before gc started.
  43   // These are gathered in the gc_prologue (and should_collect)
  44   // to control growing/shrinking policy in spite of promotions.
  45   size_t _capacity_at_prologue;
  46   size_t _used_at_prologue;
  47 
  48 #ifndef SERIALGC
  49   // To support parallel promotion: an array of parallel allocation
  50   // buffers, one per thread, initially NULL.
  51   ParGCAllocBufferWithBOT** _alloc_buffers;
  52 #endif // SERIALGC


  97   // Overrides.
  98   virtual oop par_promote(int thread_num,
  99                           oop obj, markOop m, size_t word_sz);
 100   virtual void par_promote_alloc_undo(int thread_num,
 101                                       HeapWord* obj, size_t word_sz);
 102   virtual void par_promote_alloc_done(int thread_num);
 103 #endif // SERIALGC
 104 
 105   // Performance Counter support
 106   void update_counters();
 107 
 108   // Statistics
 109 
 110   virtual void update_gc_stats(int level, bool full);
 111 
 112   virtual bool promotion_attempt_is_safe(size_t max_promoted_in_bytes,
 113     bool younger_handles_promotion_failure) const;
 114 
 115   void verify_alloc_buffers_clean();
 116 };
 117 
 118 #endif // SHARE_VM_MEMORY_TENUREDGENERATION_HPP