I was trying to find a way to know what percentage of my System.Runtime.Caching.MemoryCache is used. I know how I can configure the limits of the memory cache by using the CacheMemoryLimitMegabytes and PhysicalMemoryLimitPercentage, but my question is how in any moment of my program running I can check what percentage of the defined memory limit is used?
I looked the MS documentation https://learn.microsoft.com/en-us/dotnet/api/system.runtime.caching.memorycache?view=dotnet-plat-ext-6.0, but couldn't find what I was looking for. There are again two properties that get me the limit in bytes and the % of physical memory that can be used, but nothing for the current state.