[ 
https://issues.apache.org/jira/browse/AMQ-9343?focusedWorklogId=885958&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-885958
 ]

ASF GitHub Bot logged work on AMQ-9343:
---------------------------------------

                Author: ASF GitHub Bot
            Created on: 18/Oct/23 15:11
            Start Date: 18/Oct/23 15:11
    Worklog Time Spent: 10m 
      Work Description: cshannon commented on PR #1075:
URL: https://github.com/apache/activemq/pull/1075#issuecomment-1768703665

   Yeah I saw that it ran out of space, I will try and force it to build as it 
would be good to have it run before merging it. The change should be fine but 
you never know.




Issue Time Tracking
-------------------

    Worklog Id:     (was: 885958)
    Time Spent: 0.5h  (was: 20m)

> Reduce inflight transaction memory footprint in KahaDB
> ------------------------------------------------------
>
>                 Key: AMQ-9343
>                 URL: https://issues.apache.org/jira/browse/AMQ-9343
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: KahaDB
>            Reporter: Christopher L. Shannon
>            Assignee: Christopher L. Shannon
>            Priority: Major
>             Fix For: 6.0.0, 5.18.3, 5.17.6
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> When transacted messages are sent KahaDB tracks the inflight and prepared 
> (for XA) add commands in a map so that when the transaction is eventually 
> committed the commands can be used to update the KahaDB index. Currently the 
> entire message is kept inside the map while the transaction is pending. This 
> is not a problem for small/quick transactions but for transactions that are 
> long running and/or have a lot of pending (or big) messages before commit 
> this can use up a decent amount of memory and cause GC pressure.
> To reduce memory we can go ahead and just clear the message from the command 
> after it is stored in the journal. The pending operations that are queued up 
> to be processed on commit only need metadata from the add command (such as 
> message id and destination) so the actual messages are no longer needed and 
> can be cleared. This is a pretty easy change and should help for edge cases 
> with a large number of pending message sends or big messages.
> Note that on broker restart/recovery the messages are loaded again for 
> pending transactions and processed (such as XA in the prepared state) and the 
> messages are needed for processing recovery for XA transactions so the memory 
> will be higher again as the inflight and prepared maps will track the entire 
> message again (just like before this change) but this should be fine as it is 
> just during recovery and once finished and the broker is online again it will 
> clear the new incoming messages.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to