public class PooledByteBufAllocator extends AbstractByteBufAllocator implements ByteBufAllocatorMetricProvider
Modifier and Type | Field and Description |
---|---|
static PooledByteBufAllocator |
DEFAULT |
Constructor and Description |
---|
PooledByteBufAllocator() |
PooledByteBufAllocator(boolean preferDirect) |
PooledByteBufAllocator(boolean preferDirect, int nHeapArena, int nDirectArena, int pageSize, int maxOrder)
|
PooledByteBufAllocator(boolean preferDirect, int nHeapArena, int nDirectArena, int pageSize, int maxOrder, int tinyCacheSize, int smallCacheSize, int normalCacheSize)
|
PooledByteBufAllocator(boolean preferDirect, int nHeapArena, int nDirectArena, int pageSize, int maxOrder, int tinyCacheSize, int smallCacheSize, int normalCacheSize, boolean useCacheForAllThreads) |
PooledByteBufAllocator(boolean preferDirect, int nHeapArena, int nDirectArena, int pageSize, int maxOrder, int tinyCacheSize, int smallCacheSize, int normalCacheSize, boolean useCacheForAllThreads, int directMemoryCacheAlignment) |
PooledByteBufAllocator(int nHeapArena, int nDirectArena, int pageSize, int maxOrder) |
Modifier and Type | Method and Description |
---|---|
int |
chunkSize()
|
static int |
defaultMaxOrder()
默认最大订单 - 系统属性:io.netty.allocator.maxOrder - 默认11
|
static int |
defaultNormalCacheSize()
默认正常缓存大小 - 系统属性:io.netty.allocator.normalCacheSize - 默认64
|
static int |
defaultNumDirectArena()
直接竞技场的默认数量 - 系统属性:io.netty.allocator.numDirectArenas - 默认2 *核心
|
static int |
defaultNumHeapArena()
堆场的默认数量 - 系统属性:io.netty.allocator.numHeapArenas - 默认2 *内核
|
static int |
defaultPageSize()
默认缓冲页面大小 - 系统属性:io.netty.allocator.pageSize - 默认8192
|
static boolean |
defaultPreferDirect()
默认优先直接 - 系统属性:io.netty.noPreferDirect - 默认为false
|
static int |
defaultSmallCacheSize()
默认的小缓存大小 - 系统属性:io.netty.allocator.smallCacheSize - 默认值为256
|
static int |
defaultTinyCacheSize()
默认的微小缓存大小 - 系统属性:io.netty.allocator.tinyCacheSize - 默认512
|
static boolean |
defaultUseCacheForAllThreads()
默认线程缓存行为 - 系统属性:io.netty.allocator.useCacheForAllThreads - 默认为true
|
java.util.List<PoolArenaMetric> |
directArenas()
|
java.lang.String |
dumpStats()
以字符串的形式返回分配器(包含所有度量)的状态。
|
void |
freeThreadLocalCache()
已过时。
|
boolean |
hasThreadLocalCache()
已过时。
|
java.util.List<PoolArenaMetric> |
heapArenas()
|
boolean |
isDirectBufferPooled()
如果直接拨打 true 则返回true
|
static boolean |
isDirectMemoryCacheAlignmentSupported()
返回
true 如果直接内存缓存对齐支持,
false 其他。
|
PooledByteBufAllocatorMetric |
metric()
|
protected ByteBuf |
newDirectBuffer(int initialCapacity, int maxCapacity)
创建直接 ByteBuf 给定参数:initialCapacity和MAXCAPACITY。
|
protected ByteBuf |
newHeapBuffer(int initialCapacity, int maxCapacity)
创建一个堆 ByteBuf 给定参数:initialCapacity和MAXCAPACITY。
|
int |
normalCacheSize()
|
int |
numDirectArenas()
|
int |
numHeapArenas()
|
int |
numThreadLocalCaches()
|
int |
smallCacheSize()
|
int |
tinyCacheSize()
|
buffer, buffer, buffer, calculateNewCapacity, compositeBuffer, compositeBuffer, compositeDirectBuffer, compositeDirectBuffer, compositeHeapBuffer, compositeHeapBuffer, directBuffer, directBuffer, directBuffer, heapBuffer, heapBuffer, heapBuffer, ioBuffer, ioBuffer, ioBuffer, toLeakAwareBuffer, toLeakAwareBuffer, toString
public static final PooledByteBufAllocator DEFAULT
public PooledByteBufAllocator()
public PooledByteBufAllocator(boolean preferDirect)
public PooledByteBufAllocator(int nHeapArena, int nDirectArena, int pageSize, int maxOrder)
@Deprecated public PooledByteBufAllocator(boolean preferDirect, int nHeapArena, int nDirectArena, int pageSize, int maxOrder)
@Deprecated public PooledByteBufAllocator(boolean preferDirect, int nHeapArena, int nDirectArena, int pageSize, int maxOrder, int tinyCacheSize, int smallCacheSize, int normalCacheSize)
public PooledByteBufAllocator(boolean preferDirect, int nHeapArena, int nDirectArena, int pageSize, int maxOrder, int tinyCacheSize, int smallCacheSize, int normalCacheSize, boolean useCacheForAllThreads)
public PooledByteBufAllocator(boolean preferDirect, int nHeapArena, int nDirectArena, int pageSize, int maxOrder, int tinyCacheSize, int smallCacheSize, int normalCacheSize, boolean useCacheForAllThreads, int directMemoryCacheAlignment)
protected ByteBuf newHeapBuffer(int initialCapacity, int maxCapacity)
AbstractByteBufAllocator
ByteBuf
给定参数:initialCapacity和MAXCAPACITY。
newHeapBuffer
AbstractByteBufAllocator
protected ByteBuf newDirectBuffer(int initialCapacity, int maxCapacity)
AbstractByteBufAllocator
ByteBuf
给定参数:initialCapacity和MAXCAPACITY。
newDirectBuffer
,上课
AbstractByteBufAllocator
public static int defaultNumHeapArena()
public static int defaultNumDirectArena()
public static int defaultPageSize()
public static int defaultMaxOrder()
public static boolean defaultUseCacheForAllThreads()
public static boolean defaultPreferDirect()
public static int defaultTinyCacheSize()
public static int defaultSmallCacheSize()
public static int defaultNormalCacheSize()
public static boolean isDirectMemoryCacheAlignmentSupported()
true
如果直接内存缓存对齐支持,
false
其他。
public boolean isDirectBufferPooled()
ByteBufAllocator
复制的描述
true
则返回true
isDirectBufferPooled
在界面
ByteBufAllocator
@Deprecated public boolean hasThreadLocalCache()
Thread
对分配的缓冲区有
ThreadLocal
缓存,则返回
true
。
@Deprecated public void freeThreadLocalCache()
Thread
所有缓存缓冲区。
public PooledByteBufAllocatorMetric metric()
ByteBufAllocatorMetricProvider
复制的描述
metric
在界面
ByteBufAllocatorMetricProvider
@Deprecated public int numHeapArenas()
@Deprecated public int numDirectArenas()
@Deprecated public java.util.List<PoolArenaMetric> heapArenas()
List
所有堆PoolArenaMetric
这个池提供的秒。
@Deprecated public java.util.List<PoolArenaMetric> directArenas()
List
所有直接的PoolArenaMetric
这个池提供的秒。
@Deprecated public int numThreadLocalCaches()
PooledByteBufAllocator
使用的线程本地缓存的数量。
@Deprecated public int tinyCacheSize()
@Deprecated public int smallCacheSize()
@Deprecated public int normalCacheSize()
@Deprecated public final int chunkSize()
public java.lang.String dumpStats()
Copyright © 2008–2018 The Netty Project. All rights reserved.