< prev index next >

src/share/vm/gc/parallel/parallelScavengeHeap.hpp

Print this page




  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_PARALLEL_PARALLELSCAVENGEHEAP_HPP
  26 #define SHARE_VM_GC_PARALLEL_PARALLELSCAVENGEHEAP_HPP
  27 
  28 #include "gc/parallel/generationSizer.hpp"
  29 #include "gc/parallel/objectStartArray.hpp"
  30 #include "gc/parallel/psGCAdaptivePolicyCounters.hpp"
  31 #include "gc/parallel/psOldGen.hpp"
  32 #include "gc/parallel/psYoungGen.hpp"
  33 #include "gc/shared/collectedHeap.hpp"
  34 #include "gc/shared/collectorPolicy.hpp"
  35 #include "gc/shared/gcPolicyCounters.hpp"
  36 #include "gc/shared/gcWhen.hpp"
  37 #include "gc/shared/strongRootsScope.hpp"

  38 #include "utilities/ostream.hpp"
  39 
  40 class AdjoiningGenerations;
  41 class GCHeapSummary;
  42 class GCTaskManager;
  43 class PSAdaptiveSizePolicy;
  44 class PSHeapSummary;
  45 
  46 class ParallelScavengeHeap : public CollectedHeap {
  47   friend class VMStructs;
  48  private:
  49   static PSYoungGen* _young_gen;
  50   static PSOldGen*   _old_gen;
  51 
  52   // Sizing policy for entire heap
  53   static PSAdaptiveSizePolicy*       _size_policy;
  54   static PSGCAdaptivePolicyCounters* _gc_policy_counters;
  55 
  56   GenerationSizer* _collector_policy;
  57 


 198   // initializing stores to an object at this address.
 199   virtual bool can_elide_initializing_store_barrier(oop new_obj);
 200 
 201   void object_iterate(ObjectClosure* cl);
 202   void safe_object_iterate(ObjectClosure* cl) { object_iterate(cl); }
 203 
 204   HeapWord* block_start(const void* addr) const;
 205   size_t block_size(const HeapWord* addr) const;
 206   bool block_is_obj(const HeapWord* addr) const;
 207 
 208   jlong millis_since_last_gc();
 209 
 210   void prepare_for_verify();
 211   PSHeapSummary create_ps_heap_summary();
 212   virtual void print_on(outputStream* st) const;
 213   virtual void print_on_error(outputStream* st) const;
 214   virtual void print_gc_threads_on(outputStream* st) const;
 215   virtual void gc_threads_do(ThreadClosure* tc) const;
 216   virtual void print_tracing_info() const;
 217 
 218   void verify(bool silent, VerifyOption option /* ignored */);
 219 
 220   void print_heap_change(size_t prev_used);
 221 
 222   // Resize the young generation.  The reserved space for the
 223   // generation may be expanded in preparation for the resize.
 224   void resize_young_gen(size_t eden_size, size_t survivor_size);
 225 
 226   // Resize the old generation.  The reserved space for the
 227   // generation may be expanded in preparation for the resize.
 228   void resize_old_gen(size_t desired_free_space);
 229 
 230   // Save the tops of the spaces in all generations
 231   void record_gen_tops_before_GC() PRODUCT_RETURN;
 232 
 233   // Mangle the unused parts of all spaces in the heap
 234   void gen_mangle_unused_area() PRODUCT_RETURN;
 235 
 236   // Call these in sequential code around the processing of strong roots.
 237   class ParStrongRootsScope : public MarkScope {
 238    public:
 239     ParStrongRootsScope();
 240     ~ParStrongRootsScope();
 241   };






















 242 };
 243 
 244 #endif // SHARE_VM_GC_PARALLEL_PARALLELSCAVENGEHEAP_HPP


  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_PARALLEL_PARALLELSCAVENGEHEAP_HPP
  26 #define SHARE_VM_GC_PARALLEL_PARALLELSCAVENGEHEAP_HPP
  27 
  28 #include "gc/parallel/generationSizer.hpp"
  29 #include "gc/parallel/objectStartArray.hpp"
  30 #include "gc/parallel/psGCAdaptivePolicyCounters.hpp"
  31 #include "gc/parallel/psOldGen.hpp"
  32 #include "gc/parallel/psYoungGen.hpp"
  33 #include "gc/shared/collectedHeap.hpp"
  34 #include "gc/shared/collectorPolicy.hpp"
  35 #include "gc/shared/gcPolicyCounters.hpp"
  36 #include "gc/shared/gcWhen.hpp"
  37 #include "gc/shared/strongRootsScope.hpp"
  38 #include "memory/metaspace.hpp"
  39 #include "utilities/ostream.hpp"
  40 
  41 class AdjoiningGenerations;
  42 class GCHeapSummary;
  43 class GCTaskManager;
  44 class PSAdaptiveSizePolicy;
  45 class PSHeapSummary;
  46 
  47 class ParallelScavengeHeap : public CollectedHeap {
  48   friend class VMStructs;
  49  private:
  50   static PSYoungGen* _young_gen;
  51   static PSOldGen*   _old_gen;
  52 
  53   // Sizing policy for entire heap
  54   static PSAdaptiveSizePolicy*       _size_policy;
  55   static PSGCAdaptivePolicyCounters* _gc_policy_counters;
  56 
  57   GenerationSizer* _collector_policy;
  58 


 199   // initializing stores to an object at this address.
 200   virtual bool can_elide_initializing_store_barrier(oop new_obj);
 201 
 202   void object_iterate(ObjectClosure* cl);
 203   void safe_object_iterate(ObjectClosure* cl) { object_iterate(cl); }
 204 
 205   HeapWord* block_start(const void* addr) const;
 206   size_t block_size(const HeapWord* addr) const;
 207   bool block_is_obj(const HeapWord* addr) const;
 208 
 209   jlong millis_since_last_gc();
 210 
 211   void prepare_for_verify();
 212   PSHeapSummary create_ps_heap_summary();
 213   virtual void print_on(outputStream* st) const;
 214   virtual void print_on_error(outputStream* st) const;
 215   virtual void print_gc_threads_on(outputStream* st) const;
 216   virtual void gc_threads_do(ThreadClosure* tc) const;
 217   virtual void print_tracing_info() const;
 218 
 219   void verify(VerifyOption option /* ignored */);


 220 
 221   // Resize the young generation.  The reserved space for the
 222   // generation may be expanded in preparation for the resize.
 223   void resize_young_gen(size_t eden_size, size_t survivor_size);
 224 
 225   // Resize the old generation.  The reserved space for the
 226   // generation may be expanded in preparation for the resize.
 227   void resize_old_gen(size_t desired_free_space);
 228 
 229   // Save the tops of the spaces in all generations
 230   void record_gen_tops_before_GC() PRODUCT_RETURN;
 231 
 232   // Mangle the unused parts of all spaces in the heap
 233   void gen_mangle_unused_area() PRODUCT_RETURN;
 234 
 235   // Call these in sequential code around the processing of strong roots.
 236   class ParStrongRootsScope : public MarkScope {
 237    public:
 238     ParStrongRootsScope();
 239     ~ParStrongRootsScope();
 240   };
 241 };
 242 
 243 // Simple class for storing info about the heap at the start of GC, to be used
 244 // after GC for comparison/printing.
 245 class PreGCValues {
 246 public:
 247   PreGCValues(ParallelScavengeHeap* heap) :
 248       _heap_used(heap->used()),
 249       _young_gen_used(heap->young_gen()->used_in_bytes()),
 250       _old_gen_used(heap->old_gen()->used_in_bytes()),
 251       _metadata_used(MetaspaceAux::used_bytes()) { };
 252 
 253   size_t heap_used() const      { return _heap_used; }
 254   size_t young_gen_used() const { return _young_gen_used; }
 255   size_t old_gen_used() const   { return _old_gen_used; }
 256   size_t metadata_used() const  { return _metadata_used; }
 257 
 258 private:
 259   size_t _heap_used;
 260   size_t _young_gen_used;
 261   size_t _old_gen_used;
 262   size_t _metadata_used;
 263 };
 264 
 265 #endif // SHARE_VM_GC_PARALLEL_PARALLELSCAVENGEHEAP_HPP
< prev index next >