Processes with High Virtual Memory at Startup?

We’ve had some customers this week who have run into issues with multiple processes consuming large amounts of memory at startup.  One extreme case had every process using anywhere from 500MB to over 1GB per process!  Think about Notepad.exe taking up 500MB of memory after a restart … scary, isn’t it?  Obviously there are issues with having this type of situation in place – slow server performance, high pagefile usage and you could also experience blank desktop issues with trying to log in – to name just a few of the symptoms you might experience.  Although it’s not the most common troubleshooting scenario that we run into, it can result in major server stability problems.

The obvious question is, “How do I fix it?”  Check the following registry key: HKEY_LOCAL_MACHINESystemCurrentControlSetControlSession Manager.  If the HeapDecommitFreeBlockThreshold value exists, set the value to 0 for Non-Exchange servers and 0x00040000 (hexadecimal) for Exchange servers.  Once you make that change, you will need to reboot the server.

So what does the HeapDecommitFreeBlockThreshold value actually do?  It provides better control of memory handling as it is freed to mitigate virtual memory fragmentation.  Virtual memory fragmentation occurs where there is available virtual memory for a process, but they are not of a significant size.  Over time, due to the varying sizes and lifetimes of memory allocations, memory fragmentation may occur.  As you scale a server to handle more users and larger loads, you may see this.  The most common scenario for this issue is with clustered Exchange servers used to host a large number of users or messaging databases – look for Event ID 9582 in the Application Event Log.

Additional Resources

 – Aurthur Anderson