为什么Netty创建Entry的时候需要加96字节? 96字节有什么特殊含义吗?
Why do I need to add 96 bytes when Netty creates an Entry? Does 96 bytes have any special meaning?
static Entry newInstance(Object msg, int size, long total, ChannelPromise promise) {
**entry.pendingSize = size + CHANNEL_OUTBOUND_BUFFER_ENTRY_OVERHEAD;**
}
这是 java 对象在堆中需要的内存量。我们使用这个数量来更新 Channel
的 writability
,因此可以将 Channel
标记为可写或不可写。
static Entry newInstance(Object msg, int size, long total, ChannelPromise promise) {
**entry.pendingSize = size + CHANNEL_OUTBOUND_BUFFER_ENTRY_OVERHEAD;**
}
这是 java 对象在堆中需要的内存量。我们使用这个数量来更新 Channel
的 writability
,因此可以将 Channel
标记为可写或不可写。