src/share/vm/memory/genCollectedHeap.hpp

Print this page




   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 class SubTasksDone;
  26 
  27 // A "GenCollectedHeap" is a SharedHeap that uses generational
  28 // collection.  It is represented with a sequence of Generation's.
  29 class GenCollectedHeap : public SharedHeap {
  30   friend class GenCollectorPolicy;
  31   friend class Generation;
  32   friend class DefNewGeneration;
  33   friend class TenuredGeneration;
  34   friend class ConcurrentMarkSweepGeneration;
  35   friend class CMSCollector;
  36   friend class GenMarkSweep;
  37   friend class VM_GenCollectForAllocation;
  38   friend class VM_GenCollectForPermanentAllocation;
  39   friend class VM_GenCollectFull;
  40   friend class VM_GenCollectFullConcurrent;
  41   friend class VM_GC_HeapInspection;
  42   friend class VM_HeapDumper;
  43   friend class HeapInspection;
  44   friend class GCCauseSetter;


 519   // collect() and collect_locked(). Caller holds the Heap_lock on entry.
 520   void collect_locked(GCCause::Cause cause, int max_level);
 521 
 522   // Returns success or failure.
 523   bool create_cms_collector();
 524 
 525   // In support of ExplicitGCInvokesConcurrent functionality
 526   bool should_do_concurrent_full_gc(GCCause::Cause cause);
 527   void collect_mostly_concurrent(GCCause::Cause cause);
 528 
 529   // Save the tops of the spaces in all generations
 530   void record_gen_tops_before_GC() PRODUCT_RETURN;
 531 
 532 protected:
 533   virtual void gc_prologue(bool full);
 534   virtual void gc_epilogue(bool full);
 535 
 536 public:
 537   virtual void preload_and_dump(TRAPS) KERNEL_RETURN;
 538 };




   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_GENCOLLECTEDHEAP_HPP
  26 #define SHARE_VM_MEMORY_GENCOLLECTEDHEAP_HPP
  27 
  28 #include "gc_implementation/shared/adaptiveSizePolicy.hpp"
  29 #include "memory/collectorPolicy.hpp"
  30 #include "memory/generation.hpp"
  31 #include "memory/sharedHeap.hpp"
  32 
  33 class SubTasksDone;
  34 
  35 // A "GenCollectedHeap" is a SharedHeap that uses generational
  36 // collection.  It is represented with a sequence of Generation's.
  37 class GenCollectedHeap : public SharedHeap {
  38   friend class GenCollectorPolicy;
  39   friend class Generation;
  40   friend class DefNewGeneration;
  41   friend class TenuredGeneration;
  42   friend class ConcurrentMarkSweepGeneration;
  43   friend class CMSCollector;
  44   friend class GenMarkSweep;
  45   friend class VM_GenCollectForAllocation;
  46   friend class VM_GenCollectForPermanentAllocation;
  47   friend class VM_GenCollectFull;
  48   friend class VM_GenCollectFullConcurrent;
  49   friend class VM_GC_HeapInspection;
  50   friend class VM_HeapDumper;
  51   friend class HeapInspection;
  52   friend class GCCauseSetter;


 527   // collect() and collect_locked(). Caller holds the Heap_lock on entry.
 528   void collect_locked(GCCause::Cause cause, int max_level);
 529 
 530   // Returns success or failure.
 531   bool create_cms_collector();
 532 
 533   // In support of ExplicitGCInvokesConcurrent functionality
 534   bool should_do_concurrent_full_gc(GCCause::Cause cause);
 535   void collect_mostly_concurrent(GCCause::Cause cause);
 536 
 537   // Save the tops of the spaces in all generations
 538   void record_gen_tops_before_GC() PRODUCT_RETURN;
 539 
 540 protected:
 541   virtual void gc_prologue(bool full);
 542   virtual void gc_epilogue(bool full);
 543 
 544 public:
 545   virtual void preload_and_dump(TRAPS) KERNEL_RETURN;
 546 };
 547 
 548 #endif // SHARE_VM_MEMORY_GENCOLLECTEDHEAP_HPP