changeset 10256:1610a87dfa21

8149648: Add number of regions to the G1HeapSummary event Reviewed-by: sjohanss, jwilhelm
author david
date Thu, 11 Feb 2016 16:49:12 +0100
parents aafce3cb3c9a
children 49f65299b140
files src/share/vm/gc/g1/g1CollectedHeap.cpp src/share/vm/gc/shared/gcHeapSummary.hpp src/share/vm/gc/shared/gcTraceSend.cpp src/share/vm/trace/trace.xml
diffstat 4 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc/g1/g1CollectedHeap.cpp	Thu Feb 11 12:11:02 2016 +0000
+++ b/src/share/vm/gc/g1/g1CollectedHeap.cpp	Thu Feb 11 16:49:12 2016 +0100
@@ -2847,7 +2847,7 @@
     (g1_policy()->young_list_target_length() * HeapRegion::GrainBytes) - survivor_used_bytes;
 
   VirtualSpaceSummary heap_summary = create_heap_space_summary();
-  return G1HeapSummary(heap_summary, used(), eden_used_bytes, eden_capacity_bytes, survivor_used_bytes);
+  return G1HeapSummary(heap_summary, used(), eden_used_bytes, eden_capacity_bytes, survivor_used_bytes, num_regions());
 }
 
 G1EvacSummary G1CollectedHeap::create_g1_evac_summary(G1EvacStats* stats) {
--- a/src/share/vm/gc/shared/gcHeapSummary.hpp	Thu Feb 11 12:11:02 2016 +0000
+++ b/src/share/vm/gc/shared/gcHeapSummary.hpp	Thu Feb 11 16:49:12 2016 +0100
@@ -131,12 +131,14 @@
   size_t  _edenUsed;
   size_t  _edenCapacity;
   size_t  _survivorUsed;
+  uint    _numberOfRegions;
  public:
-   G1HeapSummary(VirtualSpaceSummary& heap_space, size_t heap_used, size_t edenUsed, size_t edenCapacity, size_t survivorUsed) :
-       GCHeapSummary(heap_space, heap_used), _edenUsed(edenUsed), _edenCapacity(edenCapacity), _survivorUsed(survivorUsed) { }
+   G1HeapSummary(VirtualSpaceSummary& heap_space, size_t heap_used, size_t edenUsed, size_t edenCapacity, size_t survivorUsed, uint numberOfRegions) :
+      GCHeapSummary(heap_space, heap_used), _edenUsed(edenUsed), _edenCapacity(edenCapacity), _survivorUsed(survivorUsed), _numberOfRegions(numberOfRegions) { }
    const size_t edenUsed() const { return _edenUsed; }
    const size_t edenCapacity() const { return _edenCapacity; }
    const size_t survivorUsed() const { return _survivorUsed; }
+   const uint   numberOfRegions() const { return _numberOfRegions; }
 
    virtual void accept(GCHeapSummaryVisitor* visitor) const {
      visitor->visit(this);
--- a/src/share/vm/gc/shared/gcTraceSend.cpp	Thu Feb 11 12:11:02 2016 +0000
+++ b/src/share/vm/gc/shared/gcTraceSend.cpp	Thu Feb 11 16:49:12 2016 +0100
@@ -359,6 +359,7 @@
       e.set_edenUsedSize(g1_heap_summary->edenUsed());
       e.set_edenTotalSize(g1_heap_summary->edenCapacity());
       e.set_survivorUsedSize(g1_heap_summary->survivorUsed());
+      e.set_numberOfRegions(g1_heap_summary->numberOfRegions());
       e.commit();
     }
   }
--- a/src/share/vm/trace/trace.xml	Thu Feb 11 12:11:02 2016 +0000
+++ b/src/share/vm/trace/trace.xml	Thu Feb 11 16:49:12 2016 +0100
@@ -283,6 +283,7 @@
       <value type="BYTES64" field="edenUsedSize" label="Eden Used Size" />
       <value type="BYTES64" field="edenTotalSize" label="Eden Total Size" />
       <value type="BYTES64" field="survivorUsedSize" label="Survivor Used Size" />
+      <value type="UINT" field="numberOfRegions" label="Number of Regions" />
     </event>
 
     <event id="GCGarbageCollection" path="vm/gc/collector/garbage_collection" label="Garbage Collection"