ByteBufUtil to not pool direct memory by default
Motivation: ByteBufUtil by default will cache DirectByteBuffer objects, and the associated direct memory (up to 64k). In combination with the Recycler which may cache up to 32k elements per thread may lead to a large amount of direct memory being retained per EventLoop thread. As traffic spikes come this may be perceived as a memory leak because the memory in the Recycler will never be reclaimed. Modifications: - By default we shouldn't cache DirectByteBuffer objects. Result: Less direct memory consumption due to caching DirectByteBuffer objects.
This commit is contained in:
parent
7928a6fef3
commit
108fbe5282
@ -85,7 +85,7 @@ public final class ByteBufUtil {
|
|||||||
|
|
||||||
DEFAULT_ALLOCATOR = alloc;
|
DEFAULT_ALLOCATOR = alloc;
|
||||||
|
|
||||||
THREAD_LOCAL_BUFFER_SIZE = SystemPropertyUtil.getInt("io.netty.threadLocalDirectBufferSize", 64 * 1024);
|
THREAD_LOCAL_BUFFER_SIZE = SystemPropertyUtil.getInt("io.netty.threadLocalDirectBufferSize", 0);
|
||||||
logger.debug("-Dio.netty.threadLocalDirectBufferSize: {}", THREAD_LOCAL_BUFFER_SIZE);
|
logger.debug("-Dio.netty.threadLocalDirectBufferSize: {}", THREAD_LOCAL_BUFFER_SIZE);
|
||||||
|
|
||||||
MAX_CHAR_BUFFER_SIZE = SystemPropertyUtil.getInt("io.netty.maxThreadLocalCharBufferSize", 16 * 1024);
|
MAX_CHAR_BUFFER_SIZE = SystemPropertyUtil.getInt("io.netty.maxThreadLocalCharBufferSize", 16 * 1024);
|
||||||
|
Loading…
Reference in New Issue
Block a user