Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
4.5.13
-
None
Description
BasicHttpCacheStorage has a memory leak in the root response's variantMap. When a variant cached entry is evicted due to CacheMap being too large, the root cache entry does not remove the variant key in its variantMap. This is a memory leak that can grow the variantMap indefinitely, or until the root entry get's evicted itself.
Simplified testcase:
- A request is being sent from a client that contains a header "x-my-variant" with a hash of the current timestamp.
- The server responds 200, with a cacheable response. The response Vary's on "x-my-variant"
- These requests repeat, causing:
- The "root" CacheEntry to be kept in CacheMap
- The oldest variant CacheEntry to be evicted due to the CacheMap size limit
- However the "root" CacheEntry never removes the evicted variant keys from the variantMap