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:07:43 UTC
[jira] Updated: (AMQ-3162) ActiveMQ checkpoint worker makes
unnecessary repeated calls to Journal.getFileMap(), leading to excessive
memory usage
[ 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.