Minor tweaks to leak detector stuff
This commit is contained in:
parent
0d3b840951
commit
36340c4898
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue