Project

Profile

Help

Bug #1481

closed

Memory "leak" caused by ThreadLocal converter cache

Added by Michael Kay about 12 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Performance
Sprint/Milestone:
-
Start date:
2012-04-17
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

Saxon maintains a cache of "converter" objects for converting/casting values from type A to type B: if the same conversion is performed repeatedly, this avoids complex navigation of the type hierarchy to decide what to do. The cache is an LRU cache held in ThreadLocal. Because the converter objects contain a reference to a Configuration, in the case where many Configuration objects are created they can end up not being garbage collected. The fact that the cache is LRU should avoid this in theory, but in practice it seems the number of ThreadLocal objects on the heap can greatly exceed the number of threads, leading to a large number of Configuration objects, and their associated resources such as the namePool and TypeHierarchy, being locked down in memory.


Related issues

Has duplicate Saxon - Bug #1619: Memory leak generated by ConversionRules cachingDuplicateMichael Kay2012-09-04

Actions

Please register to edit this issue

Also available in: Atom PDF