Exchange Memory Allocation
Due to the nature of PC architecture some tweaking is required for efficient use of memory, especially when using more than 1GB RAM. I use this term loosely because until PCs move to 64-bit and other technologies that have been around for other hardware platforms, the memory architecture will be roundabout.
How much memory should I be using?
Exchange is a big memory hog. Allocation of memory depends on the number of users, the size of their mailboxes and the amount of mail that is stored every day.
An Exchange 2003 server serving 10 users or less can do with 512MB of RAM.
Exchange 2003 servers with standard edition installed should not require more than 1GB of RAM due to the 16GB Information Store limitation. However some servers with no gateway server filtering out viruses and spam, and users that use Exchange mail with large attachments on a regular basis might find that 1GB is not enough.
Large operations should definitely upgrade to Windows 2003 and Exchange 2003 to enjoy their improved memory usage and go with 4GB, for a server with a few databases.
Large Memory Issues
32-bit PC architecture allows Windows to address 4GB of virtual address space. Windows NT based operating systems allocate 2GB for the operating system and 2GB for applications such as Exchange. This is fine for desktops where a lot of graphic work is done by the operating system, but for client server applications such as Exchange, which gobbles up memory, 2GB of virtual memory (that is physical RAM plus page file disk based memory) might not be enough.
To solve this Microsoft provides the /3GB boot.ini switch which is available for Windows 2000 Advanced and Datacenter version and all Windows 2003 versions. It takes 1GB off the system allocated space so the User mode (application) virtual address space grows to 3GB.
After editing the boot.ini file it should look like this:
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003" /fastdetect /3GB
This means that a Windows 2000 Server with Exchange 2000/3 installed will not work well with more than 1GB physical memory and in some cases may cause some problems with 1GB if the server is really overloaded.
Following this logic, this sets the limit of the memory you can allocate for Exchange servers to no more than 3GB unless you do some more tweaking.
Windows 2003 provides the /USERVA=3030 switch that is used in conjunction with the /3GB switch to allocate 42MB of memory to the kernel for dynamically allocating memory back to the kernel mode in case of need. You should use this if you have a large amount of users. Typically, ISPs and large organizations will need to use this.
Windows 2000/3 Advanced Server and Datacenter Editions also provide the /PAE switch which provides a special API that allows programs to your memory above 4GB. However, Exchange does not support this API. You should consider using this switch if you have SQL 2000 or above installed on the same server as Exchange.
To work around memory issues you can use the following steps:
- Edit the "HeapDecommitFreeBlockThreshold" Registry key.
Microsoft provides a thorough and very technical explanation of this. (MS KB 315407).
- Use ADSIEdit tool (of the Windows support tools) to tweak the Exchange Jet Engine by following MS KB 266768)
Also, make sure you have the latest Exchange service pack and ESE fixes.
Troubleshooting memory problems
The main Exchange service that takes up memory is store.exe which deals with the core Exchange database services and MAPI access. The other service that might take up some memory space is inetinfo.exe.
You might also have an Antivirus/Anti-spam package taking up more memory. Having enough physical memory to contain all of these processes ensures a smooth running server.
However, looking at Windows Task Manager's processes list you might suddenly see your regular operating system protection antivirus with inflated memory usage. This could mean that your Antivirus package is scanning Exchange's mail queues or your Antivirus/Anti-Spam's directories. Check your exclusion lists to stop this from happening.
If you're still having problems you can use the following articles to collect information about virtual memory use:
The growing demand for memory use on Exchange servers due to expanding use of mail and the OS and services new features requires some understanding of the optimal configuration of operating system and application parameters to ensure a server runs smoothly and uninterruptedly.