Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Re-introduce induced garbage collection (GC) as an optional part of Cache trimming

Found in

EPiServer.CMS.Core 12.0.0

Fixed in

EPiServer.CMS.Core 12.15.0

(Or a related package)

Created

Feb 16, 2023

Updated

May 22, 2023

Area

CMS Core

State

Closed, Fixed and tested


Description

Adding an option to tweak garbage collection (GC) in relation to cache trimming.
When memory usage approaches a configured threshold, in-memory cache is trimmed, but performing a garbage collection is required to free up the memory held by evicted cache items. For this reason, the cache trimmer waits for a full generation 2 GC before trimming again; this was different from the .NET framework runtime where cache trimming ended with a forced GC. Forced GC is normally not good practice, but this fix adds CacheMemoryMonitorOptions.InducedGcInterval to reintroduce a similar behavior if the automatic GC timing (determined by the runtime) is insufficient in certain implementations.