Package io.netty.buffer
Class AdaptivePoolingAllocator.AllocationStatistics
java.lang.Object
io.netty.buffer.AdaptivePoolingAllocator.AllocationStatistics
- Direct Known Subclasses:
AdaptivePoolingAllocator.Magazine
- Enclosing class:
AdaptivePoolingAllocator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private int
private short[]
private static final int
private static final int
private static final int
private static final int
private int
private final short[][]
private static final int
protected int
private static final int
private static final int
protected final AdaptivePoolingAllocator
private final boolean
protected int
private static final int
private final int[]
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
AllocationStatistics
(AdaptivePoolingAllocator parent, boolean shareable) -
Method Summary
Modifier and TypeMethodDescriptionprotected int
Get the preferred chunk size, based on statistics from the recorded allocation sizes.protected void
recordAllocationSize
(int bucket) private void
(package private) static int
sizeBucket
(int size)
-
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
-
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 -
localPrefChunkSize
protected volatile int localPrefChunkSize
-
-
Constructor Details
-
AllocationStatistics
-
-
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.
-