Skip to content

Commit 25c7bf9

Browse files
Netty4: switch to composite cumulator (#49478)
The default merge cumulator used in netty transport leads to additional GC pressure and memory copying when a message that exceeds the chunk size is handled. This is especially a problem on G1 GC, since we get many "humongous" allocations and that can in theory cause real memory circuit breaker to break unnecessarily.
1 parent f39e839 commit 25c7bf9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/transport-netty4/src/main/java/org/elasticsearch/transport/netty4/Netty4SizeHeaderFrameDecoder.java

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ final class Netty4SizeHeaderFrameDecoder extends ByteToMessageDecoder {
3232

3333
private static final int HEADER_SIZE = TcpHeader.MARKER_BYTES_SIZE + TcpHeader.MESSAGE_LENGTH_SIZE;
3434

35+
{
36+
setCumulator(COMPOSITE_CUMULATOR);
37+
}
38+
3539
@Override
3640
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
3741
try {

0 commit comments

Comments
 (0)