2013-02-23 103 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。