I have an IIS 6 server running on Windows 2003 SP2 x86. The server has 4GB of RAM and runs consistently with 2GB allocated.
I realise that with x86, the server won't utilize all of the 4GB RAM and the application space is also limited but the IIS processes seem to be limited elsewhere. w3wp.exe never has more than 500MB allocated and I occasionally get OutOfMemory exceptions from a busy .NET application (there are several applications running, each with a separate application pool).
What is the maximum memory that an IIS6 web site/app pool can use?
Apps under Windows x86 are limited to 2gb/ea. You can change this by adding the /3gb flag to boot.ini, but this can cause unexpected application behavior and should be used with caution. MS officially does not support this (http://technet.microsoft.com/en-us/library/bb124810.aspx)
IIS's memory limits can be set under the Recycling tab in the relevant app pool.
How are you determining that the application is never going over 500MB? If you're using Task Manager, keep in mind that it is rarely (if ever) an accurate representation of memory usage as Windows understands it. Use Process Explorer: http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
There are a number of other relevant questions:
Most likely, IIS, ASP.NET, and all their associated baggage are running up against the 2GB limit even though Windows Task Manager doesn't show it. Setting Recycling limits or upgrading to x64 will probably make a huge difference.
The answer to this is too complex to fit in an answer. See "Tuning .NET Application Performance" for a complete treatment of the subject.
Here's a vastly oversimplified (but still quite good) summary from Bruno Jouhier:
Edit:
Here's my attempt at an explanation...
If you're wondering what the maximum worker process memory size (as reported by Task Manager) is for an ASP.NET Worker Process on x86, the answer is "it depends".
In any kind of managed code such as Java or .NET, the programmer gives up fine-grained control of memory as a penance for not having to deal with pointers. As a program executes, the Heap and Stack will be periodically cleaned up by the Garbage Collector.
Specifically in regards to ASP.NET, the garbage collector runs inside the same worker process as the website. The GC consumes memory of its own. How much memory is entirely a function of how your application's code is written. One app may be able to use 1.8GB of memory while another may choke at 500MB. In order understand why, you need to profile your specific application.
Any process on a x86 Windows OS is limited to 2gb unless you have set the /3gb switch in your boot.ini file, in which case a process can use 3gb.
From this blog post "Recommendations for SharePoint Application Pool Settings":
From my experience 800 MB is the treshold for 32bit machines (2-4 GB RAM). It recycles app pools before throwing "out of memory" exceptions.
Make sure you aren't setting the virtual memory size on your app pool. If you set this value to a number outside of the allowable range, it will revert to 512MB. See KB923197.
Also note that if you are running an ASP.Net application, ASP.Net will recycle the pool at 60% of the 2GB memory limit, or 1.2 GB. This isn't your ~500 scenario, but on 32 bit apppools with large memory usage, we sometimes tweek this to get a little more memory.
On Windows 2003 you can set Physical Allocation Extension (PAE) to make use of all the memory. The default memory for an IIS6 apppool is 5MB.