Where are .NET 4.0 MemoryCache performance counters?
I am looking for their name and I can't find any.
Thank you,
In-Memory Cache is used for when you want to implement cache in a single process. When the process dies, the cache dies with it. If you're running the same process on several servers, you will have a separate cache for each server. Persistent in-process Cache is when you back up your cache outside of process memory.
You can dispose the MemoryCache. Default cache and then re-set the private field singleton to null, to make it recreate the MemoryCache. Default.
Exception performance counters. The Performance console . NET CLR Exceptions category includes counters that provide information about the exceptions thrown by an application.
That's a loaded question with a very long answer. I doubt it is going to be helpful, let's talk about the real problem you are trying to solve. Those performance counters have to be registered first before you can see them.
Start an elevated console prompt (right-click the shortcut and use Run as Administrator) and type these commands:
cd C:\Windows\Microsoft.NET\Framework\v4.0.30319 lodctr netmemorycache.ini
That adds the required registry entries so the MemoryCache can create these counters at runtime. Start your program so an instance of MemoryCache is created. Run Perfmon.exe, right-click the graph, Add Counters and pick from the added ".NET Memory Cache 4.0" category. Also select the instance of your program.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With