ASP.NET - Detecting memory leaks

A

ASP.Confused

How would I go about detecting a memory leak? My web hosting provider has
our site set up to only have a root "bin" folder for .NET apps, and I would
like to be able to watch how much memory is being allocated for the entire
site (since the site acts as one big application.) Is there anyway to do
this through code?

The reason I ask is because occasionally, our site will start having session
state loss. After a day or two, it goes back to normal. My session
timeouts are 20 minutes, and I try to make sure that I properly
destroy/deallocate my variables (I also use GC.Collect heavily in my apps to
catch anything that I didn't notice.)
 
B

bruce barker

if you use 2003, you can setup a seperate pool for an application, and
monitor its memory usage. you can also download the win32 debugger and
instal the sos package. this will allow you to dump the gc.

you need to look for managed and unmanged leaks. managed leaks are generally
due to storing data in statics.

-- bruce (sqlwork.com)
 
M

Marina

I don't know about the memory leaks, but you are properly killing your
performance if you are calling GC.Collect all the time. Microsoft does not
recommend that you call this yourself - especially often.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top