How to solve memory leak in IIS w3p.exe

How to solve memory leak in IIS w3p.exe

I found some couple of solutions in Google and compiled them here if anyone has problems with memory leak in IIS w3wp.exe 🙂

Reasons for Memory Leak:

Could be a million things: database connections not being closed, ADO objects not being properly destroyed…unless there’s only a few sites on the server you’re going to have a lot of trouble tracking down which one is the culprit.

Method 1:

Attach a debugger onto that w3wp.exe when it is at 100%, determine what code is currently executing and chewing up CPU cycles, and fix that code to not chew up CPU.

DebugDiag or IISState can help with this.

Debug Diagnostics 1.0 in IIS Diagnostics Toolkit (x86)

———————————————————–

http://www.microsoft.com/downloads/details.aspx?FamilyID=9bfa49bc-376b-4a54-95aa-73c9156706e7&DisplayLang=en

http://www.microsoft.com/downloads/details.aspx?FamilyID=9bfa49bc-376b-4a54-95aa-73c9156706e7&DisplayLang=en

IISState url

——————–

http://www.iisfaq.com/default.aspx?view=P197

http://www.iisfaq.com/default.aspx?view=P197How to read memory dump files by IISState

——————————————

http://www.codeproject.com/debug/moomoo.asp

http://www.codeproject.com/debug/moomoo.asphttp://blogs.msdn.com/joncole/archive/2007/03/29/creating-a-process-memory-dump.aspx

http://blogs.msdn.com/joncole/archive/2007/03/29/creating-a-process-memory-dump.aspx

download the debug symbols & debugging tools.

http://www.microsoft.com/whdc/devtools/debugging/default.mspx

http://www.microsoft.com/whdc/devtools/debugging/default.mspx

Method 2 (more faster way):

———–

Use

http://iismonitor.motobit.com/

http://iismonitor.motobit.com/Or

http://www.troxo.com/products/iisguard/ to monitor IIS requesthttp://www.troxo.com/products/adomonitor/ to monitor bad database connectionsWith the first two you can monitor what is running, and if this problem is happening quickly, ie causing you problems quickly then you will at least be able to get a snapshot of what was run in that period and at least have narrowed it down to a few sites/files which should make it a little easier to track down?

http://www.troxo.com/products/iisguard/ to monitor IIS requesthttp://www.troxo.com/products/adomonitor/ to monitor bad database connectionsWith the first two you can monitor what is running, and if this problem is happening quickly, ie causing you problems quickly then you will at least be able to get a snapshot of what was run in that period and at least have narrowed it down to a few sites/files which should make it a little easier to track down?

http://www.troxo.com/products/adomonitor/ to monitor bad database connectionsWith the first two you can monitor what is running, and if this problem is happening quickly, ie causing you problems quickly then you will at least be able to get a snapshot of what was run in that period and at least have narrowed it down to a few sites/files which should make it a little easier to track down?

taken from: “http://community.sgdotnet.org/blogs/darenhan/archive/2007/10/29/How-to-solve-memory-leak-in-IIS-w3p.exe.aspx”