@ManagedObject public class LeakTrackingByteBufferPool extends ContainerLifeCycle implements ByteBufferPool
AbstractLifeCycle.AbstractLifeCycleListenerByteBufferPool.Bucket, ByteBufferPool.LeaseContainer.InheritedListener, Container.ListenerDumpable.DumpableContainerLifeCycle.Listener| Constructor and Description |
|---|
LeakTrackingByteBufferPool(ByteBufferPool delegate) |
| Modifier and Type | Method and Description |
|---|---|
java.nio.ByteBuffer |
acquire(int size,
boolean direct)
Requests a
ByteBuffer of the given size. |
void |
clearTracking()
Clears the tracking data returned by
getLeakedAcquires(),
getLeakedReleases(), getLeakedResources(). |
long |
getLeakedAcquires() |
long |
getLeakedReleases() |
long |
getLeakedRemoves() |
long |
getLeakedResources() |
protected void |
leaked(LeakDetector.LeakInfo leakInfo) |
void |
release(java.nio.ByteBuffer buffer)
Returns a
ByteBuffer, usually obtained with ByteBufferPool.acquire(int, boolean)
(but not necessarily), making it available for recycling and reuse. |
void |
remove(java.nio.ByteBuffer buffer)
Removes a
ByteBuffer that was previously obtained with ByteBufferPool.acquire(int, boolean). |
addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeansaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitnewByteBufferisDumpabledumpContainer, dumpIterable, dumpMapEntries, dumpObjects, dumpSelf, namedpublic LeakTrackingByteBufferPool(ByteBufferPool delegate)
public java.nio.ByteBuffer acquire(int size,
boolean direct)
ByteBufferPoolRequests a ByteBuffer of 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.
acquire in interface ByteBufferPoolsize - the size of the bufferdirect - whether the buffer must be direct or notByteBufferPool.release(ByteBuffer)public void release(java.nio.ByteBuffer buffer)
ByteBufferPoolReturns a ByteBuffer, usually obtained with ByteBufferPool.acquire(int, boolean)
(but not necessarily), making it available for recycling and reuse.
release in interface ByteBufferPoolbuffer - the buffer to returnByteBufferPool.acquire(int, boolean)public void remove(java.nio.ByteBuffer buffer)
ByteBufferPoolRemoves a ByteBuffer that was previously obtained with ByteBufferPool.acquire(int, boolean).
The buffer will not be available for further reuse.
remove in interface ByteBufferPoolbuffer - the buffer to removeByteBufferPool.acquire(int, boolean),
ByteBufferPool.release(ByteBuffer)@ManagedAttribute(value="Clears the tracking data") public void clearTracking()
getLeakedAcquires(),
getLeakedReleases(), getLeakedResources().@ManagedAttribute(value="The number of acquires that produced a leak") public long getLeakedAcquires()
@ManagedAttribute(value="The number of releases that produced a leak") public long getLeakedReleases()
@ManagedAttribute(value="The number of removes that produced a leak") public long getLeakedRemoves()
@ManagedAttribute(value="The number of resources that were leaked") public long getLeakedResources()
protected void leaked(LeakDetector.LeakInfo leakInfo)
Copyright © 1995–2021 Webtide. All rights reserved.