changed to     private static final int DEFAULT_MAX_MESSAGE_SIZE = 1 << 30;
@@ -52,7 +52,7 @@ public class TcpEventHandler<T extends NetworkContext<T>> implements EventHandle
private static final Logger LOG = LoggerFactory.getLogger(TcpEventHandler.class);
private static final AtomicBoolean FIRST_HANDLER = new AtomicBoolean();
public static final int TARGET_WRITE_SIZE = Integer.getInteger("TcpEventHandler.targetWriteSize", 1024);
- private static final int TWICE_DEFAULT_MAX_MESSAGE_SIZE = 128 << 20;
+ private static final int DEFAULT_MAX_MESSAGE_SIZE = 1 << 30;
public static boolean DISABLE_TCP_NODELAY = Boolean.getBoolean("disable.tcp_nodelay");
static {
@@ -118,10 +118,9 @@ public class TcpEventHandler<T extends NetworkContext<T>> implements EventHandle
}
//We have to provide back pressure to restrict the buffer growing beyond,2GB because it reverts to
- // being Native bytes, we should also provide back pressure if we are not able to keep up,
- // limited to twice max message size
- inBBB = Bytes.elasticByteBuffer(TCP_BUFFER + OS.pageSize(), max(TCP_BUFFER + OS.pageSize(), TWICE_DEFAULT_MAX_MESSAGE_SIZE));
- outBBB = Bytes.elasticByteBuffer(TCP_BUFFER, max(TCP_BUFFER, TWICE_DEFAULT_MAX_MESSAGE_SIZE));
+ // being Native bytes, we should also provide back pressure if we are not able to keep up
+ inBBB = Bytes.elasticByteBuffer(TCP_BUFFER + OS.pageSize(), max(TCP_BUFFER + OS.pageSize(), DEFAULT_MAX_MESSAGE_SIZE));
+ outBBB = Bytes.elasticByteBuffer(TCP_BUFFER, max(TCP_BUFFER, DEFAULT_MAX_MESSAGE_SIZE));
// TODO Fix Chronicle-Queue-Enterprise tests so socket connections are closed cleanly.
BytesUtil.unregister(inBBB);
