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 intdatumCountprivate intdatumTargetprivate short[]histoprivate static intHISTO_BUCKET_COUNTprivate static intHISTO_MAX_BUCKET_MASKprivate static intHISTO_MAX_BUCKET_SHIFTprivate static intHISTO_MIN_BUCKET_SHIFTprivate inthistoIndexprivate short[][]histosprivate static intINIT_DATUM_TARGETprotected intlocalPrefChunkSizeprivate static intMAX_DATUM_TARGETprivate static intMIN_DATUM_TARGETprotected AdaptivePoolingAllocatorparentprivate booleanshareableprotected intsharedPrefChunkSizeprivate static intSIZE_MAX_MASKprivate int[]sums
-
Constructor Summary
Constructors Modifier Constructor Description privateAllocationStatistics(AdaptivePoolingAllocator parent, boolean shareable)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intpreferredChunkSize()Get the preferred chunk size, based on statistics from the recorded allocation sizes.protected voidrecordAllocationSize(int bucket)private voidrotateHistograms()(package private) static intsizeBucket(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.
-
-