title: Memory cache c# .net
body: <p>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 </p>
  
  <p>I created static object for the cache memory</p>
  
  <pre><code>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);
  </code></pre>
  
  <p>but the memory became empty after period of time if I didn't use it.</p>
  
  <p>I am building web API application </p>
  
  <p>and I have enough space in the RAM about 170 GB</p>
  
  <p>any suggestions</p>