Search in sources :

Example 1 with MM_HeapRegionManagerPointer

use of com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer in project openj9 by eclipse.

the class GCHeapRegionIterator method from.

public static GCHeapRegionIterator from() throws CorruptDataException {
    J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
    MM_GCExtensionsPointer gcext = GCExtensions.getGCExtensionsPointer();
    MM_HeapRegionManagerPointer hrm = gcext.heapRegionManager();
    return fromMMHeapRegionManager(hrm, true, true);
}
Also used : MM_HeapRegionManagerPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer) J9JavaVMPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer) MM_GCExtensionsPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_GCExtensionsPointer)

Example 2 with MM_HeapRegionManagerPointer

use of com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer 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 3 with MM_HeapRegionManagerPointer

use of com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer in project openj9 by eclipse.

the class DTFJJavaHeap method initRegions.

@SuppressWarnings("unchecked")
private void initRegions() throws com.ibm.j9ddr.CorruptDataException {
    MM_GCExtensionsPointer gcext = GCExtensions.getGCExtensionsPointer();
    MM_HeapRegionManagerPointer hrm = gcext.heapRegionManager();
    regions = IteratorHelpers.toList(GCHeapRegionIterator.fromMMHeapRegionManager(hrm, space, true, true));
}
Also used : MM_HeapRegionManagerPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer) MM_GCExtensionsPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_GCExtensionsPointer)

Example 4 with MM_HeapRegionManagerPointer

use of com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer in project openj9 by eclipse.

the class HeapWalker method initializeFlatLockedMonitors.

private static void initializeFlatLockedMonitors() throws CorruptDataException {
    J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
    MM_GCExtensionsPointer gcext = GCExtensions.getGCExtensionsPointer();
    MM_HeapRegionManagerPointer hrm = gcext.heapRegionManager();
    flatLockedMonitors = new TreeSet<ObjectMonitor>();
    GCHeapRegionIterator regions = GCHeapRegionIterator.fromMMHeapRegionManager(hrm, true, true);
    while (regions.hasNext()) {
        GCHeapRegionDescriptor region = regions.next();
        if (!flatLockedMonitorsByRegion.containsKey(region)) {
            runFlatLockMonitorRegionWalk(vm, region);
        }
        /* Running the walk should have populated the flatLockedMonitors map */
        assert (flatLockedMonitorsByRegion.containsKey(region));
        flatLockedMonitors.addAll(flatLockedMonitorsByRegion.get(region));
    }
}
Also used : GCHeapRegionDescriptor(com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionDescriptor) MM_HeapRegionManagerPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer) GCHeapRegionIterator(com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionIterator) J9JavaVMPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer) MM_GCExtensionsPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_GCExtensionsPointer) ObjectMonitor(com.ibm.j9ddr.vm29.j9.ObjectMonitor)

Example 5 with MM_HeapRegionManagerPointer

use of com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer in project openj9 by eclipse.

the class ACCommand method run.

public void run(String command, String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {
    try {
        J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
        if (command.equalsIgnoreCase("!acforobject")) {
            if (null == heapRegionManager) {
                MM_HeapRegionManagerPointer hrmPointer;
                hrmPointer = MM_GCExtensionsPointer.cast(vm.gcExtensions()).heapRegionManager();
                heapRegionManager = GCHeapRegionManager.fromHeapRegionManager(hrmPointer);
            }
            if (args.length < 1) {
                throw new DDRInteractiveCommandException("Invalid number of arguments specified.");
            }
            long addr = Long.decode(args[0]);
            J9ObjectPointer objectPointer = J9ObjectPointer.cast(addr);
            dumpACForObject(vm, objectPointer, out);
        } else {
            MM_GCExtensionsPointer gcExtensions = MM_GCExtensionsPointer.cast(vm.gcExtensions());
            if (args.length < 1) {
                throw new DDRInteractiveCommandException("Invalid number of arguments specified.");
            }
            boolean dumpACExternalReferences = false;
            boolean dumpOwnedRegions = false;
            for (int i = 1; i < args.length; i++) {
                String arg = args[i];
                if (arg.equalsIgnoreCase("xrefs")) {
                    dumpACExternalReferences = true;
                } else if (arg.equalsIgnoreCase("ownedRegions")) {
                    dumpOwnedRegions = true;
                } else {
                    throw new DDRInteractiveCommandException("Unrecognized acforobject subcommand -->" + arg);
                }
            }
            long addr = Long.decode(args[0]);
            MM_AllocationContextPointer ac = MM_AllocationContextPointer.cast(addr);
            if (dumpACExternalReferences) {
                // TODO: handle other AC types
                if (GCExtensions.isVLHGC()) {
                    context.execute("!mm_allocationcontexttarok", new String[] { args[0] }, out);
                }
                dumpLiveReferences(vm, ac, out);
            }
            if (dumpOwnedRegions) {
                dumpOwnedRegions(vm, ac, out);
            }
        }
    } catch (DDRInteractiveCommandException e) {
        throw e;
    } catch (Throwable e) {
        e.printStackTrace(out);
        throw new DDRInteractiveCommandException(e);
    }
}
Also used : MM_AllocationContextPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_AllocationContextPointer) MM_HeapRegionManagerPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer) DDRInteractiveCommandException(com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException) J9JavaVMPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer) MM_GCExtensionsPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_GCExtensionsPointer) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)

Aggregations

MM_HeapRegionManagerPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer)8 MM_GCExtensionsPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_GCExtensionsPointer)4 J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)3 CorruptDataException (com.ibm.j9ddr.CorruptDataException)2 Table (com.ibm.j9ddr.tools.ddrinteractive.Table)2 GCHeapRegionManager (com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionManager)2 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)2 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)1 ObjectMonitor (com.ibm.j9ddr.vm29.j9.ObjectMonitor)1 GCHeapRegionDescriptor (com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionDescriptor)1 GCHeapRegionIterator (com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionIterator)1 MM_AllocationContextPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_AllocationContextPointer)1 MM_AllocationContextTarokPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_AllocationContextTarokPointer)1 MM_OwnableSynchronizerObjectListPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_OwnableSynchronizerObjectListPointer)1