I have one website on my server, and my IIS Worker Process is using 4GB RAM consistently. What should I be checking?
c:windowssystem32inetsrvw3wp.exe
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
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:
- ProcessPrivate Bytes
- .NET CLR Memory# Bytes in all Heaps
- ProcessWorking Set
- .NET CLR MemoryLarge 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
Method 2
check the section on troubleshooting memory bottlenecks in Tuning .NET Application Performance
Method 3
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.
Method 4
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.
Method 5
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.
Method 6
As other people noted common cause of this problem is resource leaking, also there is a known issue with win2k3 server and IIS6 KB916984
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0