Skip to content

Commit 44f6857

Browse files
committed
Use Netty's pooled memory allocator
Instead of the adaptative one, which is the default in 4.2. The pooled allocator was the default in 4.1.
1 parent 28ae5ae commit 44f6857

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/qpid/org/apache/qpid/protonj2/client/transport/netty4/TcpTransport.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.util.concurrent.CountDownLatch;
2424
import java.util.concurrent.atomic.AtomicBoolean;
2525

26+
import io.netty.buffer.PooledByteBufAllocator;
2627
import org.apache.qpid.protonj2.buffer.ProtonBuffer;
2728
import org.apache.qpid.protonj2.buffer.ProtonBufferAllocator;
2829
import org.apache.qpid.protonj2.buffer.ProtonBufferComponent;
@@ -412,6 +413,7 @@ private void configureNetty(Bootstrap bootstrap, TransportOptions options) {
412413
bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, options.connectTimeout());
413414
bootstrap.option(ChannelOption.SO_KEEPALIVE, options.tcpKeepAlive());
414415
bootstrap.option(ChannelOption.SO_LINGER, options.soLinger());
416+
bootstrap.option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT);
415417

416418
if (options.sendBufferSize() != -1) {
417419
bootstrap.option(ChannelOption.SO_SNDBUF, options.sendBufferSize());

0 commit comments

Comments
 (0)