< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shenandoah/ShenandoahHeap.java

Print this page
@@ -41,11 +41,11 @@
  import sun.jvm.hotspot.utilities.Observable;
  import sun.jvm.hotspot.utilities.Observer;
  
  public class ShenandoahHeap extends CollectedHeap {
      private static CIntegerField numRegions;
-     private static CIntegerField used;
+     private static AddressField  globalGeneration;
      private static CIntegerField committed;
      private static AddressField  regions;
      private static CIntegerField logMinObjAlignmentInBytes;
  
      private static long regionPtrFieldSize;

@@ -58,11 +58,11 @@
      }
  
      private static synchronized void initialize(TypeDataBase db) {
          Type type = db.lookupType("ShenandoahHeap");
          numRegions = type.getCIntegerField("_num_regions");
-         used = type.getCIntegerField("_used");
+         globalGeneration = type.getAddressField("_global_generation");
          committed = type.getCIntegerField("_committed");
          regions = type.getAddressField("_regions");
          logMinObjAlignmentInBytes = type.getCIntegerField("_log_min_obj_alignment_in_bytes");
  
          Type regionPtrType = db.lookupType("ShenandoahHeapRegion*");

@@ -87,11 +87,13 @@
          return numOfRegions() * ShenandoahHeapRegion.regionSizeBytes();
      }
  
      @Override
      public long used() {
-         return used.getValue(addr);
+         Address globalGenerationAddress = globalGeneration.getValue(addr);
+         ShenandoahGeneration global = VMObjectFactory.newObject(ShenandoahGeneration.class, globalGenerationAddress);
+         return global.used();
      }
  
      public long committed() {
          return committed.getValue(addr);
      }
< prev index next >