2013-02-23 106 views
1

我注意到Netty 4 Alpha 8和Netty 4 Beta 1之间的内存消耗(+70 mo)大幅增加Netty 4 beta1内存消耗

在使用java 7运行时的Win7上测试。

的Netty 4阿尔法8代码:https://github.com/ccheneau/Holmes/tree/b_netty_4_alpha_8/holmes-core/src/main/java/net/holmes/core/http

的Netty 4 Beta 1的代码:https://github.com/ccheneau/Holmes/tree/b_netty_4/holmes-core/src/main/java/net/holmes/core/http

有我丢失的东西?

+0

你能够提供给我们一个heapdump并在netty问题追踪器上打开一个问题吗? – 2013-02-25 05:40:56

+0

done issue 1088 created – 2013-02-25 18:30:11

回答

2

实际上,内存增量是由新的池化字节缓冲区分配器分配的内存。

使用UnpooledByteBufAllocator这样的:

ServerBootstrap sb = ... 
sb.childOption(ChannelOption.ALLOCATOR, UnpooledByteBufAllocator.HEAP_BY_DEFAULT); 

减少内存消耗,但可能也perfs。