asp.net memory leak detection?

J

Joel Aufgang

I've got an asp.net app that seems to be hanging on to memory resources and
not releasing them. The w3wp process in windows 2000 grows out of control.
I've set iis to runn the app in an application pool which uses 2 worker
processes and recycles them when 600 megs of memory or 800 megs of virtual
memory are used. (there's a gig on the server) this has stopped the site
from completely hanging, but hasn't fixed the fundamental problem. the
event log shows that the processes are ususally being recycled every 45 to
60 minutes, depending on site traffic.

I suspect that somewhere in the code objects are somehow being persisted in
memory beyond the lifecycle of a single request and are not getting
disposed. I've searched the source code to see if any large objects are
being stored in the session collection, but couldn't find any.

Is there any way to determine what is taking up all this memory?

Thanks for any help,
Joel.
 
G

Guest

I'm not aware of any tools that'll tell where the memory leak might be in the .NET framework but here are a couple of things to check for

The following should be properly closed(Use try.. catch.. finally) after use in each class and method
1. All database connection
2. All datareader
3. All file readers(Streams
4. All Xml readers(Streams
5. All COM+ Interop objects are released

Suresh

----- Joel Aufgang wrote: ----

I've got an asp.net app that seems to be hanging on to memory resources an
not releasing them. The w3wp process in windows 2000 grows out of control
I've set iis to runn the app in an application pool which uses 2 worke
processes and recycles them when 600 megs of memory or 800 megs of virtua
memory are used. (there's a gig on the server) this has stopped the sit
from completely hanging, but hasn't fixed the fundamental problem. th
event log shows that the processes are ususally being recycled every 45 t
60 minutes, depending on site traffic

I suspect that somewhere in the code objects are somehow being persisted i
memory beyond the lifecycle of a single request and are not gettin
disposed. I've searched the source code to see if any large objects ar
being stored in the session collection, but couldn't find any

Is there any way to determine what is taking up all this memory

Thanks for any help
Joel
 
M

Michael Pearson

Do a search for CLRProfiler. It's a free tool that will help you track this
stuff down.
It's not easy to work with, but it will give you a better idea of what's
going on.

Michael
 

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

Similar Threads


Top