Tool for diagnosing memory leaks in .NET (ASP.NET

2019-02-02 00:54发布

问题:

we need a tool to detect easily memory leaks in an ASP.NET Application. We have an application, which consumes lot of memory.

Thanks

回答1:

Rob Mariani wrote a nice article on Tracking down managed memory leaks which helped me track down the dangling references in a desktop application.



回答2:

Using WinDbg is not as easy as using dotTrace but it can help you to discover lots of oddities in your application. Other than that you can find invaluable information about debugging ASP.Net applications on Tess Ferrandez's blog.



回答3:

I have published a new article on the subject on MSDN. It contains a list of tools.



回答4:

Well, "easily" is the trick... however dotTRACE might be worth a look.



回答5:

check out Microsoft's FxCop which also analyzes performance issues, etc.



回答6:

.Net Memory Profiler. Used the trial version once. It was helpful, but I don't need it often enough to warrant buying one.

The thing I found was to ALWAYS make sure you dispose of any resources, particularly in DirectoryServices, that implement IDisposable.



回答7:

I read about Ants Profiler. Good luck.



回答8:

Read Tess at If broken it is, fix it you should. It should get you on the right path.



回答9:

I found this one quite useful too: http://www.codeproject.com/Articles/19490/Memory-Leak-Detection-in-NET

Summary of the interesting points:

  1. Use Perfmon to monitor .Net CLR Locks/# of current logic threads to see if you are creating threads but not destroying them.
  2. Use Perfmon to compare .Net CLR/# Bytes vs. Process/Private bytes to see if it is managed or unmanaged memory that is leaking
  3. Assuming its managed memory that is leaking, using windbg/sos.dll to track down the references