You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] MetaDataCache: unbounded CACHE (maximumSize=Integer.MAX_VALUE) + MAPPING Set never shrunk #6565
CACHE is a WindowTinyLFUMap built with maximumSize = Integer.MAX_VALUE, which disables size-based eviction entirely; there is no expireAfterWrite. The class comment at line 148 even acknowledges OOM risk yet configures an unbounded size. MAPPING (ConcurrentMap<String, Set<String>>) is populated by initCache: for wildcard metadata paths the reverse-mapping ConcurrentSkipListSet under each metaPath collects every distinct request path ever matched. clean(key) removes CACHE entries but never clears the Set itself and never removes it from MAPPING; remove(MetaData) only calls clean(path).
MetaDataCache.obtain(path) is called every request from the global plugin and divide/context-path/rewrite plugins. High-cardinality request paths (e.g. /api/users/{userId} with millions of distinct IDs) cause monotonic, unbounded heap growth in both CACHE and the MAPPING ConcurrentSkipListSet (memory-heavy per entry) that survives metadata refreshes. Slow OOM over days/weeks for public-facing REST gateways.
Suggested fix
Set a real configurable maximumSize and expireAfterAccess; in clean(key), after removing CACHE entries, also MAPPING.get(key).clear() and MAPPING.remove(key).
Related existing issue(s)
#6506 is the CachePlugin (response caching); this is the metadata path cache. #6479 is discovery-upstream cache staleness; this is selector/metadata cache growth.
Activity
github-actions commentedon Aug 2, 2026
👋 Hello @Aias00
A new issue has been opened by @Aias00:
Please review when you have time. Thank you! 🙏