< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahHeapRegionCounters.hpp

Print this page
@@ -24,10 +24,12 @@
  
  #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHHEAPREGIONCOUNTERS_HPP
  #define SHARE_GC_SHENANDOAH_SHENANDOAHHEAPREGIONCOUNTERS_HPP
  
  #include "memory/allocation.hpp"
+ #include "logging/logFileStreamOutput.hpp"
+ #include "gc/shenandoah/shenandoahLogFileOutput.hpp"
  
  /**
   * This provides the following in JVMStat:
   *
   * constants:

@@ -35,13 +37,18 @@
   * - sun.gc.shenandoah.regions.max_regions  maximum number of regions
   * - sun.gc.shenandoah.regions.region_size  size per region, in kilobytes
   *
   * variables:
   * - sun.gc.shenandoah.regions.status       current GC status:
-  *     - bit 0 set when marking in progress
-  *     - bit 1 set when evacuation in progress
-  *     - bit 2 set when update refs in progress
+  *   | global | old   | young | mode |
+  *   |  0..1  | 2..3  | 4..5  | 6..7 |
+  *
+  *   For each generation:
+  *   0 = idle, 1 = marking, 2 = evacuating, 3 = updating refs
+  *
+  *   For mode:
+  *   0 = concurrent, 1 = degenerated, 2 = full
   *
   * two variable counters per region, with $max_regions (see above) counters:
   * - sun.gc.shenandoah.regions.region.$i.data
   * where $ is the region number from 0 <= i < $max_regions
   *

@@ -49,37 +56,47 @@
   * - bits 0-6    used memory in percent
   * - bits 7-13   live memory in percent
   * - bits 14-20  tlab allocated memory in percent
   * - bits 21-27  gclab allocated memory in percent
   * - bits 28-34  shared allocated memory in percent
-  * - bits 35-41  <reserved>
+  * - bits 35-41  plab allocated memory in percent
   * - bits 42-50  <reserved>
-  * - bits 51-57  <reserved>
+  * - bits 51-55  age
+  * - bits 56-57  affiliation: 0 = free, young = 1, old = 2
   * - bits 58-63  status
   *      - bits describe the state as recorded in ShenandoahHeapRegion
   */
  class ShenandoahHeapRegionCounters : public CHeapObj<mtGC>  {
  private:
-   static const jlong PERCENT_MASK = 0x7f;
-   static const jlong STATUS_MASK  = 0x3f;
- 
-   static const jlong USED_SHIFT   = 0;
-   static const jlong LIVE_SHIFT   = 7;
-   static const jlong TLAB_SHIFT   = 14;
-   static const jlong GCLAB_SHIFT  = 21;
-   static const jlong SHARED_SHIFT = 28;
+   static const jlong PERCENT_MASK      = 0x7f;
+   static const jlong AGE_MASK          = 0x1f;
+   static const jlong AFFILIATION_MASK  = 0x03;
+   static const jlong STATUS_MASK       = 0x3f;
  
-   static const jlong STATUS_SHIFT = 58;
+   static const jlong USED_SHIFT        = 0;
+   static const jlong LIVE_SHIFT        = 7;
+   static const jlong TLAB_SHIFT        = 14;
+   static const jlong GCLAB_SHIFT       = 21;
+   static const jlong SHARED_SHIFT      = 28;
+   static const jlong PLAB_SHIFT        = 35;
+   static const jlong AGE_SHIFT         = 51;
+   static const jlong AFFILIATION_SHIFT = 56;
+   static const jlong STATUS_SHIFT      = 58;
  
    char* _name_space;
    PerfLongVariable** _regions_data;
    PerfLongVariable* _timestamp;
    PerfLongVariable* _status;
    volatile jlong _last_sample_millis;
  
+   uint _count = 0;
+   ShenandoahLogFileOutput* _log_file;
  public:
    ShenandoahHeapRegionCounters();
    ~ShenandoahHeapRegionCounters();
    void update();
+ 
+ private:
+   static jlong encode_heap_status(ShenandoahHeap* heap) ;
  };
  
  #endif // SHARE_GC_SHENANDOAH_SHENANDOAHHEAPREGIONCOUNTERS_HPP
< prev index next >