src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java
changeset 50445 bd6b78feb6a3
parent 49463 ccb003941743
child 50523 7b7c75d87f9b
child 56719 a846e7bbcdfa
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java	Thu Jun 07 06:27:09 2018 -0400
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java	Thu Jun 07 14:11:56 2018 +0200
@@ -129,7 +129,6 @@
       }
 
       System.out.println();
-      printInternStringStatistics();
    }
 
    // Helper methods
@@ -258,41 +257,4 @@
          return -1;
       }
    }
-
-   private void printInternStringStatistics() {
-      class StringStat implements StringTable.StringVisitor {
-         private int count;
-         private long size;
-         private OopField stringValueField;
-
-         StringStat() {
-            VM vm = VM.getVM();
-            SystemDictionary sysDict = vm.getSystemDictionary();
-            InstanceKlass strKlass = sysDict.getStringKlass();
-            // String has a field named 'value' of type 'byte[]'.
-            stringValueField = (OopField) strKlass.findField("value", "[B");
-         }
-
-         private long stringSize(Instance instance) {
-            // We include String content in size calculation.
-            return instance.getObjectSize() +
-                   stringValueField.getValue(instance).getObjectSize();
-         }
-
-         public void visit(Instance str) {
-            count++;
-            size += stringSize(str);
-         }
-
-         public void print() {
-            System.out.println(count +
-                  " interned Strings occupying " + size + " bytes.");
-         }
-      }
-
-      StringStat stat = new StringStat();
-      StringTable strTable = VM.getVM().getStringTable();
-      strTable.stringsDo(stat);
-      stat.print();
-   }
 }