Perfmon counters to check memory leak

前端 未结 2 1107
栀梦
栀梦 2021-01-31 10:11

I want to check the memory leakage issue in my service. I have tried following set of perfmon counters.

  1. .NET CLR Memory\\# Bytes in all Heaps
  2. .NET CLR
2条回答
  •  耶瑟儿~
    2021-01-31 10:53

    There are better tools available to make memory leaks testing easier such as RedGate ANTS Memory Profiler and JetBrains dotMemory Profiler.

    However if you want to use Performance counters, this article explains how to use Performance Counters to test memory leaks.

    Keep in mind that Garbage Collection doesn't release memory immediately after some instance dispose. It has been optimized to trigger and release memory only when there is a memory stress. So, if you want to test for memory leaks you should execute Garbage Collection manually before you take counter readings.

    GC.Collect();
    GC.WaitForPendingFinalizers();
    

提交回复
热议问题