[ISSUE #9654] Optimize the bufferLocal size of the TimerMessageStore (#9655)

This commit is contained in:
ymwneu
2026-08-03 11:24:22 +08:00
committed by GitHub
parent a06836dd56
commit 89166af997
@@ -223,7 +223,10 @@ public class TimerMessageStore {
bufferLocal = new ThreadLocal<ByteBuffer>() {
@Override
protected ByteBuffer initialValue() {
return ByteBuffer.allocateDirect(storeConfig.getMaxMessageSize() + 100);
int maxMessageBodySize = storeConfig.getMaxMessageSize();
int maxMessageSize = Integer.MAX_VALUE - maxMessageBodySize >= 64 * 1024 ?
maxMessageBodySize + 64 * 1024 : Integer.MAX_VALUE;
return ByteBuffer.allocateDirect(maxMessageSize);
}
};