Optimizing Memory Usage in Exchange Server 2003

 

If you have 1 gigabyte (GB) or more of physical memory (RAM) installed on a server that is running Microsoft Exchange Server 2003, you must make sure that Exchange 2003 can make efficient use of that memory. Independent of the hardware configuration, the number of databases, and the number of users on the server, the Exchange Information Store (Store.exe) process in Exchange Server 2003 has a finite amount of memory that it can address. This amount is known as the virtual address space. In most scenarios, the usage of this virtual address space for the information store dictates the overall performance and scalability of your Exchange Server 2003 mailbox servers. For small to medium-sized servers, Exchange Server 2003 automatically makes the best balance. However, for larger servers you may want to manually adjust some or all of the tuning parameters detailed below.

Monitoring Memory Usage

You can use Event Viewer and Performance Logs and Alerts to monitor for virtual memory problems on an Exchange Server. In the application log, an Event ID 9582 warning appears when the largest free block of virtual memory decreases to 32 MB. If you see this warning, you should restart the Exchange store process at the next opportunity. If the largest block decreases to 16 MB, an Event ID 9582 error appears again; this error means the server might fail, and you should restart the server at the earliest opportunity. Failure to act on these events can cause sporadic mail delivery and IMAIL conversion failures (Event ID 12800).

For detailed instructions, see How to Monitor Memory Usage on an Exchange Server

If a server shows signs of low virtual address space, you should adjust the following settings. If these settings are not optimized for Exchange, Event 9665 appears in the application event log.

Event 9665

Exchange performs an optimal memory configuration check when the store process starts. If the memory settings are not optimal, you receive an event 9665 in the Event Viewer. This message appears in the following instances:

  • The server is running Windows 2000 Server and the value in the registry is set outside the range of 24,000 to 31,000.

  • The server has 1 GB of memory or more and does not have the /3GB switch.

  • The server is running Windows Server 2003, has 1 GB of memory or more and the /3GB switch is set, but the /USERVA switch is not present or is not set to 3030.

If you are confident that your server is optimally configured and you want to prevent Event 9665 from being logged, you suppress the logging of Event 9665. For detailed instructions, see How to Suppress Memory Configuration Notification Event.

Setting the /3GB Switch

By default, Windows 2000 Advanced Server and Windows Server 2003 allocate 2 GB of virtual address space to user mode processes such as Store.exe. If a server has 1 GB or more of physical memory, set the /3GB switch in the Boot.ini file to increase virtual address space.

For detailed instructions about how to set the /3GB switch, see How to Set the /3GB Startup Switch in Windows.

Setting the /USERVA Switch and SystemPages Registry Value

If the server is running Windows 2000, you should set the SystemPages registry value between 24,000 and 31,000. If the server is running Windows Server 2003, set the SystemPages value to zero, and set the /USERVA=3030 startup switch in the Boot.ini file. These settings let you enter more system page table entries on the server, which is critical for systems that scale-up.

The /USERVA switch is new to Windows Server 2003. Its purpose is to provide a finer level of control over the division of virtual address space between user-mode processes and kernel-mode processes. This switch should be used only for applications that support it, such as Exchange Server 2003, and with the specific values supported by those applications. When used on Exchange Server 2003 systems, /USERVA should always equal 3030 (e.g., /USERVA=3030). This value causes an additional 40 MB to be allocated to the operating system, and enables you to add more users without consuming all available system resources.

For detailed instructions about how to configure the SystemPages registry value in Windows 2000, see How to Increase System Page Table Entries in Windows 2000.

For detailed instructions about how to configure the /USERVA startup switch, see How to Set the /USERVA Startup Switch in Windows.

Setting the HeapDeCommitFreeBlockThreshold Registry Value

The HeapDeCommitFreeBlockThreshold registry value controls the free space required before the heap manager decommits (or frees up) memory. The default is zero, which means that the heap manager decommits each 4-KB page that becomes available. Over time, virtual address space can become fragmented. On servers that have 1 GB or more of physical memory, you should set the registry key to a higher value to reduce fragmentation.

For detailed instructions about how to set the HeapDeCommitFreeBlockThreshold registry value, see How to Set the HeapDeCommitFreeBlockThreshold Registry Value.