Search in sources :

Example 1 with MM_MemoryPoolAggregatedCellListPointer

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

the class DumpSegregatedStatsCommand method getFreeCellCount.

/**
 * Count the number of free cells in the MM_HeapRegionDescriptorSegregatedPointer freelist
 * @throws CorruptDataException
 */
public long getFreeCellCount(MM_HeapRegionDescriptorSegregatedPointer heapRegionDescriptor) throws CorruptDataException {
    /* TODO assumes a small region */
    MM_MemoryPoolAggregatedCellListPointer memoryPoolACL = heapRegionDescriptor._memoryPoolACL();
    GCHeapLinkedFreeHeader heapLinkedFreeHeader = GCHeapLinkedFreeHeader.fromLinkedFreeHeaderPointer(memoryPoolACL._freeListHead());
    /* Get the size classes */
    J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
    J9VMGCSizeClassesPointer sizeClasses = vm.realtimeSizeClasses();
    UDATA sizeClassIndex = heapRegionDescriptor._sizeClass();
    long cellSize = sizeClasses.smallCellSizesEA().at(sizeClassIndex).longValue();
    long freeCellCount = 0;
    while (heapLinkedFreeHeader.getHeader().notNull()) {
        freeCellCount += heapLinkedFreeHeader.getSize().longValue() / cellSize;
        heapLinkedFreeHeader = heapLinkedFreeHeader.getNext();
    }
    return freeCellCount;
}
Also used : MM_MemoryPoolAggregatedCellListPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_MemoryPoolAggregatedCellListPointer) UDATA(com.ibm.j9ddr.vm29.types.UDATA) J9VMGCSizeClassesPointer(com.ibm.j9ddr.vm29.pointer.generated.J9VMGCSizeClassesPointer) J9JavaVMPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer) GCHeapLinkedFreeHeader(com.ibm.j9ddr.vm29.j9.gc.GCHeapLinkedFreeHeader)

Aggregations

GCHeapLinkedFreeHeader (com.ibm.j9ddr.vm29.j9.gc.GCHeapLinkedFreeHeader)1 J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)1 J9VMGCSizeClassesPointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMGCSizeClassesPointer)1 MM_MemoryPoolAggregatedCellListPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_MemoryPoolAggregatedCellListPointer)1 UDATA (com.ibm.j9ddr.vm29.types.UDATA)1