Note (6apr2011): Setting the MsExchESEParamCacheSizeMax only doesn’t produce the required result as of Exchange 2010 SP1. For more information on how to limit the database cache size in Exchange 2010 SP1, see Limiting Exchange 2010 SP1 Database Cache.
I received a question from someone implementing Exchange 2010 who was surprised to see Exchange taking up all available memory. This is because in Exchange 2010 (2007 as well) memory allocation is dynamic, contrary to Exchange 2003 and earlier versions where, depending on the situation, you had to fiddle around with boot.ini switches like /3GB to make memory available to Exchange. Also, the maximum database cache size was limited in Exchange 2003 to around 1.2 GB due to virtual address space limitations (see MSKB 815372).
The main reason Exchange 2007/2010 claims memory for its database cache is performance. The more memory is assigned to the database cache, the less I/O’s are generated because things can be dealt with in-memory and the database cache becomes more effective. When a certain amount of transactions has been reached, changes will be physically written to databases (so far they’ve been stored in-memory and written to transaction logs). This limit is called the log checkpoint depth target.
Since Exchange 2003, the log checkpoint depth target is 20 MB databases. As of Exchange 2007, for configurations existing of 2+ database copies, the depth target is 100 MB for active copies and 5 MB for passive copies. This means, after 100 MB of transactions changes will be physically flushed to the database. The more changes are delayed (i.e. stored in-memory and in transaction logs), the chance of overlapping changes or combined writes increases lessening I/O’s required. Note that to lessen the time to fail-over, passive copies have a lower depth target making them commit changes more often, minimizing the log files to replay after a fail-over.
Back to the topic, Database Cache. Exchange uses by default certain mailbox database cache sizes for certain amounts of memory. The table below contains these values for systems holding the mailbox server role as well as servers holding multiple roles (source):
| RAM Physical Memory | Database Cache Size, Mailbox Role | Database Cache Size, Multiple Roles |
| 2 GB | 512 MB | Unsupported |
| 4 GB | 1 GB | Unsupported |
| 8 GB | 3.6 GB | 2 GB |
| 16 GB | 10.4 GB | 8 GB |
| 32 GB | 24.4 GB | 20 GB |
| 64 GB | 53.6 GB | 44 GB |
| 128 GB | 111.2 GB | 92 GB |
Now what if you have a real uncontrollable urge to limit Exchange in its attempt to optimize its database cache and you want to restrict its growth? You can do this by changing the following Active Directory property (per store) using ADSIEDIT.msc (or using another tool or scripting language of your liking) as follows:
- Start ADSIEDIT.msc
- Navigate to Configuration > Services > Microsoft Exchange > <Organization Name> > Administrative Groups > <Administrative Group> > Servers > <Server Name> > InformationStore
- Right-click InformationStore, and edit msExchESEParamCacheSizeMax. Set it it to the number of pages to maximize the Database Cache to. Note that Exchange 2007 works with 8 KB pages and Exchange 2010 with 32 KB pages!
- Restart the Microsoft Exchange Information Store service for the change to become effective.
So, for instance, if you want to limit the Database Cache to 4 GB of an Exchange 2010 server, set msExchESEparamCacheSizeMax to 131072 (4 GB = 4.194.304 KB / 32 KB). If you want to limit the Database Cache to 2 GB of an Exchange 2007 server, set msExchESEparamCacheSizeMax to 262144 (2 GB = 2.097.152 KB / 8 KB).
Note that lowering these values may degrade performance, in terms of server performance as well as in terms of end-user experience. However, smaller organizations with a limited number of mailbox users may benefit because they don’t let Exchange claim significant amounts of memory which it will never use.
![Exchange-2010-Logo-733341[1]](http://eightwone.files.wordpress.com/2009/11/exchange-2010-logo-7333411.png?w=150&h=71)
thanks !…will try it
Hello, we have tried it. On Exchange 2007 it worsk perfectly, but on 2010 it doesn’t. Do you have any ideas, how to diagnose it?
Thanks J. Kuzel
After editing, did you allow sufficient time for AD replication before restarting MSExchangeIS or the server?
What does the “MSExchange Database(Information Store)\Database Cache Size (MB)” counter max out on?
Yes, there was a lot of time. It is more than one week ago, and many restarts of MSExchangeIS has been done.
I have check cache size counter, and it is: 12772 MB
Limit is set to 8GB
Pingback: Exchange & Dynamic Memory : Don’t « EighTwOne (821)
Same problem here.
store.exe consumes 13 GB at the moment. I’ve limited the store.exe to 2 GB (2048*32=65536 for msExchESEparamCacheSizeMax), rebooted the complete machine, and after a week… still 13 GB for store.exe…
I found out what the issue is, see post here:
http://eightwone.com/2011/04/06/limiting-exchange-2010-sp1-database-cache/
The setting does not seem to work with 2010 SP1 installed. Needless to say this is terrible given that SBS2011 ships with SP1 loaded.
Pingback: Limiting Exchange 2010 SP1 Database Cache « EighTwOne (821)
Pingback: Limit the Amount of Memory that Exchange 2010 uses | Computer Repair, Networking, Servers, VMware, Virus Removal
Pingback: Exchange 2010 Store.exe using up RAM « Viral Rathod's Blog
Pingback: 2011, a short Retrospective « EighTwOne (821)
Pingback: Limit Memory Usage of store.exe – Microsoft Exchange | Windows Admin Notes
thank you for the important post, but i didn’t understand the following msExchESEparamCacheSizeMax to 131072 (4 GB = 4.194.304 KB / 32 KB) so let’s say if i wanna set the cache to 4GB shall i put 4194304 in the msExchESEparamCacheSizeMax.
Thanks again
Then number used is the number of pages; the cache size is determined by the page size used by the product. So, if you want 4 GB for Exchange 2010 (page size 32kb), you should use the value (4 GB = 4 * 1024 * 1024 = 4194304 KB and divide that by the page size = 4194304 / 32 = 131072. If you’d enter 4194304, you’ll set the page size to 4194304 * 32KB = 134217728 KB = (134217728 / 1024 / 1024) = 128 GB.
Hope this clarifies things.
so I made a mistake as i entered the 4194304 value i will correct it to 131072 which is enough for exchange 2010 sp2 20 users, right ?
cheers
Depends on user profile (i.e. usage pattern). 4 GB is more than enough; 1 GB should also do nicely (for 100 messages sent/rec daily with avg size of 75 KB, do calculation with around 6 MB database cache per user)
This grab all the memory behaviour causes issues with proactive monitoring tools as most will alert at a set memory threshold. We use 90% as a critical threshold but with Exchange 2010 you may as well not monitor it.