Test for memory leaks in .NET applications

后端 未结 7 1506
攒了一身酷
攒了一身酷 2021-02-09 12:43

Are there any good(and free) tools for either analyzing static source or running programs to help detect memory leaks?

I\'ve built some windows services and want to make

相关标签:
7条回答
  • 2021-02-09 13:06

    Let your service run and use Performance Monitor to collect information about the memory usage of the service. Also, if you use any unmanaged resources make sure your code properly disposes of these resources using IDisposable. In an unmanaged environment you can easily have leaks by simply forgetting to release pointers, but that is not possible in a managed environment. However, if you keep allocating new objects and keep references to them so they cannot be garbage collected your service will require more and more memory.

    0 讨论(0)
提交回复
热议问题