Incorrect JSON renderings size calculation logic causes HTML cache memory leak


Description

Sitecore uses type caching to optimize the cache size calculation. This results in an incorrect calculation of the cache size for JSON renderings added to the HTML cache. The issue might cause an HTML cache memory leak.

To confirm that the solution is affected by this particular issue:

  1. Collect a memory dump file.
  2. Check for a discrepancy between the actual cache size from the memory dump file and the estimated cache size shown on the /sitecore/admin/cache.aspx page.

Solution

To resolve the issue, consider one of the following options: