Minor tweaks to leak detector stuff

This commit is contained in:
Joakim Erdfelt 2014-01-08 14:54:39 -07:00
parent 0d3b840951
commit 36340c4898
2 changed files with 5 additions and 5 deletions

View File

@ -37,6 +37,7 @@ public class LeakTrackingByteBufferPool extends ContainerLifeCycle implements By
LeakTrackingByteBufferPool.this.leaked(leakInfo);
}
};
private final ByteBufferPool delegate;
public LeakTrackingByteBufferPool(ByteBufferPool delegate)
@ -51,7 +52,7 @@ public class LeakTrackingByteBufferPool extends ContainerLifeCycle implements By
{
ByteBuffer buffer = delegate.acquire(size, direct);
if (!leakDetector.acquired(buffer))
LOG.info("ByteBuffer {}@{} not tracked", buffer, System.identityHashCode(buffer));
LOG.warn("ByteBuffer {}@{} not tracked", buffer, System.identityHashCode(buffer));
return buffer;
}
@ -59,12 +60,12 @@ public class LeakTrackingByteBufferPool extends ContainerLifeCycle implements By
public void release(ByteBuffer buffer)
{
if (!leakDetector.released(buffer))
LOG.info("ByteBuffer {}@{} released but not acquired", buffer, System.identityHashCode(buffer));
LOG.warn("ByteBuffer {}@{} released but not acquired", buffer, System.identityHashCode(buffer));
delegate.release(buffer);
}
protected void leaked(LeakDetector.LeakInfo leakInfo)
protected void leaked(LeakDetector<ByteBuffer>.LeakInfo leakInfo)
{
LOG.info("ByteBuffer " + leakInfo.getResourceDescription() + " leaked at:", leakInfo.getStackFrames());
LOG.warn("ByteBuffer " + leakInfo.getResourceDescription() + " leaked at:", leakInfo.getStackFrames());
}
}

View File

@ -20,7 +20,6 @@ package org.eclipse.jetty.util;
import java.lang.ref.PhantomReference;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.WeakReference;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;