Search in sources :

Example 11 with GCHeapRegionDescriptor

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

the class GCCardTable method cleanCardsInRegion.

public void cleanCardsInRegion(GCHeapRegionDescriptor region, GCCardCleaner cardCleaner) throws CorruptDataException {
    U8Pointer lowCard = heapAddrToCardAddr(region.getLowAddress());
    U8Pointer highCard = heapAddrToCardAddr(region.getHighAddress());
    cleanRange(lowCard, highCard, cardCleaner);
}
Also used : U8Pointer(com.ibm.j9ddr.vm29.pointer.U8Pointer)

Example 12 with GCHeapRegionDescriptor

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

the class GCHeapRegionManager method initializeAuxRegionDescriptors.

protected void initializeAuxRegionDescriptors() throws CorruptDataException {
    GCHeapRegionDescriptor[] auxRegions = new GCHeapRegionDescriptor[_auxRegionCount];
    if (auxRegions.length > 0) {
        MM_HeapRegionDescriptorPointer current = _heapRegionManager._auxRegionDescriptorList();
        for (int i = 0; i < _auxRegionCount; i++) {
            auxRegions[i] = GCHeapRegionDescriptor.fromHeapRegionDescriptor(current);
            current = current._nextRegion();
        }
    }
    _auxRegionDescriptorList = auxRegions;
}
Also used : MM_HeapRegionDescriptorPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionDescriptorPointer)

Example 13 with GCHeapRegionDescriptor

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

the class GCMemoryPool method freeEntryCheckGeneric.

/**
 * Check individual entries. This check is the same for ALL collectors
 * @param freeListEntry A structure to a free entry for all collectors (except Balanced)
 * @throws CorruptFreeEntryException This needs to be caught by a listener to be of any use
 * @return None. This function throws exceptions which are caught by the listener in checkFreeLists()
 */
protected void freeEntryCheckGeneric(GCHeapLinkedFreeHeader freeListEntry) throws CorruptDataException, CorruptFreeEntryException {
    MM_HeapLinkedFreeHeaderPointer freeListEntryAddress = freeListEntry.getHeader();
    UDATA size = freeListEntry.getSize();
    GCHeapRegionDescriptor region = getRegion();
    U8Pointer entryEndingAddressInclusive = U8Pointer.cast(freeListEntry.getHeader()).add(size.sub(1));
    if (freeListEntry.getHeader().isNull()) {
        throw new CorruptFreeEntryException("freeEntryCorrupt", freeListEntryAddress);
    }
    /* Make sure its a multi-slot dead object */
    if (!(ObjectModel.isDeadObject(freeListEntry.getObject()) && !ObjectModel.isSingleSlotDeadObject(freeListEntry.getObject()))) {
        throw new CorruptFreeEntryException("freeEntryCorrupt", freeListEntryAddress);
    }
    /* Self checks */
    if (!region.isAddressInRegion(VoidPointer.cast(freeListEntryAddress))) {
        throw new CorruptFreeEntryException("freeEntryCorrupt", freeListEntryAddress);
    }
    if (!region.isAddressInRegion(VoidPointer.cast(entryEndingAddressInclusive))) {
        throw new CorruptFreeEntryException("sizeFieldInvalid", freeListEntryAddress);
    }
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) MM_HeapLinkedFreeHeaderPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapLinkedFreeHeaderPointer) U8Pointer(com.ibm.j9ddr.vm29.pointer.U8Pointer)

Example 14 with GCHeapRegionDescriptor

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

the class GCMemoryPool method fromMemoryPoolPointerInRegion.

public static GCMemoryPool fromMemoryPoolPointerInRegion(GCHeapRegionDescriptor region, MM_MemoryPoolPointer memoryPool) throws CorruptDataException {
    MM_GCExtensionsPointer gcExtensions = GCBase.getExtensions();
    boolean splitFreeListsEnabled = gcExtensions.splitFreeListSplitAmount().gt(1);
    boolean isConcurrentSweepEnabled = gcExtensions.concurrentSweep();
    if (GCExtensions.isSegregatedHeap()) {
        /* Segregated heap may be used with a standard collector.  This check must be done first. */
        return new GCMemoryPoolAggregatedCellList(region, memoryPool);
    } else if (GCExtensions.isStandardGC()) {
        String poolName = memoryPool._poolName().getCStringAtOffset(0);
        if (poolName.equals("Allocate/Survivor1") || poolName.equals("Allocate/Survivor2")) {
            return new GCMemoryPoolAddressOrderedList(region, memoryPool);
        }
        /* This can be done without comparing poolName to the names but for consistency sake, compare them */
        if (poolName.equals("Unknown") || poolName.equals("LOA") || poolName.equals("Tenure")) {
            if (splitFreeListsEnabled) {
                if (isConcurrentSweepEnabled) {
                    return new GCMemoryPoolAddressOrderedList(region, memoryPool);
                } else {
                    return new GCMemoryPoolSplitAddressOrderedList(region, memoryPool);
                }
            } else {
                return new GCMemoryPoolAddressOrderedList(region, memoryPool);
            }
        }
        throw new CorruptDataException("Unreachable");
    } else if (GCExtensions.isVLHGC()) {
        throw new UnsupportedOperationException("Balanced GC not supported");
    }
    throw new CorruptDataException("Unreachable");
}
Also used : MM_GCExtensionsPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_GCExtensionsPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 15 with GCHeapRegionDescriptor

use of com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionDescriptor 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)

Aggregations

GCHeapRegionDescriptor (com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionDescriptor)13 CorruptDataException (com.ibm.j9ddr.CorruptDataException)10 GCHeapRegionIterator (com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionIterator)8 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)7 UDATA (com.ibm.j9ddr.vm29.types.UDATA)7 GCObjectHeapIterator (com.ibm.j9ddr.vm29.j9.gc.GCObjectHeapIterator)4 GCObjectIterator (com.ibm.j9ddr.vm29.j9.gc.GCObjectIterator)3 GCScavengerForwardedHeader (com.ibm.j9ddr.vm29.j9.gc.GCScavengerForwardedHeader)3 U8Pointer (com.ibm.j9ddr.vm29.pointer.U8Pointer)3 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)3 MM_HeapRegionDescriptorVLHGCPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionDescriptorVLHGCPointer)3 Table (com.ibm.j9ddr.tools.ddrinteractive.Table)2 VoidPointer (com.ibm.j9ddr.vm29.pointer.VoidPointer)2 MM_AllocationContextTarokPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_AllocationContextTarokPointer)2 MM_GCExtensionsPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_GCExtensionsPointer)2 MM_HeapRegionDescriptorPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionDescriptorPointer)2 MM_HeapRegionManagerPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer)2 CorruptData (com.ibm.dtfj.image.CorruptData)1 InvalidDataTypeException (com.ibm.j9ddr.InvalidDataTypeException)1 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)1