From 111b551d792c35c057aa592dfdae065f7e22fd73 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Wed, 3 Jun 2020 15:50:01 -0400 Subject: [PATCH] ARTEMIS-2789 AMQP Large Message Memory Estimate --- .../artemis/protocol/amqp/broker/AMQPLargeMessage.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPLargeMessage.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPLargeMessage.java index 0bbaffce1b..d37888f6a4 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPLargeMessage.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPLargeMessage.java @@ -374,9 +374,13 @@ public class AMQPLargeMessage extends AMQPMessage implements LargeServerMessage return 0; } + @Override public int getMemoryEstimate() { - return 0; + if (memoryEstimate == -1) { + memoryEstimate = memoryOffset * 2 + (extraProperties != null ? extraProperties.getEncodeSize() : 0); + } + return memoryEstimate; } @Override