Search in sources :

Example 26 with JavaRuntime

use of com.ibm.dtfj.java.JavaRuntime in project openj9 by eclipse.

the class InfoMemoryCommand method run.

public void run(String command, String[] args, IContext context, PrintStream out) throws CommandException {
    if (initCommand(command, args, context, out)) {
        // processing already handled by super class
        return;
    }
    JavaRuntime runtime = ctx.getRuntime();
    try {
        Iterator memoryCategories = runtime.getMemoryCategories();
        printAllMemoryCategories(out, memoryCategories);
        printDbgmallocWarning(out, runtime);
    } catch (DataUnavailable du) {
        out.println("Memory categories information unavailable.");
        logger.log(Level.FINE, Exceptions.getDataUnavailableString(), du);
    }
}
Also used : JavaRuntime(com.ibm.dtfj.java.JavaRuntime) Iterator(java.util.Iterator) DataUnavailable(com.ibm.dtfj.image.DataUnavailable)

Example 27 with JavaRuntime

use of com.ibm.dtfj.java.JavaRuntime in project openj9 by eclipse.

the class XJCommand method printHeapObjects.

private void printHeapObjects(Long objAddress, String objName, PrintStream out, boolean supers) {
    JavaRuntime jr = ctx.getRuntime();
    JavaHeap jh;
    Iterator<?> itHeap = jr.getHeaps();
    int count = 1;
    while (itHeap.hasNext()) {
        Object obj = itHeap.next();
        if (obj instanceof JavaHeap) {
            jh = (JavaHeap) obj;
            out.print("\t heap #" + count + " - name: ");
            out.print(jh.getName());
            out.print("\n\n");
            printObjects(jh, objAddress, objName, out, supers, jr);
            count++;
        } else {
            out.println("\t\tWarning : skipping corrupt heap");
        }
    }
}
Also used : JavaRuntime(com.ibm.dtfj.java.JavaRuntime) JavaHeap(com.ibm.dtfj.java.JavaHeap) JavaObject(com.ibm.dtfj.java.JavaObject)

Aggregations

JavaRuntime (com.ibm.dtfj.java.JavaRuntime)27 Iterator (java.util.Iterator)13 JavaObject (com.ibm.dtfj.java.JavaObject)10 CorruptDataException (com.ibm.dtfj.image.CorruptDataException)8 ImageAddressSpace (com.ibm.dtfj.image.ImageAddressSpace)8 ImageProcess (com.ibm.dtfj.image.ImageProcess)8 CorruptData (com.ibm.dtfj.image.CorruptData)7 JavaClass (com.ibm.dtfj.java.JavaClass)6 DataUnavailable (com.ibm.dtfj.image.DataUnavailable)5 Image (com.ibm.dtfj.image.Image)5 JavaHeap (com.ibm.dtfj.java.JavaHeap)5 JavaThread (com.ibm.dtfj.java.JavaThread)5 File (java.io.File)4 HashMap (java.util.HashMap)4 ImageFactory (com.ibm.dtfj.image.ImageFactory)3 JavaClassLoader (com.ibm.dtfj.java.JavaClassLoader)3 JavaMonitor (com.ibm.dtfj.java.JavaMonitor)3 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)3 ImageSection (com.ibm.dtfj.image.ImageSection)2