RandomWebGuy
RandomWebGuy

Reputation: 1439

w3wp.exe consuming large amount of RAM

I noticed the other day that it seems like all the w3wp.exe running on my server are consuming way more RAM than I would expect. So I created test web application with a single aspx page and then a vanilla global.asax page as well (default methods, no additional code). I then deployed that site to IIS6 with a target framework of 4.0 built in release mode with debug set to "false". The site is also set up under it's own application pool. I then used issapp.vbs to figure out which w3wp.exe this test site was running under. I was surprised to see that the single site with 1 page was using almost 40mb of ram.

40mb of RAM seems like a lot for a single page website. Is this normal and if so why? Is there anything I can do to reduce the memory footprint?

I also noticed that each time the default page was refreshed that the w3wp.exe grew a little bit more. Is IIS6 caching the same page over and over?

Upvotes: 2

Views: 1437

Answers (3)

Rahul Soni
Rahul Soni

Reputation: 4968

This is not really an issue, since it is quite normal. Your .NET Framework is getting loaded and hence the size. When a real issue happens, you would have to use certain post production or profiling tools to get it fixed. Sharing some articles for memory and post production debugging just in case you need it in future.

http://msdn.microsoft.com/en-us/magazine/cc188781.aspx http://aspalliance.com/1350_Post_Production_Debugging_for_ASPNET_Applications__Part_1.all http://blogs.msdn.com/b/tess/archive/2006/09/06/net-memory-usage-a-restaurant-analogy.aspx http://blogs.msdn.com/b/tess/archive/2008/09/12/asp-net-memory-issues-high-memory-usage-with-ajaxpro.aspx

Upvotes: 0

Alex Norcliffe
Alex Norcliffe

Reputation: 2489

40Mb for a single AppDomain (irrespective of how many pages you have) is alright. Consider that .NET is a managed environment and the app pool contains a large majority of the logic and heap for serving requests. In many cases it also will be less eager to free up RAM, if the RAM is not under contention (demanded by other parts of the system). You can share app pools amongst different websites, and the "overhead" of the sandbox becomes less proportionate to your perception of what is acceptable. However, I don't think this is bad at all.

Upvotes: 1

David Schwartz
David Schwartz

Reputation: 182761

You're trying to optimize the case where you have no load and no clients. That really isn't sensible. Optimize for a realistic use case.

You don't build a factory and then try to get it to make one item as efficiently as possible. You try to get it to crank them out efficiently by the dozens.

Upvotes: 0

Related Questions