Search in sources :

Example 6 with MM_HeapRegionManagerPointer

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

Example 7 with MM_HeapRegionManagerPointer

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

the class CheckEngine method regionForAddress.

// TODO kmt : this doesn't belong here
private GCHeapRegionDescriptor regionForAddress(AbstractPointer pointer) {
    try {
        if (null == _hrm) {
            MM_HeapRegionManagerPointer hrm = MM_GCExtensionsPointer.cast(_javaVM.gcExtensions()).heapRegionManager();
            _hrm = GCHeapRegionManager.fromHeapRegionManager(hrm);
        }
        return _hrm.regionDescriptorForAddress(pointer);
    } catch (CorruptDataException cde) {
    }
    return null;
}
Also used : MM_HeapRegionManagerPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 8 with MM_HeapRegionManagerPointer

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

the class CheckOwnableSynchronizerList method check.

@Override
public void check() {
    try {
        MM_HeapRegionManagerPointer heapRegionManager = getGCExtensions().heapRegionManager();
        long maximumOwnableSynchronizerCountOnHeap = heapRegionManager._totalHeapSize().longValue() / J9Consts.J9_GC_MINIMUM_OBJECT_SIZE;
        MM_OwnableSynchronizerObjectListPointer ownableSynchronizerObjectList = getGCExtensions().ownableSynchronizerObjectLists();
        while (ownableSynchronizerObjectList.notNull()) {
            J9ObjectPointer object = ownableSynchronizerObjectList._head();
            long ownableSynchronizerCount = 0;
            _engine.clearPreviousObjects();
            while (object.notNull()) {
                if (_engine.checkSlotOwnableSynchronizerList(object, ownableSynchronizerObjectList) != CheckBase.J9MODRON_SLOT_ITERATOR_OK) {
                    break;
                }
                ownableSynchronizerCount += 1;
                if (ownableSynchronizerCount > maximumOwnableSynchronizerCountOnHeap) {
                    _engine.reportOwnableSynchronizerCircularReferenceError(object, ownableSynchronizerObjectList);
                    break;
                }
                _engine.pushPreviousObject(object);
                object = ObjectAccessBarrier.getOwnableSynchronizerLink(object);
            }
            ownableSynchronizerObjectList = ownableSynchronizerObjectList._nextList();
        }
    } catch (CorruptDataException e) {
    // TODO: handle exception
    }
    if (_engine.needVerifyOwnableSynchronizerConsistency()) {
        /* call verifyOwnableSynchronizerObjectCounts() only at the end of CheckOwnableSynchronizerList,
			 * verifyOwnableSynchronizerObjectCounts need both the count calculated in CheckObjectHeap and in CheckOwnableSynchronizerList
			 * assumption: CheckOwnableSynchronizerList always happens after CheckObjectHeap in CheckCycle  
			 */
        _engine.verifyOwnableSynchronizerObjectCounts();
    }
}
Also used : MM_HeapRegionManagerPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer) MM_OwnableSynchronizerObjectListPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_OwnableSynchronizerObjectListPointer)

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