Search in sources :

Example 1 with MM_MemoryPoolPointer

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

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

the class GCStandardMemoryPoolIterator method advancePool.

/* Analog to the HeapMemoryPoolIterator.cpp:nextPool() */
private void advancePool() {
    try {
        boolean poolFound = false;
        MM_MemoryPoolPointer memoryPool = null;
        while (!poolFound && _regionIterator.hasNext()) {
            switch(_state) {
                case mm_heapmp_iterator_next_region:
                    _region = _regionIterator.next();
                    /* Based on current Modron architecture, the leafs of the sub spaces in standard collectors
						 * are of type SubSpaceGeneric. This might change in the future */
                    MM_MemorySubSpaceGenericPointer subSpaceGeneric = MM_MemorySubSpaceGenericPointer.cast(_region.getSubSpace());
                    if (subSpaceGeneric.notNull()) {
                        memoryPool = subSpaceGeneric._memoryPool();
                        if (memoryPool.notNull()) {
                            /* Does this Memory pool have children ? */
                            if (memoryPool._children().notNull()) {
                                /* Yes ..So we only return details of its children */
                                memoryPool = memoryPool._children();
                            }
                            _state = IteratorState.mm_heapmp_iterator_next_memory_pool;
                            poolFound = true;
                        }
                    }
                    break;
                case mm_heapmp_iterator_next_memory_pool:
                    /* Any more children ? */
                    memoryPool = _currentMemoryPool._next();
                    if (memoryPool.isNull()) {
                        _state = IteratorState.mm_heapmp_iterator_next_region;
                    } else {
                        poolFound = true;
                    }
                    break;
            }
        }
        if (poolFound) {
            /* Set currentMemoryPool to null to indicate we can't find any more pools */
            _currentMemoryPool = memoryPool;
        } else {
            _currentMemoryPool = null;
        }
    } catch (CorruptDataException e) {
        raiseCorruptDataEvent("Memory Pool corruption detected", e, false);
        _currentMemoryPool = null;
    }
}
Also used : MM_MemorySubSpaceGenericPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_MemorySubSpaceGenericPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) MM_MemoryPoolPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_MemoryPoolPointer)

Example 3 with MM_MemoryPoolPointer

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

the class GCTarokMemoryPoolIterator method advancePool.

private void advancePool() {
    _currentMemoryPool = null;
    _region = null;
    while (_regionIterator.hasNext()) {
        _region = _regionIterator.next();
        MM_MemoryPoolPointer tempPool = _region.getMemoryPool();
        if (tempPool.notNull()) {
            _currentMemoryPool = tempPool;
            break;
        }
    }
}
Also used : MM_MemoryPoolPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_MemoryPoolPointer)

Aggregations

CorruptDataException (com.ibm.j9ddr.CorruptDataException)2 MM_MemoryPoolPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_MemoryPoolPointer)2 MM_GCExtensionsPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_GCExtensionsPointer)1 MM_MemorySubSpaceGenericPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_MemorySubSpaceGenericPointer)1