You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Craig Condit (JIRA)" <ji...@apache.org> on 2011/01/26 00:05:46 UTC

[jira] Created: (AMQ-3162) ActiveMQ checkpoint worker makes unnecessary repeated calls to Journal.getFileMap(), leading to excessive memory usage

ActiveMQ checkpoint worker makes unnecessary repeated calls to Journal.getFileMap(), leading to excessive memory usage
----------------------------------------------------------------------------------------------------------------------

                 Key: AMQ-3162
                 URL: https://issues.apache.org/jira/browse/AMQ-3162
             Project: ActiveMQ
          Issue Type: Bug
    Affects Versions: 5.4.2
            Reporter: Craig Condit
            Priority: Minor


During its cleanup run (default every 30 seconds), MessageDatabase.checkpointUpdate() attempts to determine which data files are safe to delete. It calls Journal.getFileMap() repeatedly within a loop to determine if the file is referenced in memory. Journal.getFileMap() creates a new TreeMap from the underlying map. Unfortunately, as the number of data files grows on a busy broker, this can be called hundreds or even thousands of times, leading to excessive run time, memory churn, and overall poor performance (observed in our environment).

The attached patch simply moves the call to getFileMap() outside the loop so that it runs in O(gcCandidates.size) vs. O(gcCandidates.size * fileMap.size).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (AMQ-3162) ActiveMQ checkpoint worker makes unnecessary repeated calls to Journal.getFileMap(), leading to excessive memory usage

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3162?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Tully reassigned AMQ-3162:
-------------------------------

    Assignee: Gary Tully

> ActiveMQ checkpoint worker makes unnecessary repeated calls to Journal.getFileMap(), leading to excessive memory usage
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-3162
>                 URL: https://issues.apache.org/jira/browse/AMQ-3162
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.4.2
>            Reporter: Craig Condit
>            Assignee: Gary Tully
>         Attachments: avoid-getfilemap.patch
>
>
> During its cleanup run (default every 30 seconds), MessageDatabase.checkpointUpdate() attempts to determine which data files are safe to delete. It calls Journal.getFileMap() repeatedly within a loop to determine if the file is referenced in memory. Journal.getFileMap() creates a new TreeMap from the underlying map. Unfortunately, as the number of data files grows on a busy broker, this can be called hundreds or even thousands of times, leading to excessive run time, memory churn, and overall poor performance (observed in our environment).
> The attached patch simply moves the call to getFileMap() outside the loop so that it runs in O(gcCandidates.size) vs. O(gcCandidates.size * fileMap.size).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AMQ-3162) ActiveMQ checkpoint worker makes unnecessary repeated calls to Journal.getFileMap(), leading to excessive memory usage

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3162?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Tully resolved AMQ-3162.
-----------------------------

       Resolution: Fixed
    Fix Version/s: 5.5.0

variant of patch applied in r1063669, with thanks :-)

URL: http://svn.apache.org/viewvc?rev=1063669&view=rev

> ActiveMQ checkpoint worker makes unnecessary repeated calls to Journal.getFileMap(), leading to excessive memory usage
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-3162
>                 URL: https://issues.apache.org/jira/browse/AMQ-3162
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.4.2
>            Reporter: Craig Condit
>            Assignee: Gary Tully
>             Fix For: 5.5.0
>
>         Attachments: avoid-getfilemap.patch
>
>
> During its cleanup run (default every 30 seconds), MessageDatabase.checkpointUpdate() attempts to determine which data files are safe to delete. It calls Journal.getFileMap() repeatedly within a loop to determine if the file is referenced in memory. Journal.getFileMap() creates a new TreeMap from the underlying map. Unfortunately, as the number of data files grows on a busy broker, this can be called hundreds or even thousands of times, leading to excessive run time, memory churn, and overall poor performance (observed in our environment).
> The attached patch simply moves the call to getFileMap() outside the loop so that it runs in O(gcCandidates.size) vs. O(gcCandidates.size * fileMap.size).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQ-3162) ActiveMQ checkpoint worker makes unnecessary repeated calls to Journal.getFileMap(), leading to excessive memory usage

Posted by "Craig Condit (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3162?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig Condit updated AMQ-3162:
------------------------------

    Attachment: avoid-getfilemap.patch

> ActiveMQ checkpoint worker makes unnecessary repeated calls to Journal.getFileMap(), leading to excessive memory usage
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-3162
>                 URL: https://issues.apache.org/jira/browse/AMQ-3162
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.4.2
>            Reporter: Craig Condit
>            Priority: Minor
>         Attachments: avoid-getfilemap.patch
>
>
> During its cleanup run (default every 30 seconds), MessageDatabase.checkpointUpdate() attempts to determine which data files are safe to delete. It calls Journal.getFileMap() repeatedly within a loop to determine if the file is referenced in memory. Journal.getFileMap() creates a new TreeMap from the underlying map. Unfortunately, as the number of data files grows on a busy broker, this can be called hundreds or even thousands of times, leading to excessive run time, memory churn, and overall poor performance (observed in our environment).
> The attached patch simply moves the call to getFileMap() outside the loop so that it runs in O(gcCandidates.size) vs. O(gcCandidates.size * fileMap.size).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQ-3162) ActiveMQ checkpoint worker makes unnecessary repeated calls to Journal.getFileMap(), leading to excessive memory usage

Posted by "Craig Condit (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3162?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig Condit updated AMQ-3162:
------------------------------

    Priority: Major  (was: Minor)

> ActiveMQ checkpoint worker makes unnecessary repeated calls to Journal.getFileMap(), leading to excessive memory usage
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-3162
>                 URL: https://issues.apache.org/jira/browse/AMQ-3162
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.4.2
>            Reporter: Craig Condit
>         Attachments: avoid-getfilemap.patch
>
>
> During its cleanup run (default every 30 seconds), MessageDatabase.checkpointUpdate() attempts to determine which data files are safe to delete. It calls Journal.getFileMap() repeatedly within a loop to determine if the file is referenced in memory. Journal.getFileMap() creates a new TreeMap from the underlying map. Unfortunately, as the number of data files grows on a busy broker, this can be called hundreds or even thousands of times, leading to excessive run time, memory churn, and overall poor performance (observed in our environment).
> The attached patch simply moves the call to getFileMap() outside the loop so that it runs in O(gcCandidates.size) vs. O(gcCandidates.size * fileMap.size).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.