Examples of HeapDumpFormatter


Examples of org.apache.kato.katoview.heapdump.HeapDumpFormatter

  private void dumpMultipleHeapsInOneFile(JavaRuntime runtime,
      String version, boolean is64Bit, boolean phdFormat, String filename, Set heapsToDump) throws IOException
  {
    Iterator heapIterator = runtime.getHeaps().iterator();
   
    HeapDumpFormatter formatter = getFormatter(filename, version, is64Bit, phdFormat);
   
    out.print("Writing " + ( phdFormat ? "PHD" : "Classic") + " format heapdump into " + filename);
   
    dumpClasses(formatter,runtime);
   
    while (heapIterator.hasNext()) {
      Object thisHeapObj = heapIterator.next();

      if (thisHeapObj instanceof CorruptData) {
        out.error("Corrupt heap data found at: "
            + ((CorruptData) thisHeapObj).getAddress());
        _numberOfErrors++;
        continue;
      }

      JavaHeap thisHeap = (JavaHeap) thisHeapObj;
     
      if(heapsToDump.size() > 0 && ! heapsToDump.contains(thisHeap.getName())) {
        continue;
      }
     
      dumpHeap(formatter, thisHeap);
    }
   
    formatter.close();
  }
View Full Code Here

Examples of org.apache.kato.katoview.heapdump.HeapDumpFormatter

  private void dumpMultipleHeapsInSeparateFiles(JavaRuntime runtime,String version, boolean is64Bit, boolean phdFormat,String baseFileName, Set heapsToDump) throws IOException
  {
    Iterator heapIterator = runtime.getHeaps().iterator();
   
    HeapDumpFormatter formatter = null;
   
    while (heapIterator.hasNext()) {
      Object thisHeapObj = heapIterator.next();

      if (thisHeapObj instanceof CorruptData) {
        out.error("Heap corrupted at: "
            + ((CorruptData) thisHeapObj).getAddress());
        _numberOfErrors++;
        continue;
      }

      JavaHeap thisHeap = (JavaHeap) thisHeapObj;

      // Create a new heapdump formatter for every heap we find
      if (formatter != null) {
        formatter.close();
      }

      if(heapsToDump.size() > 0 && ! heapsToDump.contains(thisHeap.getName())) {
        continue;
      }
     
      String fileName = getFileNameForHeap(thisHeap,baseFileName);

      out.print("Writing "
          + ( phdFormat ? "PHD" : "Classic")
          + " format heapdump for heap "
          + thisHeap.getName()
          + " into "
          + fileName + "\n");
     
      formatter = getFormatter(fileName, version, is64Bit, phdFormat);
     
      //We have to dump classes in every heapdump
      dumpClasses(formatter,runtime);
     
      dumpHeap(formatter, thisHeap);
    }
   
    if(formatter != null) {
      formatter.close();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.