public static void checkOrphans() { SimpleMemoryAllocatorImpl allocator = SimpleMemoryAllocatorImpl.getAllocator(); long end = System.currentTimeMillis() + 30000; List<MemoryBlock> orphans = allocator.getOrphans(); //Wait for the orphans to go away (may be in HDFS queue that needs to drain) while(orphans != null && !orphans.isEmpty() && System.currentTimeMillis() < end) { try { Thread.sleep(100); } catch (InterruptedException e) { throw new RuntimeException(e); } orphans = allocator.getOrphans(); } if(orphans != null && ! orphans.isEmpty()) { List<RefCountChangeInfo> info = allocator.getRefCountInfo(orphans.get(0).getMemoryAddress()); System.out.println("FOUND ORPHAN!!"); System.out.println("Sample orphan: " + orphans.get(0)); System.out.println("Orpan info: " + info); } Assert.assertEquals(Collections.emptyList(), orphans); }
if (SimpleMemoryAllocatorImpl.trackReferenceCounts()) { List<RefCountChangeInfo> history = SimpleMemoryAllocatorImpl .getRefCountInfo(aChunk.getMemoryAddress()); if (history != null) { String logStr = "extraRefs for @" + Long.toHexString( .append(refCount).append("\n"); List<RefCountChangeInfo> history = SimpleMemoryAllocatorImpl .getRefCountInfo(lobChunk.getMemoryAddress()); if (history != null) { String logStr = "extraRefs for @" + Long.toHexString(
" rc=" + aChunk.getRefCount(); List<RefCountChangeInfo> info = SimpleMemoryAllocatorImpl .getRefCountInfo(aChunk.getMemoryAddress()); String logStr; if (info != null) {
" @" + Long.toHexString(aChunk.getMemoryAddress()) + "\n"); if (SimpleMemoryAllocatorImpl.trackReferenceCounts()) { List<RefCountChangeInfo> history = SimpleMemoryAllocatorImpl.getRefCountInfo(aChunk.getMemoryAddress()); if (history != null) { String logStr = "extraRefs for @" + Long.toHexString(aChunk.getMemoryAddress()) + " rc=" + refCount + " history=" + history; refCountErrStr.append(localReg.getFullPath() + " key " + key + " lob at address " + lobChunk.getMemoryAddress() + " has off-heap refCount " + refCount + "\n"); List<RefCountChangeInfo> history = SimpleMemoryAllocatorImpl.getRefCountInfo(lobChunk.getMemoryAddress()); if (history != null) { String logStr = "extraRefs for @" + Long.toHexString(lobChunk.getMemoryAddress()) + " rc=" + refCount + " history=" + history;
Chunk aChunk = orphanedChunks.get(i); aStr = "orphaned @" + Long.toHexString(aChunk.getMemoryAddress()) + " rc=" + aChunk.getRefCount(); List<RefCountChangeInfo> info = SimpleMemoryAllocatorImpl.getRefCountInfo(aChunk.getMemoryAddress()); String logStr; if (info != null) {