You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/11/22 10:56:00 UTC

[jira] [Work logged] (AMQ-8068) Topic memory leak on message eviction using UniquePropertyMessageEvictionStrategy

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

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

                Author: ASF GitHub Bot
            Created on: 22/Nov/20 10:55
            Start Date: 22/Nov/20 10:55
    Worklog Time Spent: 10m 
      Work Description: jbonofre opened a new pull request #583:
URL: https://github.com/apache/activemq/pull/583


   


----------------------------------------------------------------
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:
users@infra.apache.org


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

            Worklog Id:     (was: 515238)
    Remaining Estimate: 0h
            Time Spent: 10m

> Topic memory leak on message eviction using UniquePropertyMessageEvictionStrategy
> ---------------------------------------------------------------------------------
>
>                 Key: AMQ-8068
>                 URL: https://issues.apache.org/jira/browse/AMQ-8068
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.16.0
>            Reporter: Fraser Crossman
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>             Fix For: 5.17.0, 5.16.1, 5.15.14
>
>         Attachments: patchfile.txt
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The current implementation of UniquePropertyMessageEvictionStrategy does not conform to the expected behaviour of a MessageEvictionStrategySupport implementation resulting in a memory leak.
> All MessageEvictionStrategySupport implementations remove from the passed list of MessageReference objects the messages that should be evicted and then returns those items in an array. The calling code expects this to be the case and decrements message reference counters accordingly.
> The current implementation of UniquePropertyMessageEvictionStrategy does one of two things depending on the state of the buffered messages:
>  # If the buffer already contains a single message per unique property then the oldest message is returned in the array for message removal but is not removed from the passed message list. This leaves a reference to the message intended for removal in the passed message reference list - not intended behaviour. (i.e. intended behaviour is identical to OldestMessageEvictionStrategy)
>  # If the buffer contains more than one instance of a message with the same unique property then only the latest messages (largest timestamp) for each of those sets are removed from the passed list of message references. At this point, the passed list of message references contains all the messages we expect to be removed so it is converted to an array and returned. But this list should contain all those messages that should be retained - not intended behaviour.
> The patch contains the necessary changes to UniquePropertyMessageEvictionStrategy to prevent this memory leak and an assertion added to the UniquePropertyMessageEvictionStrategyTest.testEviction to demonstrate the memory is correctly freed after applying the fix.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)