gpt4 book ai didi

java - Netty 4 beta1内存消耗

转载 作者:行者123 更新时间:2023-11-30 04:29:18 25 4
gpt4 key购买 nike

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

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

Netty 4 alpha 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

我有什么遗漏吗?

最佳答案

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

像这样使用 UnpooledByteBufAllocator:

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

减少内存消耗,但也可能提高性能。

关于java - Netty 4 beta1内存消耗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15041706/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com