src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp
changeset 48168 cb5d2d4453d0
parent 47624 b055cb5170f5
child 48961 120b61d50f85
equal deleted inserted replaced
48167:f04a848c6f00 48168:cb5d2d4453d0
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    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 "memory/metaspace.hpp"
       
    39 #include "utilities/growableArray.hpp"
    39 #include "utilities/ostream.hpp"
    40 #include "utilities/ostream.hpp"
    40 
    41 
    41 class AdjoiningGenerations;
    42 class AdjoiningGenerations;
    42 class GCHeapSummary;
    43 class GCHeapSummary;
    43 class GCTaskManager;
    44 class GCTaskManager;
       
    45 class MemoryManager;
       
    46 class MemoryPool;
    44 class PSAdaptiveSizePolicy;
    47 class PSAdaptiveSizePolicy;
    45 class PSHeapSummary;
    48 class PSHeapSummary;
    46 
    49 
    47 class ParallelScavengeHeap : public CollectedHeap {
    50 class ParallelScavengeHeap : public CollectedHeap {
    48   friend class VMStructs;
    51   friend class VMStructs;
    62   unsigned int _death_march_count;
    65   unsigned int _death_march_count;
    63 
    66 
    64   // The task manager
    67   // The task manager
    65   static GCTaskManager* _gc_task_manager;
    68   static GCTaskManager* _gc_task_manager;
    66 
    69 
       
    70   GCMemoryManager* _young_manager;
       
    71   GCMemoryManager* _old_manager;
       
    72 
       
    73   MemoryPool* _eden_pool;
       
    74   MemoryPool* _survivor_pool;
       
    75   MemoryPool* _old_pool;
       
    76 
       
    77   virtual void initialize_serviceability();
       
    78 
    67   void trace_heap(GCWhen::Type when, const GCTracer* tracer);
    79   void trace_heap(GCWhen::Type when, const GCTracer* tracer);
    68 
    80 
    69  protected:
    81  protected:
    70   static inline size_t total_invocations();
    82   static inline size_t total_invocations();
    71   HeapWord* allocate_new_tlab(size_t size);
    83   HeapWord* allocate_new_tlab(size_t size);
    91   virtual const char* name() const {
   103   virtual const char* name() const {
    92     return "Parallel";
   104     return "Parallel";
    93   }
   105   }
    94 
   106 
    95   virtual CollectorPolicy* collector_policy() const { return _collector_policy; }
   107   virtual CollectorPolicy* collector_policy() const { return _collector_policy; }
       
   108 
       
   109   virtual GrowableArray<GCMemoryManager*> memory_managers();
       
   110   virtual GrowableArray<MemoryPool*> memory_pools();
    96 
   111 
    97   static PSYoungGen* young_gen() { return _young_gen; }
   112   static PSYoungGen* young_gen() { return _young_gen; }
    98   static PSOldGen* old_gen()     { return _old_gen; }
   113   static PSOldGen* old_gen()     { return _old_gen; }
    99 
   114 
   100   virtual PSAdaptiveSizePolicy* size_policy() { return _size_policy; }
   115   virtual PSAdaptiveSizePolicy* size_policy() { return _size_policy; }
   242   class ParStrongRootsScope : public MarkScope {
   257   class ParStrongRootsScope : public MarkScope {
   243    public:
   258    public:
   244     ParStrongRootsScope();
   259     ParStrongRootsScope();
   245     ~ParStrongRootsScope();
   260     ~ParStrongRootsScope();
   246   };
   261   };
       
   262 
       
   263   GCMemoryManager* old_gc_manager() const { return _old_manager; }
       
   264   GCMemoryManager* young_gc_manager() const { return _young_manager; }
   247 };
   265 };
   248 
   266 
   249 // Simple class for storing info about the heap at the start of GC, to be used
   267 // Simple class for storing info about the heap at the start of GC, to be used
   250 // after GC for comparison/printing.
   268 // after GC for comparison/printing.
   251 class PreGCValues {
   269 class PreGCValues {