gtully commented on a change in pull request #3407:
URL: https://github.com/apache/activemq-artemis/pull/3407#discussion_r559783349



##########
File path: 
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPStandardMessage.java
##########
@@ -124,12 +124,24 @@ protected ReadableBuffer getData() {
    @Override
    public int getMemoryEstimate() {
       if (memoryEstimate == -1) {
-         memoryEstimate = memoryOffset + (data != null ? data.capacity() : 0);
+         memoryEstimate = memoryOffset + (data != null ? data.capacity() + 
unmarshalledApplicationPropertiesMemoryEstimateFromData() : 0);
       }
 
       return memoryEstimate;
    }
 
+   private int unmarshalledApplicationPropertiesMemoryEstimateFromData() {
+      if (applicationProperties != null) {
+         // they have been unmarshalled, estimate memory usage based on their 
encoded size
+         if (remainingBodyPosition != VALUE_NOT_PRESENT) {
+            return remainingBodyPosition - applicationPropertiesPosition;

Review comment:
       hmm. 
org.apache.activemq.artemis.tests.integration.amqp.connect.AMQPReplicaTest#testReplicaCatchupOnQueueCreates
 looks to be timing dependent,  unrelated to the changes as far as i can see.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to