Open jiangxinlingdu opened 5 years ago
针对第二幅图,关于Nomal缓存大小,并不是图二里面的16M最大,源代码里面最大仅仅是可以缓存到32k而已,源码如下:
// 32 kb is the default maximum capacity of the cached buffer. Similar to what is explained in
// 'Scalable memory allocation using jemalloc'
DEFAULT_MAX_CACHED_BUFFER_CAPACITY = SystemPropertyUtil.getInt(
"io.netty.allocator.maxCachedBufferCapacity", 32 * 1024);
http://www.jiangxinlingdu.com/netty/2019/04/27/pooledbytebufallocator.html
Netty的内存管理其实做的很精细,我们一起来看看吧!