agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java

Print this page




  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 package sun.jvm.hotspot.tools;
  26 
  27 import java.util.*;
  28 import sun.jvm.hotspot.gc_interface.*;
  29 import sun.jvm.hotspot.gc_implementation.g1.*;
  30 import sun.jvm.hotspot.gc_implementation.parallelScavenge.*;
  31 import sun.jvm.hotspot.gc_implementation.shared.*;

  32 import sun.jvm.hotspot.memory.*;
  33 import sun.jvm.hotspot.oops.*;
  34 import sun.jvm.hotspot.runtime.*;
  35 
  36 public class HeapSummary extends Tool {








  37 
  38    public static void main(String[] args) {
  39       HeapSummary hs = new HeapSummary();
  40       hs.start(args);
  41       hs.stop();
  42    }
  43 
  44    public void run() {
  45       CollectedHeap heap = VM.getVM().getUniverse().heap();
  46       VM.Flag[] flags = VM.getVM().getCommandLineFlags();
  47       Map flagMap = new HashMap();
  48       if (flags == null) {
  49          System.out.println("WARNING: command line flags are not available");
  50       } else {
  51          for (int f = 0; f < flags.length; f++) {
  52             flagMap.put(flags[f].getName(), flags[f]);
  53          }
  54       }
  55 
  56       System.out.println();




  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 package sun.jvm.hotspot.tools;
  26 
  27 import java.util.*;
  28 import sun.jvm.hotspot.gc_interface.*;
  29 import sun.jvm.hotspot.gc_implementation.g1.*;
  30 import sun.jvm.hotspot.gc_implementation.parallelScavenge.*;
  31 import sun.jvm.hotspot.gc_implementation.shared.*;
  32 import sun.jvm.hotspot.debugger.JVMDebugger;
  33 import sun.jvm.hotspot.memory.*;
  34 import sun.jvm.hotspot.oops.*;
  35 import sun.jvm.hotspot.runtime.*;
  36 
  37 public class HeapSummary extends Tool {
  38 
  39    public HeapSummary() {
  40       super();
  41    }
  42 
  43    public HeapSummary(JVMDebugger d) {
  44       super(d);
  45    }
  46 
  47    public static void main(String[] args) {
  48       HeapSummary hs = new HeapSummary();
  49       hs.start(args);
  50       hs.stop();
  51    }
  52 
  53    public void run() {
  54       CollectedHeap heap = VM.getVM().getUniverse().heap();
  55       VM.Flag[] flags = VM.getVM().getCommandLineFlags();
  56       Map flagMap = new HashMap();
  57       if (flags == null) {
  58          System.out.println("WARNING: command line flags are not available");
  59       } else {
  60          for (int f = 0; f < flags.length; f++) {
  61             flagMap.put(flags[f].getName(), flags[f]);
  62          }
  63       }
  64 
  65       System.out.println();