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 intprivate intprivate short[]private static final intprivate static final intprivate static final intprivate static final intprivate intprivate final short[][]private static final intprotected intprivate static final intprivate static final intprotected final AdaptivePoolingAllocatorprivate final booleanprotected intprivate static final intprivate final int[] -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateAllocationStatistics(AdaptivePoolingAllocator parent, boolean shareable) -
Method Summary
Modifier and TypeMethodDescriptionprotected intGet the preferred chunk size, based on statistics from the recorded allocation sizes.protected voidrecordAllocationSize(int bucket) private void(package private) static intsizeBucket(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.
-