java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.io.LeakTrackingByteBufferPool
- All Implemented Interfaces:
ByteBufferPool,org.eclipse.jetty.util.component.Container,org.eclipse.jetty.util.component.Destroyable,org.eclipse.jetty.util.component.Dumpable,org.eclipse.jetty.util.component.Dumpable.DumpableContainer,org.eclipse.jetty.util.component.LifeCycle
@ManagedObject
public class LeakTrackingByteBufferPool
extends org.eclipse.jetty.util.component.ContainerLifeCycle
implements ByteBufferPool
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.io.ByteBufferPool
ByteBufferPool.Bucket, ByteBufferPool.LeaseNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener -
Field Summary
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPINGFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionacquire(int size, boolean direct) Requests aByteBufferof the given size.voidClears the tracking data returned bygetLeakedAcquires(),getLeakedReleases(),getLeakedResources().longlonglonglongprotected voidleaked(org.eclipse.jetty.util.LeakDetector<ByteBuffer>.org.eclipse.jetty.util.LeakDetector.LeakInfo leakInfo) voidrelease(ByteBuffer buffer) Returns aByteBuffer, usually obtained withByteBufferPool.acquire(int, boolean)(but not necessarily), making it available for recycling and reuse.voidremove(ByteBuffer buffer) Removes aByteBufferthat was previously obtained withByteBufferPool.acquire(int, boolean).Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.io.ByteBufferPool
newByteBufferMethods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListenersMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dumpSelfMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Constructor Details
-
LeakTrackingByteBufferPool
-
-
Method Details
-
acquire
Description copied from interface:ByteBufferPoolRequests a
ByteBufferof the given size.The returned buffer may have a bigger capacity than the size being requested but it will have the limit set to the given size.
- Specified by:
acquirein interfaceByteBufferPool- Parameters:
size- the size of the bufferdirect- whether the buffer must be direct or not- Returns:
- the requested buffer
- See Also:
-
release
Description copied from interface:ByteBufferPoolReturns a
ByteBuffer, usually obtained withByteBufferPool.acquire(int, boolean)(but not necessarily), making it available for recycling and reuse.- Specified by:
releasein interfaceByteBufferPool- Parameters:
buffer- the buffer to return- See Also:
-
remove
Description copied from interface:ByteBufferPoolRemoves a
ByteBufferthat was previously obtained withByteBufferPool.acquire(int, boolean).The buffer will not be available for further reuse.
- Specified by:
removein interfaceByteBufferPool- Parameters:
buffer- the buffer to remove- See Also:
-
clearTracking
@ManagedAttribute("Clears the tracking data") public void clearTracking()Clears the tracking data returned bygetLeakedAcquires(),getLeakedReleases(),getLeakedResources(). -
getLeakedAcquires
@ManagedAttribute("The number of acquires that produced a leak") public long getLeakedAcquires()- Returns:
- count of ByteBufferPool.acquire() calls that detected a leak
-
getLeakedReleases
@ManagedAttribute("The number of releases that produced a leak") public long getLeakedReleases()- Returns:
- count of ByteBufferPool.release() calls that detected a leak
-
getLeakedRemoves
@ManagedAttribute("The number of removes that produced a leak") public long getLeakedRemoves()- Returns:
- count of ByteBufferPool.remove() calls that detected a leak
-
getLeakedResources
@ManagedAttribute("The number of resources that were leaked") public long getLeakedResources()- Returns:
- count of resources that were acquired but not released
-
leaked
protected void leaked(org.eclipse.jetty.util.LeakDetector<ByteBuffer>.org.eclipse.jetty.util.LeakDetector.LeakInfo leakInfo)
-