Detecting Memory Leak in ASP .Net

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
guru
Posts: 3
Joined: Tue Jun 10, 2008 10:26 am

Detecting Memory Leak in ASP .Net

Post by guru » Tue Jun 10, 2008 10:35 am

I'm currently evaluating .Net Memory Profiler 3.1. I have an ASP .NET application and I want to know if there is memory leaking. So far the tutorial is very instructive, however, I believe it only applies to stateful applications such as Windows Development.
However, in a stateless application such as ASP .Net, should I interpret the results differently? Should I approach the detection differently as well?

Currently this is what I'm doing, I want to make sure if it is correct:
a. Start the profiler on my ASP .Net application.
b. Wait until the page completely loads and then get a snapshot.
c. Since it is a stateless application all the object instances should be disposed as soon as the page load, so I need to just look at the live instances column in the instance page and all the objects in those columns can be considered as a leaking memory, right?

Andreas Suurkuusk
Posts: 1029
Joined: Wed Mar 02, 2005 7:53 pm

Post by Andreas Suurkuusk » Tue Jun 10, 2008 8:58 pm

The page rendering in ASP.NET is stateless and after requesting a page there should be no new instances related to the page rendering. But, you will still have other instances in an ASP.NET application. The ASP.NET Framework will create and keep instances alive, and even if the page rendering is stateless, an ASP.NET application at least needs to keep track of session state. I recently wrote a reply to another ASP.NET question, which might provide you with some additional information. The post can be found at:

http://memprofiler.com/forum/viewtopic.php?t=1230

To minimize the impact of session state and caching, try to lower the timeouts for the cache and session, and wait for the timeout to elapse before collecting the next snapshot.
Best regards,

Andreas Suurkuusk
SciTech Software AB

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests