提交 ff3ba8d0 编写于 作者: E ehelin

8008536: Add HotSpot support for printing class loader statistics for JMap

Reviewed-by: sla, brutisso
上级 27d468d2
/* /*
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -35,16 +35,16 @@ import sun.jvm.hotspot.tools.*; ...@@ -35,16 +35,16 @@ import sun.jvm.hotspot.tools.*;
import sun.jvm.hotspot.utilities.*; import sun.jvm.hotspot.utilities.*;
/** /**
A command line tool to print perm. generation statistics. A command line tool to print class loader statistics.
*/ */
public class PermStat extends Tool { public class ClassLoaderStats extends Tool {
boolean verbose = true; boolean verbose = true;
public static void main(String[] args) { public static void main(String[] args) {
PermStat ps = new PermStat(); ClassLoaderStats cls = new ClassLoaderStats();
ps.start(args); cls.start(args);
ps.stop(); cls.stop();
} }
private static class ClassData { private static class ClassData {
......
/* /*
* 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -45,7 +45,7 @@ public class JMap extends Tool { ...@@ -45,7 +45,7 @@ public class JMap extends Tool {
} }
protected String getCommandFlags() { protected String getCommandFlags() {
return "-heap|-heap:format=b|-histo|-permstat|-finalizerinfo"; return "-heap|-heap:format=b|-histo|-clstats|-finalizerinfo";
} }
protected void printFlagsUsage() { protected void printFlagsUsage() {
...@@ -53,14 +53,14 @@ public class JMap extends Tool { ...@@ -53,14 +53,14 @@ public class JMap extends Tool {
System.out.println(" -heap\tto print java heap summary"); 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(" -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(" -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"); System.out.println(" -finalizerinfo\tto print information on objects awaiting finalization");
super.printFlagsUsage(); super.printFlagsUsage();
} }
public static final int MODE_HEAP_SUMMARY = 0; public static final int MODE_HEAP_SUMMARY = 0;
public static final int MODE_HISTOGRAM = 1; 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_PMAP = 3;
public static final int MODE_HEAP_GRAPH_HPROF_BIN = 4; public static final int MODE_HEAP_GRAPH_HPROF_BIN = 4;
public static final int MODE_HEAP_GRAPH_GXL = 5; public static final int MODE_HEAP_GRAPH_GXL = 5;
...@@ -78,8 +78,8 @@ public class JMap extends Tool { ...@@ -78,8 +78,8 @@ public class JMap extends Tool {
tool = new ObjectHistogram(); tool = new ObjectHistogram();
break; break;
case MODE_PERMSTAT: case MODE_CLSTATS:
tool = new PermStat(); tool = new ClassLoaderStats();
break; break;
case MODE_PMAP: case MODE_PMAP:
...@@ -118,7 +118,9 @@ public class JMap extends Tool { ...@@ -118,7 +118,9 @@ public class JMap extends Tool {
} else if (modeFlag.equals("-histo")) { } else if (modeFlag.equals("-histo")) {
mode = MODE_HISTOGRAM; mode = MODE_HISTOGRAM;
} else if (modeFlag.equals("-permstat")) { } else if (modeFlag.equals("-permstat")) {
mode = MODE_PERMSTAT; mode = MODE_CLSTATS;
} else if (modeFlag.equals("-clstats")) {
mode = MODE_CLSTATS;
} else if (modeFlag.equals("-finalizerinfo")) { } else if (modeFlag.equals("-finalizerinfo")) {
mode = MODE_FINALIZERINFO; mode = MODE_FINALIZERINFO;
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册