< prev index next >

src/share/vm/gc_implementation/shared/gcHeapSummary.hpp

Print this page




  61   size_t size() const { return (uintptr_t)_end - (uintptr_t)_start; }
  62 };
  63 
  64 class MetaspaceSizes : public StackObj {
  65   size_t _committed;
  66   size_t _used;
  67   size_t _reserved;
  68 
  69  public:
  70   MetaspaceSizes() : _committed(0), _used(0), _reserved(0) {}
  71   MetaspaceSizes(size_t committed, size_t used, size_t reserved) :
  72     _committed(committed), _used(used), _reserved(reserved) {}
  73 
  74   size_t committed() const { return _committed; }
  75   size_t used() const { return _used; }
  76   size_t reserved() const { return _reserved; }
  77 };
  78 
  79 class GCHeapSummary;
  80 class PSHeapSummary;

  81 
  82 class GCHeapSummaryVisitor {
  83  public:
  84   virtual void visit(const GCHeapSummary* heap_summary) const = 0;
  85   virtual void visit(const PSHeapSummary* heap_summary) const {}

  86 };
  87 
  88 class GCHeapSummary : public StackObj {
  89   VirtualSpaceSummary _heap;
  90   size_t _used;
  91 
  92  public:
  93    GCHeapSummary() :
  94        _heap(), _used(0) { }
  95    GCHeapSummary(VirtualSpaceSummary& heap_space, size_t used) :
  96        _heap(heap_space), _used(used) { }
  97 
  98   const VirtualSpaceSummary& heap() const { return _heap; }
  99   size_t used() const { return _used; }
 100 
 101    virtual void accept(GCHeapSummaryVisitor* visitor) const {
 102      visitor->visit(this);
 103    }
 104 };
 105 
 106 class PSHeapSummary : public GCHeapSummary {
 107   VirtualSpaceSummary  _old;
 108   SpaceSummary         _old_space;
 109   VirtualSpaceSummary  _young;
 110   SpaceSummary         _eden;
 111   SpaceSummary         _from;
 112   SpaceSummary         _to;
 113  public:
 114    PSHeapSummary(VirtualSpaceSummary& heap_space, size_t heap_used, VirtualSpaceSummary old, SpaceSummary old_space, VirtualSpaceSummary young, SpaceSummary eden, SpaceSummary from, SpaceSummary to) :
 115        GCHeapSummary(heap_space, heap_used), _old(old), _old_space(old_space), _young(young), _eden(eden), _from(from), _to(to) { }
 116    const VirtualSpaceSummary& old() const { return _old; }
 117    const SpaceSummary& old_space() const { return _old_space; }
 118    const VirtualSpaceSummary& young() const { return _young; }
 119    const SpaceSummary& eden() const { return _eden; }
 120    const SpaceSummary& from() const { return _from; }
 121    const SpaceSummary& to() const { return _to; }


















 122 
 123    virtual void accept(GCHeapSummaryVisitor* visitor) const {
 124      visitor->visit(this);
 125    }
 126 };
 127 
 128 class MetaspaceSummary : public StackObj {
 129   size_t _capacity_until_GC;
 130   MetaspaceSizes _meta_space;
 131   MetaspaceSizes _data_space;
 132   MetaspaceSizes _class_space;
 133   MetaspaceChunkFreeListSummary _metaspace_chunk_free_list_summary;
 134   MetaspaceChunkFreeListSummary _class_chunk_free_list_summary;
 135 
 136  public:
 137   MetaspaceSummary() :
 138     _capacity_until_GC(0),
 139     _meta_space(),
 140     _data_space(),
 141     _class_space(),




  61   size_t size() const { return (uintptr_t)_end - (uintptr_t)_start; }
  62 };
  63 
  64 class MetaspaceSizes : public StackObj {
  65   size_t _committed;
  66   size_t _used;
  67   size_t _reserved;
  68 
  69  public:
  70   MetaspaceSizes() : _committed(0), _used(0), _reserved(0) {}
  71   MetaspaceSizes(size_t committed, size_t used, size_t reserved) :
  72     _committed(committed), _used(used), _reserved(reserved) {}
  73 
  74   size_t committed() const { return _committed; }
  75   size_t used() const { return _used; }
  76   size_t reserved() const { return _reserved; }
  77 };
  78 
  79 class GCHeapSummary;
  80 class PSHeapSummary;
  81 class G1HeapSummary;
  82 
  83 class GCHeapSummaryVisitor {
  84  public:
  85   virtual void visit(const GCHeapSummary* heap_summary) const = 0;
  86   virtual void visit(const PSHeapSummary* heap_summary) const {}
  87   virtual void visit(const G1HeapSummary* heap_summary) const {}
  88 };
  89 
  90 class GCHeapSummary : public StackObj {
  91   VirtualSpaceSummary _heap;
  92   size_t _used;
  93 
  94  public:
  95    GCHeapSummary() :
  96        _heap(), _used(0) { }
  97    GCHeapSummary(VirtualSpaceSummary& heap_space, size_t used) :
  98        _heap(heap_space), _used(used) { }
  99 
 100   const VirtualSpaceSummary& heap() const { return _heap; }
 101   size_t used() const { return _used; }
 102 
 103    virtual void accept(GCHeapSummaryVisitor* visitor) const {
 104      visitor->visit(this);
 105    }
 106 };
 107 
 108 class PSHeapSummary : public GCHeapSummary {
 109   VirtualSpaceSummary  _old;
 110   SpaceSummary         _old_space;
 111   VirtualSpaceSummary  _young;
 112   SpaceSummary         _eden;
 113   SpaceSummary         _from;
 114   SpaceSummary         _to;
 115  public:
 116    PSHeapSummary(VirtualSpaceSummary& heap_space, size_t heap_used, VirtualSpaceSummary old, SpaceSummary old_space, VirtualSpaceSummary young, SpaceSummary eden, SpaceSummary from, SpaceSummary to) :
 117        GCHeapSummary(heap_space, heap_used), _old(old), _old_space(old_space), _young(young), _eden(eden), _from(from), _to(to) { }
 118    const VirtualSpaceSummary& old() const { return _old; }
 119    const SpaceSummary& old_space() const { return _old_space; }
 120    const VirtualSpaceSummary& young() const { return _young; }
 121    const SpaceSummary& eden() const { return _eden; }
 122    const SpaceSummary& from() const { return _from; }
 123    const SpaceSummary& to() const { return _to; }
 124 
 125    virtual void accept(GCHeapSummaryVisitor* visitor) const {
 126      visitor->visit(this);
 127    }
 128 };
 129 
 130 class G1HeapSummary : public GCHeapSummary {
 131   size_t  _edenUsed;
 132   size_t  _edenCapacity;
 133   size_t  _survivorUsed;
 134   uint    _numberOfRegions;
 135  public:
 136    G1HeapSummary(VirtualSpaceSummary& heap_space, size_t heap_used, size_t edenUsed, size_t edenCapacity, size_t survivorUsed, uint numberOfRegions) :
 137       GCHeapSummary(heap_space, heap_used), _edenUsed(edenUsed), _edenCapacity(edenCapacity), _survivorUsed(survivorUsed), _numberOfRegions(numberOfRegions) { }
 138    const size_t edenUsed() const { return _edenUsed; }
 139    const size_t edenCapacity() const { return _edenCapacity; }
 140    const size_t survivorUsed() const { return _survivorUsed; }
 141    const uint   numberOfRegions() const { return _numberOfRegions; }
 142 
 143    virtual void accept(GCHeapSummaryVisitor* visitor) const {
 144      visitor->visit(this);
 145    }
 146 };
 147 
 148 class MetaspaceSummary : public StackObj {
 149   size_t _capacity_until_GC;
 150   MetaspaceSizes _meta_space;
 151   MetaspaceSizes _data_space;
 152   MetaspaceSizes _class_space;
 153   MetaspaceChunkFreeListSummary _metaspace_chunk_free_list_summary;
 154   MetaspaceChunkFreeListSummary _class_chunk_free_list_summary;
 155 
 156  public:
 157   MetaspaceSummary() :
 158     _capacity_until_GC(0),
 159     _meta_space(),
 160     _data_space(),
 161     _class_space(),


< prev index next >