Search in sources :

Example 1 with GCHeapRegionManager

use of com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionManager in project openj9 by eclipse.

the class ObjectRefsCommand method dumpLiveReferences.

private void dumpLiveReferences(J9JavaVMPointer vm, J9ObjectPointer targetObject, PrintStream out) throws CorruptDataException {
    MM_HeapRegionManagerPointer hrmPointer = MM_GCExtensionsPointer.cast(vm.gcExtensions()).heapRegionManager();
    GCHeapRegionManager heapRegionManager = GCHeapRegionManager.fromHeapRegionManager(hrmPointer);
    Table table = new Table("All Live Objects That Refer To !j9object " + targetObject.getHexAddress());
    table.row("Object");
    LiveSetWalker.walkLiveSet(new LiveReferenceVisitor(heapRegionManager, targetObject, table));
    table.render(out);
}
Also used : Table(com.ibm.j9ddr.tools.ddrinteractive.Table) MM_HeapRegionManagerPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer) GCHeapRegionManager(com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionManager)

Example 2 with GCHeapRegionManager

use of com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionManager in project openj9 by eclipse.

the class ACCommand method dumpLiveReferences.

private void dumpLiveReferences(J9JavaVMPointer vm, MM_AllocationContextPointer allocationContext, PrintStream out) throws CorruptDataException {
    if (GCExtensions.isVLHGC()) {
        MM_AllocationContextTarokPointer act = MM_AllocationContextTarokPointer.cast(allocationContext);
        MM_HeapRegionManagerPointer hrmPointer = MM_GCExtensionsPointer.cast(vm.gcExtensions()).heapRegionManager();
        GCHeapRegionManager heapRegionManager = GCHeapRegionManager.fromHeapRegionManager(hrmPointer);
        Table table = new Table("Live References into AC " + allocationContext.getHexAddress());
        table.row("Object", "Field");
        out.println("Walking live set in search of external references into ac: " + allocationContext.getHexAddress());
        long totalMillis = System.currentTimeMillis();
        LiveReferenceVisitor visitor = new LiveReferenceVisitor(heapRegionManager, act, table);
        LiveSetWalker.walkLiveSet(visitor, RootSetType.ALL);
        totalMillis = System.currentTimeMillis() - totalMillis;
        table.render(out);
        out.println("\nFinished live reference walk in " + totalMillis + "ms");
        out.println("Found " + visitor.getNumExternalReferencesFound() + " external references.");
    }
}
Also used : Table(com.ibm.j9ddr.tools.ddrinteractive.Table) MM_HeapRegionManagerPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer) MM_AllocationContextTarokPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_AllocationContextTarokPointer) GCHeapRegionManager(com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionManager)

Aggregations

Table (com.ibm.j9ddr.tools.ddrinteractive.Table)2 GCHeapRegionManager (com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionManager)2 MM_HeapRegionManagerPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer)2 MM_AllocationContextTarokPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_AllocationContextTarokPointer)1