Package io.netty.buffer
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 java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private int
datumCount
private int
datumTarget
private short[]
histo
private static int
HISTO_BUCKET_COUNT
private static int
HISTO_MAX_BUCKET_MASK
private static int
HISTO_MAX_BUCKET_SHIFT
private static int
HISTO_MIN_BUCKET_SHIFT
private int
histoIndex
private short[][]
histos
private static int
INIT_DATUM_TARGET
protected int
localPrefChunkSize
private static int
MAX_DATUM_TARGET
private static int
MIN_DATUM_TARGET
protected AdaptivePoolingAllocator
parent
private boolean
shareable
protected int
sharedPrefChunkSize
private static int
SIZE_MAX_MASK
private int[]
sums
-
Constructor Summary
Constructors Modifier Constructor Description private
AllocationStatistics(AdaptivePoolingAllocator parent, boolean shareable)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
preferredChunkSize()
Get the preferred chunk size, based on statistics from the recorded allocation sizes.protected void
recordAllocationSize(int bucket)
private void
rotateHistograms()
(package private) static int
sizeBucket(int size)
-
-
-
Field Detail
-
MIN_DATUM_TARGET
private static final int MIN_DATUM_TARGET
- See Also:
- Constant Field Values
-
MAX_DATUM_TARGET
private static final int MAX_DATUM_TARGET
- See Also:
- Constant Field Values
-
INIT_DATUM_TARGET
private static final int INIT_DATUM_TARGET
- See Also:
- Constant Field Values
-
HISTO_MIN_BUCKET_SHIFT
private static final int HISTO_MIN_BUCKET_SHIFT
- See Also:
- Constant Field Values
-
HISTO_MAX_BUCKET_SHIFT
private static final int HISTO_MAX_BUCKET_SHIFT
- See Also:
- Constant Field Values
-
HISTO_BUCKET_COUNT
private static final int HISTO_BUCKET_COUNT
- See Also:
- Constant Field Values
-
HISTO_MAX_BUCKET_MASK
private static final int HISTO_MAX_BUCKET_MASK
- See Also:
- Constant Field Values
-
SIZE_MAX_MASK
private static final int SIZE_MAX_MASK
- See Also:
- Constant Field Values
-
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 Detail
-
AllocationStatistics
private AllocationStatistics(AdaptivePoolingAllocator parent, boolean shareable)
-
-
Method Detail
-
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.
-
-