w3wp.exe RAM usage problem

Status
Not open for further replies.

ShuggyCoUk

Ars Legatus Legionis
10,387
Subscriptor++

this is your app pool, I suggest you invest in a memory profiler (or use a free one)

there have been bugs in the past that can cause it (e.g. this) but the first port of call should always be to assume you have a problem.

Simply looking at the managed/unmanaged sizes (procexp will do this, just be careful using it on a production environment) will tell you a lot. If the managed heap is most of this then you have some large object graphs/buffers since no single variable sized managed object (string/stringbuilder/array) can be more than 2GB in size even in 64bit CLR instances.
 

DaemonBlood

Ars Tribunus Militum
2,294
You're lucky enough to come accross my absolutely favourite problem in all of IT. A memory leak in .net code.

They're actually very easy to troubleshoot if you've seen a few of them in the past. ShuggyCoUk's suggestion is a great first step. If there's a lot of interop with unmanaged code it could be an unmanaged leak. If you're not explicitly interoping with unmanaged code, you may still have an unmanaged leak, but it my experience it's not as likely. You can also get some information from gen0/1/2, large object heap performance counters.

You can tell almost instantly what the problem is by getting a memory dump, and opening it up with windbg and SOS.dll, and using the command !dumpheap -stat, !dumpheap -mt, and !gcroot. To get a mem dump just right click on the process and create dump file in task manager.

If you need a solution to this problem right away I'd call microsoft. I'd bet the find the problem in less than an hour.

If you have a little more time try to reproduce this behavoir on a non-production machine. Can you see a pattern with memory usage? If you hit the site 100 times does memory increase with a predictable pattern? If so try to pick a unique number of request that will leak, say, 500 MB. I usally will do something like 1234 requests. I then use dumpheap -stat and look for objects with 1234 instanecs. Good chance those have leaked. Take one and do a !gcroot on it. This will show you how the object is rooted. Common things I have seen is rooting in a static context, and rooting unknowingly because of event hookups.

Tutorials on SOS and mem leaks here: http://blogs.msdn.com/b/tess/archive/20 ... -leak.aspx

tl;dr: if it's important call microsoft for paid support. If it's not important and you can reproduce it post a mem dump (less than 20 GB ideally), I'd be happy to help.

Microsoft US: 1-800-936-4900 (English)
 
Status
Not open for further replies.