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.");
}
}
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;
}
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();
}
}
Aggregations