I have one website on my server, and my IIS Worker Process is using 4GB RAM consistently. What should I be checking?
c:\windows\system32\inetsrv\w3wp.exe
I have one website on my server, and my IIS Worker Process is using 4GB RAM consistently. What should I be checking?
c:\windows\system32\inetsrv\w3wp.exe
I would check the CLR Tuning Section in the document Gulzar mentioned.
As the other posters pointed out, any object that implements IDispose
should have Dispose()
called on it when it's finished with, preferably using the using
construct.
Fire up perfmon.exe
and add these counters:
- Process\Private Bytes
- .NET CLR Memory# Bytes in all Heaps
- Process\Working Set
- .NET CLR Memory\Large Object Heap size
An increase in Private Bytes while the number of Bytes in all Heaps counter remains the same indicates unmanaged memory consumption.
An increase in both counters indicates managed memory consumption
check the section on troubleshooting memory bottlenecks in Tuning .NET Application Performance
If you have access to the source code, you may want to check that any objects that implement IDisposable are being referenced inside using
statements or being properly disposed of when you are done with them.
Using
is a C# construct, but the basic idea is that you are freeing up resources when you are done.
Another thing to check on is large objects getting put in the "in process" session state or cache.
More details would definitely help. How many applications are running inside the application pool? Are there ASP.NET applications in the pool?
If you're running ASP.NET, take a good look at what you're storing in the session and cache variables. Use PerfMon to check how many Generation 0, 1 and 2 collections are occurring. Be wary of storing UI elements in the session state or cache since this will prevent the entire page instance and all of the page instance's children from being collected as well. Finally, check to see if you're doing lots of string concatenation. This can cause lots of object instantiations since .NET strings are immutable. Look into using StringBuilder instead.
Create a mini-dump of the w3wp process and use WinDbg to see what objects are in memory. This is what the IIS support team at Microsoft does whenever they get questions like this.
As other people noted common cause of this problem is resource leaking, also there is a known issue with win2k3 server and IIS6 KB916984