Package javax.tools.diagnostics.runtime.java

Examples of javax.tools.diagnostics.runtime.java.JavaHeap


  }

  private void subTestGetObjectHeap(int counter, JavaHeap heap,
      int objcounter, JavaObject object) {
    try {
      JavaHeap parentheap=object.getHeap();
      assertNotNull("Entry "+counter+"/"+objcounter+" getHeap is null",parentheap);
      assertEquals("Entry "+counter+"/"+objcounter+" getHeap is not expected parent",heap,parentheap);
     
    } catch (CorruptDataException e3) {
      // allowed
View Full Code Here


      if (nextHeap instanceof CorruptData) {
        System.err.println("returned CorruptData `" + nextHeap + "'");
        break;
      }

      JavaHeap aJavaHeap = (JavaHeap) nextHeap;
      assertTrue("One of the java heaps has a null name.", aJavaHeap.getName()!=null);
    }
  }
View Full Code Here

      if (nextHeap instanceof CorruptData) {
        System.err.println("returned CorruptData `" + nextHeap + "'");
        break;
      }

      JavaHeap aJavaHeap = (JavaHeap) nextHeap;
      Iterator objects = aJavaHeap.getObjects().iterator();

      while (objects.hasNext()) {
        Object nextObject = objects.next();
        if (nextObject instanceof CorruptData) {
          System.err.println("returned CorruptData `" + nextObject + "'");
View Full Code Here

         
          // Old method for returning java objects
          Iterator heapList = javaRT.getHeaps().iterator();

          while (heapList.hasNext()){
            JavaHeap heap = (JavaHeap) heapList.next();
            Iterator objectList = heap.getObjects().iterator();
            while (objectList.hasNext()){
              JavaObject jObject = (JavaObject)objectList.next();
              if (jObject.getID().getAddress() == objectID){
                return jObject;
              }
View Full Code Here

   
    while(heapIt.hasNext()) {
      Object potential = heapIt.next();
     
      if(potential instanceof JavaHeap) {
        JavaHeap thisHeap = (JavaHeap)potential;
       
        workingSet.remove(thisHeap.getName());
      } else if (potential instanceof CorruptData) {
        reportError("Corrupt heap found. Address = " + ((CorruptData)potential).getAddress(),null);
        _numberOfErrors++;
      } else {
        _numberOfErrors++;
View Full Code Here

            + ((CorruptData) thisHeapObj).getAddress());
        _numberOfErrors++;
        continue;
      }

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

            + ((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);
     
View Full Code Here

     
       if (nextHeap instanceof CorruptData) {
         continue;
       }
      
       JavaHeap heap = (JavaHeap) nextHeap;
      
       Iterator objects = heap.getObjects().iterator();
      
       while (objects.hasNext()) {
         Object nextObject = objects.next();
        
         if (nextObject instanceof CorruptData) {
View Full Code Here

  }
 
  private void printHeapObjects(JavaRuntime jr, Long objAddress, String objName,
      Output out, boolean supers)
  {
    JavaHeap jh;
    Iterator itHeap = jr.getHeaps().iterator();
    int count = 1;
   
    while (itHeap.hasNext()) {
      jh = (JavaHeap)itHeap.next();
     
      out.print("\t heap #" + count + " - name: ");
      out.print(jh.getName());
      out.print("\n\n");
     
      printObjects(jh, objAddress, objName, out, supers, jr);
      count++;
    }
View Full Code Here

    }
  }
 
  private void findInRuntime(JavaRuntime jr, long address)
  {
    JavaHeap jh;
    Iterator itHeap = jr.getHeaps().iterator();
    int count = 1;
   
    while (itHeap.hasNext()) {
      jh = (JavaHeap)itHeap.next();
     
      out.print("\t  heap #" + count + " - name: ");
      out.print(jh.getName() + "\n");
     
      findInHeap(jh, address);
      count++;
    }
  }
View Full Code Here

TOP

Related Classes of javax.tools.diagnostics.runtime.java.JavaHeap

Copyright © 2018 www.massapicom. 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.