PoolUtils.erodingPool

Returns a pool that adaptively decreases its size when idle objects are no longer needed. This is intended as an always thread-safe alternative to using an idle object evictor provided by many pool implementations. This is also an effective way to shrink FIFO ordered pools that experience load spikes.

@param keyedPool the KeyedObjectPool to be decorated so it shrinks its idle count when possible. @param <K> the type of the pool key @param <V> the type of pool entries @return a pool that adaptively decreases its size when idle objects are no longer needed. @see #erodingPool(KeyedObjectPool, float) @see #erodingPool(KeyedObjectPool, float, bool)

Meta