我注意到Netty 4 Alpha 8和Netty 4 Beta 1之间的内存消耗大幅增加(+70个月)
使用Java7运行时在Win7上进行了测试。
Netty 4 alpha 8代码:https://github.com/ccheneau/Holmes/tree/b_netty_4_alpha_8/holmes-core/src/main/java/net/holmes/core/http
NetTY4测试版1代码:https://github.com/ccheneau/Holmes/tree/b_netty_4/holmes-core/src/main/java/net/holmes/core/http
我是不是漏掉了什么?
发布于 2013-02-27 05:35:13
实际上,内存增量是由新的池化字节缓冲区分配器分配的内存。
像这样使用UnpooledByteBufAllocator:
ServerBootstrap sb = ...
sb.childOption(ChannelOption.ALLOCATOR, UnpooledByteBufAllocator.HEAP_BY_DEFAULT);减少内存消耗,但可能还会提高性能。
https://stackoverflow.com/questions/15041706
复制相似问题