title: When does System.Runtime.Caching.MemoryCache remove expired entries?
body: <p>At what point does <code>System.Runtime.Caching.MemoryCache</code> invalidate expired entries?
  Is there some worker thread removing old entries from the internal store or are expired items removed when you access other methods on the cache?</p>
  
  <p>The documentation does not state when and how the expired items are dealt with.</p>
  
  <p>This question is about the inner workings of the class, not how to use the API, thus, no code example.</p>
  
  <p>If I add a billion items to the cache with a short expiration time, then let the system sleep for a few hours, will the expired items still linger around untill I touch the cache, or will they be cleared out as time pass by?</p>
  
  <p>[edit]
  This is apparently a duplicate of <a href="https://stackoverflow.com/questions/1434284/when-does-asp-net-remove-expired-cache-items?rq=1">When Does Asp.Net Remove Expired Cache Items?</a></p>
  
  <p>the related suggestions are better than the search feature here on SO</p>