hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.hpp
changeset 35061 be6025ebffea
parent 32735 c6063d028c3c
child 41283 2615c024f3eb
equal deleted inserted replaced
35060:382d0689141c 35061:be6025ebffea
    33 #include "gc/shared/collectedHeap.hpp"
    33 #include "gc/shared/collectedHeap.hpp"
    34 #include "gc/shared/collectorPolicy.hpp"
    34 #include "gc/shared/collectorPolicy.hpp"
    35 #include "gc/shared/gcPolicyCounters.hpp"
    35 #include "gc/shared/gcPolicyCounters.hpp"
    36 #include "gc/shared/gcWhen.hpp"
    36 #include "gc/shared/gcWhen.hpp"
    37 #include "gc/shared/strongRootsScope.hpp"
    37 #include "gc/shared/strongRootsScope.hpp"
       
    38 #include "memory/metaspace.hpp"
    38 #include "utilities/ostream.hpp"
    39 #include "utilities/ostream.hpp"
    39 
    40 
    40 class AdjoiningGenerations;
    41 class AdjoiningGenerations;
    41 class GCHeapSummary;
    42 class GCHeapSummary;
    42 class GCTaskManager;
    43 class GCTaskManager;
    83     MarkSweep
    84     MarkSweep
    84   };
    85   };
    85 
    86 
    86   virtual Name kind() const {
    87   virtual Name kind() const {
    87     return CollectedHeap::ParallelScavengeHeap;
    88     return CollectedHeap::ParallelScavengeHeap;
       
    89   }
       
    90 
       
    91   virtual const char* name() const {
       
    92     return "Parallel";
    88   }
    93   }
    89 
    94 
    90   virtual CollectorPolicy* collector_policy() const { return _collector_policy; }
    95   virtual CollectorPolicy* collector_policy() const { return _collector_policy; }
    91 
    96 
    92   static PSYoungGen* young_gen() { return _young_gen; }
    97   static PSYoungGen* young_gen() { return _young_gen; }
   213   virtual void print_on_error(outputStream* st) const;
   218   virtual void print_on_error(outputStream* st) const;
   214   virtual void print_gc_threads_on(outputStream* st) const;
   219   virtual void print_gc_threads_on(outputStream* st) const;
   215   virtual void gc_threads_do(ThreadClosure* tc) const;
   220   virtual void gc_threads_do(ThreadClosure* tc) const;
   216   virtual void print_tracing_info() const;
   221   virtual void print_tracing_info() const;
   217 
   222 
   218   void verify(bool silent, VerifyOption option /* ignored */);
   223   void verify(VerifyOption option /* ignored */);
   219 
       
   220   void print_heap_change(size_t prev_used);
       
   221 
   224 
   222   // Resize the young generation.  The reserved space for the
   225   // Resize the young generation.  The reserved space for the
   223   // generation may be expanded in preparation for the resize.
   226   // generation may be expanded in preparation for the resize.
   224   void resize_young_gen(size_t eden_size, size_t survivor_size);
   227   void resize_young_gen(size_t eden_size, size_t survivor_size);
   225 
   228 
   239     ParStrongRootsScope();
   242     ParStrongRootsScope();
   240     ~ParStrongRootsScope();
   243     ~ParStrongRootsScope();
   241   };
   244   };
   242 };
   245 };
   243 
   246 
       
   247 // Simple class for storing info about the heap at the start of GC, to be used
       
   248 // after GC for comparison/printing.
       
   249 class PreGCValues {
       
   250 public:
       
   251   PreGCValues(ParallelScavengeHeap* heap) :
       
   252       _heap_used(heap->used()),
       
   253       _young_gen_used(heap->young_gen()->used_in_bytes()),
       
   254       _old_gen_used(heap->old_gen()->used_in_bytes()),
       
   255       _metadata_used(MetaspaceAux::used_bytes()) { };
       
   256 
       
   257   size_t heap_used() const      { return _heap_used; }
       
   258   size_t young_gen_used() const { return _young_gen_used; }
       
   259   size_t old_gen_used() const   { return _old_gen_used; }
       
   260   size_t metadata_used() const  { return _metadata_used; }
       
   261 
       
   262 private:
       
   263   size_t _heap_used;
       
   264   size_t _young_gen_used;
       
   265   size_t _old_gen_used;
       
   266   size_t _metadata_used;
       
   267 };
       
   268 
   244 #endif // SHARE_VM_GC_PARALLEL_PARALLELSCAVENGEHEAP_HPP
   269 #endif // SHARE_VM_GC_PARALLEL_PARALLELSCAVENGEHEAP_HPP