Package io.netty.util

Class Recycler<T>

java.lang.Object
io.netty.util.Recycler<T>
Type Parameters:
T - the type of the pooled object

public abstract class Recycler<T> extends Object
Light-weight object pool based on a thread-local stack.
  • Field Details

    • logger

      private static final InternalLogger logger
    • NOOP_HANDLE

      private static final Recycler.EnhancedHandle<?> NOOP_HANDLE
    • DEFAULT_INITIAL_MAX_CAPACITY_PER_THREAD

      private static final int DEFAULT_INITIAL_MAX_CAPACITY_PER_THREAD
      See Also:
    • DEFAULT_MAX_CAPACITY_PER_THREAD

      private static final int DEFAULT_MAX_CAPACITY_PER_THREAD
    • RATIO

      private static final int RATIO
    • DEFAULT_QUEUE_CHUNK_SIZE_PER_THREAD

      private static final int DEFAULT_QUEUE_CHUNK_SIZE_PER_THREAD
    • BLOCKING_POOL

      private static final boolean BLOCKING_POOL
    • BATCH_FAST_TL_ONLY

      private static final boolean BATCH_FAST_TL_ONLY
    • maxCapacityPerThread

      private final int maxCapacityPerThread
    • interval

      private final int interval
    • chunkSize

      private final int chunkSize
    • threadLocal

      private final FastThreadLocal<Recycler.LocalPool<T>> threadLocal
  • Constructor Details

    • Recycler

      protected Recycler()
    • Recycler

      protected Recycler(int maxCapacityPerThread)
    • Recycler

      @Deprecated protected Recycler(int maxCapacityPerThread, int maxSharedCapacityFactor)
      Deprecated.
      Use one of the following instead: Recycler(), Recycler(int), Recycler(int, int, int).
    • Recycler

      @Deprecated protected Recycler(int maxCapacityPerThread, int maxSharedCapacityFactor, int ratio, int maxDelayedQueuesPerThread)
      Deprecated.
      Use one of the following instead: Recycler(), Recycler(int), Recycler(int, int, int).
    • Recycler

      @Deprecated protected Recycler(int maxCapacityPerThread, int maxSharedCapacityFactor, int ratio, int maxDelayedQueuesPerThread, int delayedQueueRatio)
      Deprecated.
      Use one of the following instead: Recycler(), Recycler(int), Recycler(int, int, int).
    • Recycler

      protected Recycler(int maxCapacityPerThread, int ratio, int chunkSize)
  • Method Details