[
https://issues.apache.org/jira/browse/ARTEMIS-4024?focusedWorklogId=814102&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-814102
]
ASF GitHub Bot logged work on ARTEMIS-4024:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 05/Oct/22 20:06
Start Date: 05/Oct/22 20:06
Worklog Time Spent: 10m
Work Description: gtully commented on code in PR #4240:
URL: https://github.com/apache/activemq-artemis/pull/4240#discussion_r985928699
##########
artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java:
##########
@@ -558,6 +564,21 @@ public void physicalSend(Command command) throws
IOException {
}
+ private void chunkSend(final ByteSequence bytes, final int bufferSize,
final int maxPacketSize) {
+ if (logger.isTraceEnabled()) {
+ logger.trace("Sending a big packet sized as {} with smaller packets
of {}", bufferSize, maxPacketSize);
+ }
+ for (int posBuffer = 0; posBuffer < bufferSize; posBuffer +=
maxPacketSize) {
+ int chunkSize = Math.min(bufferSize - posBuffer, maxPacketSize);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Sending a partial packet of {} bytes, starting at
{}", chunkSize, posBuffer);
+ }
+ final ActiveMQBuffer buffer =
transportConnection.createTransportBuffer(chunkSize);
Review Comment:
makes sense, it can't be in the pipeline twice.
Issue Time Tracking
-------------------
Worklog Id: (was: 814102)
Time Spent: 50m (was: 40m)
> Avoid excessive NativeMemory allocation when sending OpenWire Multi mega
> sized messages in openwire
> ---------------------------------------------------------------------------------------------------
>
> Key: ARTEMIS-4024
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4024
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Reporter: Clebert Suconic
> Assignee: Robbie Gemmell
> Priority: Major
> Fix For: 2.27.0
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> when sending a large message in openwire, we will read the entire file on the
> memory, make the conversion from core, and send it on net
> throughOpenWireProtocolManager::sendPhisical.
> Such allocation should be limited and be sent in chunks.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)