Memory leak in aspnet_wp.exe

G

Guest

aspnet_wp process accumulates memory usage up to the point when it's more
than 60% of available RAM (2G) and none of .NET applications function.
Sometimes user is able to login, navigate between the pages but can't perform
any operations that generate thing like PDF files using Crystal Reports etc.
Sometimes the application can't even be loaded and sign-in page stays blank.
There are no events that are logged in the event viewer to point to this
problem. However we do find these errors occasionally:

"aspnet_wp.exe (PID: 3900) was recycled because it was suspected to be in a
deadlocked state. It did not send any responses for pending requests in the
last 180 seconds. This timeout may be adjusted using the <processModel
responseDeadlockInterval> setting in machine.config. "

and

"aspnet_wp.exe (PID: 3328) was recycled because it failed to respond to
ping message. "

and

"Failed to execute request because QueryInterface for ASP.NET runtime
failed. Error: 0x80004005 Unspecified error "

Can you tell me how we can trap or log this information so that we can find
what is causing the leak and solve it.
 
K

Karl Seguin

Raptor:
You have a long and difficult journey ahead of you.
Here are some resources that will be key in your battle:
http://blogs.msdn.com/akhune/archive/2004/06/11/153734.aspx
http://blogs.msdn.com/yunjin/archive/2004/01/27/63642.aspx

http://www.scitech.se/memprofiler/ (14 day free trial ought to be good
enough)
http://www.red-gate.com/code_profiling.htm (14 day free trial ought to be
good enough).


First you need to figure out if this is a managed or unmanaged leak. The
first rticle tells you how to figure it out (never mind using SOS stuff with
windbg and simply use perfmon and the above profile r(scitech is probably
better). Assuming it's a managed leak, it isn't actually a leak it's really
the simple fact that you are holding on to references to your objects,
you'll need to do some investigating. You can take snapshots with the above
tools to figure out what objects are taking the most space. You'll have
String and Int32 and Boolean at the top, but look for your own custom
objects, or larger objects such as DataSets, collections and arrays as these
are likely the root objects of the strings and ints which are really holding
on to memory.

Make sure you call Dispose() on things. Simplify your code so you have less
references to the same object all over the place (utility classes can often
help manage these references by providing single point of access).

Karl
 
S

Steve Caliendo

I've received those errors, too, and here's a few things that I've learned.

Do not use excessive arrays - they chomp memory until the session expires.
If you have 10 clients, and use Dim a(1000) somewhere in your code, that's a
ton of RAM if a() is an array of controls.

Do not overburden the wp by doing long computational things such as
interpolation of a surface. Pass them on to other processes such as dll's,
etc...

Make the session timeout as short as practical. That will free RAM more
quickly.

HTH,

Steve
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top