Wednesday, March 12, 2008

Asp.Net - Memory & Performance

There has been a lot of discussion and information about performance of Asp.Net applications and any possible leaks. First, I would like to point to couple of MSDN articles related to this topic (though they are bit old articles still a good read).

The first one is 10 tips for high-performance web applications.

And the second one, which all of us must read and track, is Performance monitoring Asp.Net applications.

We all consider these points (and more) during architecture and design/development phases. However, we still might find our apps either showing poor performance (especially during peak loads) or, worse, memory leaks. Obviously there is no single best model that fits every design. Any measure we take must be evaluated for its possible counter effects on the environment.

For example, consider caching. Overly caching, for example huge datasets, might seem to work fine in testing but shows overall performance problem in a production environment. The amount and levels of caching should be considered very carefully during our initial design. Also, remember to set our app pool memory limits (IIS 6) if we notice any out-of-memory exceptions.

Memory leaks - this is not a good thing to happen in our apps. But let's admit it, we have seen this in many apps, though .Net handles memory very efficiently. A little bit of googling on this topic pulls a lot of information but wanted to point to an article by Mike Bloise about Tracing memory leaks with ANTS Profiler. I had used this tool and think its really worth the investment if we are determined in getting to the bottom of the problem.

In summary, it's an ongoing challenge and battle to keep our apps tuned. Reliability, modularity, performance and efficiency are some of the key factors for a good design.

Love coding!

No comments: