ASP.Net Worker Process Memory Profile Tools

99封情书 提交于 2019-11-30 09:57:28

ANTS Profiler is very good at profiling ASP.NET applications.

There's a free way.

  • launch the task manager
  • right-click the w3wp process
  • select "create dump" (I'm amazed how few people know about this feature - including myself at some point!)
  • copy the dump file to your local machine (so we don't bother the production server)
  • open the file in Visual Studio
  • enjoy
  • select "Debug Managed memory" for advanced view which class uses memory etc.

AFAIK, the above requires Visual Studio "Ultimate" edition (I guess its called "Enterprise" now?). If you don't have one, then follow these steps (very simple too)

  • launch WinDbg (free tool, part of Windows SDK, there are tons of answers here on StackOverflow on how to download WinDbg without all the SDK bloatware)
  • Press Ctrl + D and load the dump file into WinDbg
  • type .loadby sos clr (this will load SOS.dll that allows WinDbg to analyze .NET processes, SOS.dll is a part of NET Framework so you probably already have it)
  • type !dumpheap -stat (this will output the class names, sorted by memory usage, ascending order. Skip system.string and system.byte[] classes cause these are side-effects, not the cause...)

UPDATE FROM 2019: WinDbg is now available via MS Store, just search for "WinDbg", then couple of clicks and its there.

Something like ANTS memory profiler might be useful to you.

Also consider AQTime from Automated QA.

dotTrace from JetBrains saved me several times. It is not free (trial is available), but it is really powerfull!

J.W.

We use AviCode, and it works pretty good for us.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!