diff agent/src/share/classes/sun/jvm/hotspot/tools/JMap.java @ 8112:b685ca4f4fb9

8008536: Add HotSpot support for printing class loader statistics for JMap Reviewed-by: sla, brutisso
author ehelin
date Wed, 20 Feb 2013 16:41:23 +0100
parents c18cbe5936b8
children 9075044ed66b
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/tools/JMap.java	Tue Feb 26 11:52:06 2013 +0100
+++ b/agent/src/share/classes/sun/jvm/hotspot/tools/JMap.java	Wed Feb 20 16:41:23 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,7 +45,7 @@
     }
 
     protected String getCommandFlags() {
-        return "-heap|-heap:format=b|-histo|-permstat|-finalizerinfo";
+        return "-heap|-heap:format=b|-histo|-clstats|-finalizerinfo";
     }
 
     protected void printFlagsUsage() {
@@ -53,14 +53,14 @@
         System.out.println("    -heap\tto print java heap summary");
         System.out.println("    -heap:format=b\tto dump java heap in hprof binary format");
         System.out.println("    -histo\tto print histogram of java object heap");
-        System.out.println("    -permstat\tto print permanent generation statistics");
+        System.out.println("    -clstats\tto print class loader statistics");
         System.out.println("    -finalizerinfo\tto print information on objects awaiting finalization");
         super.printFlagsUsage();
     }
 
     public static final int MODE_HEAP_SUMMARY = 0;
     public static final int MODE_HISTOGRAM = 1;
-    public static final int MODE_PERMSTAT = 2;
+    public static final int MODE_CLSTATS = 2;
     public static final int MODE_PMAP = 3;
     public static final int MODE_HEAP_GRAPH_HPROF_BIN = 4;
     public static final int MODE_HEAP_GRAPH_GXL = 5;
@@ -78,8 +78,8 @@
             tool = new ObjectHistogram();
             break;
 
-        case MODE_PERMSTAT:
-            tool = new PermStat();
+        case MODE_CLSTATS:
+            tool = new ClassLoaderStats();
             break;
 
         case MODE_PMAP:
@@ -118,7 +118,9 @@
             } else if (modeFlag.equals("-histo")) {
                 mode = MODE_HISTOGRAM;
             } else if (modeFlag.equals("-permstat")) {
-                mode = MODE_PERMSTAT;
+                mode = MODE_CLSTATS;
+            } else if (modeFlag.equals("-clstats")) {
+                mode = MODE_CLSTATS;
             } else if (modeFlag.equals("-finalizerinfo")) {
                 mode = MODE_FINALIZERINFO;
             } else {