Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
5.4.2
-
None
-
None
-
Patch Available
Description
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).