How to measure memory usage for a Live ASP.NET MVC web application?

RPM1984 picture RPM1984 · Oct 7, 2011 · Viewed 13.4k times · Source

So right off the bat, not sure if this question is better suited for another StackExchange site.

I've got an ASP.NET MVC 3 web application running on Windows Server 2008 and IIS 7.5

Site runs fine initially, but i can see the memory usage gradually growing. After about 12 hours it's nearly out of memory and the site chokes.

I'm using a lot of caching, so i'm thinking this combined with some possibly memory leaks is the cause of the issue.

So my question - what's the best way (tools, for example) to monitor memory usage on a web server running ASP.NET MVC?

In the past i've used good old' perfmon and put the IIS counters on to measure these things.

It this still the best way, and if so, can someone recommend a good perfmon counter template for my scenario?

Answer

Mitch Wheat picture Mitch Wheat · Oct 7, 2011

Perfmon's counters are still a good technique (and free!).

PAL (Performance Analysis of Logs), a free tool, has an ASP.NET perfmon counter template for general health (in addition to generating reports of counter log files based on thresholds).

Check out:

Commercial tools like MemProfiler, RedGate's memory profiling tool and JetBrains Profiler are all very good (and all have free trials).