Making LeakTracking more noisy

This commit is contained in:
Joakim Erdfelt 2015-03-04 22:14:48 -07:00
parent 5d29e6f351
commit 4396987ad5
1 changed files with 4 additions and 8 deletions

View File

@ -51,10 +51,8 @@ public class LeakTrackingByteBufferPool extends ContainerLifeCycle implements By
public ByteBuffer acquire(int size, boolean direct) public ByteBuffer acquire(int size, boolean direct)
{ {
ByteBuffer buffer = delegate.acquire(size, direct); ByteBuffer buffer = delegate.acquire(size, direct);
if (!leakDetector.acquired(buffer)) boolean leakd = leakDetector.acquired(buffer);
{ LOG.info(String.format("ByteBuffer acquire %s@%X leakd.acquired=%b", buffer, System.identityHashCode(buffer), leakd), new Throwable("LeakStack.Acquire"));
LOG.warn("ByteBuffer {}@{} not tracked", buffer, System.identityHashCode(buffer));
}
return buffer; return buffer;
} }
@ -63,10 +61,8 @@ public class LeakTrackingByteBufferPool extends ContainerLifeCycle implements By
{ {
if (buffer == null) if (buffer == null)
return; return;
if (!leakDetector.released(buffer)) boolean leakd = leakDetector.released(buffer);
{ LOG.info(String.format("ByteBuffer release %s@%X leakd.released=%b", buffer, System.identityHashCode(buffer), leakd), new Throwable("LeakStack.Release"));
LOG.warn("ByteBuffer " + buffer + "@" + System.identityHashCode(buffer) + " released but not acquired", new Throwable("LeakStack"));
}
delegate.release(buffer); delegate.release(buffer);
} }