clebertsuconic commented on code in PR #6323:
URL: https://github.com/apache/artemis/pull/6323#discussion_r3037342905
##########
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPLargeMessage.java:
##########
@@ -604,8 +618,10 @@ public long getWholeMessageSize() {
@Override
public synchronized int getMemoryEstimate() {
if (memoryEstimate == -1) {
- memoryEstimate = memoryOffset * 2 + (extraProperties != null ?
extraProperties.getEncodeSize() : 0);
- originalEstimate = memoryEstimate;
+ // the applicationPropertiesSize is * 4 to give us some room to
estimate the size of the applicationProperties after decoding.
+ // A lot of testing was done in AMQPGlobalMaxTest to determine this
factor. It can always be further adjusted
+ // Also it's better to overestimate than to underestimate as that
could lead to OutOfMemoryException
+ memoryEstimate = MINIMUM_ESTIMATE + (extraProperties != null ?
extraProperties.getEncodeSize() : 0) + applicationPropertiesSize * 4;
Review Comment:
I'm using the count like the core now, but it's not making much difference.
from my tests a more accurate estimate would be 3X.. however I'm using the
number of properties now.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]