I am using the memory cache reserve data in memory about 120 GB I know its too large but its the best practice for my project the issue is I am using the memory cache object as the following
I created static object for the cache memory
var collection = new System.Collections.Specialized.NameValueCollection();
collection.Add("CacheMemoryLimitMegaBytes", "155000");
//var memoryCashe = new MemoryCache("Images", collection);
MemoryCachingProvider.cache = new MemoryCache("Images", collection);
//Here how I add new item
CacheItemPolicy policy = new CacheItemPolicy();
policy.Priority = CacheItemPriority.NotRemovable;
cache.Add(key, value, policy);
but the memory became empty after period of time if I didn't use it.
I am building web API application
and I have enough space in the RAM about 170 GB
any suggestions