Class AdaptivePoolingAllocator.AllocationStatistics

java.lang.Object
io.netty.buffer.AdaptivePoolingAllocator.AllocationStatistics
Direct Known Subclasses:
AdaptivePoolingAllocator.Magazine
Enclosing class:
AdaptivePoolingAllocator

private static class AdaptivePoolingAllocator.AllocationStatistics extends Object
  • Field Details

    • MIN_DATUM_TARGET

      private static final int MIN_DATUM_TARGET
      See Also:
    • MAX_DATUM_TARGET

      private static final int MAX_DATUM_TARGET
      See Also:
    • INIT_DATUM_TARGET

      private static final int INIT_DATUM_TARGET
      See Also:
    • HISTO_MIN_BUCKET_SHIFT

      private static final int HISTO_MIN_BUCKET_SHIFT
      See Also:
    • HISTO_MAX_BUCKET_SHIFT

      private static final int HISTO_MAX_BUCKET_SHIFT
      See Also:
    • HISTO_BUCKET_COUNT

      private static final int HISTO_BUCKET_COUNT
      See Also:
    • HISTO_MAX_BUCKET_MASK

      private static final int HISTO_MAX_BUCKET_MASK
      See Also:
    • SIZE_MAX_MASK

      private static final int SIZE_MAX_MASK
      See Also:
    • parent

      protected final AdaptivePoolingAllocator parent
    • shareable

      private final boolean shareable
    • histos

      private final short[][] histos
    • histo

      private short[] histo
    • sums

      private final int[] sums
    • histoIndex

      private int histoIndex
    • datumCount

      private int datumCount
    • datumTarget

      private int datumTarget
    • sharedPrefChunkSize

      protected volatile int sharedPrefChunkSize
    • localPrefChunkSize

      protected volatile int localPrefChunkSize
  • Constructor Details

  • Method Details

    • recordAllocationSize

      protected void recordAllocationSize(int bucket)
    • sizeBucket

      static int sizeBucket(int size)
    • rotateHistograms

      private void rotateHistograms()
    • preferredChunkSize

      protected int preferredChunkSize()
      Get the preferred chunk size, based on statistics from the recorded allocation sizes.

      This method must be thread-safe.

      Returns:
      The currently preferred chunk allocation size.