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);
}
}
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");
}
}
}
Aggregations