Q. I understand that when using Windows Server 2008 R2 SP1's dynamic memory with SQL Server and Java workloads, you should set the memory buffer to 5 percent instead of the default 20 percent. Why?

A. With dynamic memory, the Virtual Machine Management Service Memory Balancer component is responsible for all the memory decisions related to the allocation and removal of memory from dynamic memory enabled virtual machines (VMs). To protect VMs from running out of memory before more can be added, a buffer is configured, which is 20 percent by default. This ensures VMs have 20 percent available memory (meaning free and memory used for cache). If this available memory drops below 20 percent, more memory is added (if available).

Twenty percent works well because the Dynamic Memory Virtual Service Consumer (VSC) in the guest OS looks at how the memory is being used and 20 percent is a reasonable amount to be used by the OS for caching purposes. Twenty percent doesn't work well for loads such as SQL Server and Java because both of these workloads have their own caching mechanisms within their code that can't be identified by the Dynamic Memory VSC. So even though the memory is being used for SQL Server or Java caching, to the Dynamic Memory VSC it looks like the process is using the memory. It interprets this as a low available memory because SQL Server of Java are just claiming any available memory for its own cache.

This shortage causes the Dynamic Memory VSC to report its available memory is less than the desired buffer, so more memory is added. This memory is then consumed again by the SQL Server or Java buffer, and so on. This is why trying to keep 20 percent of available memory for these workloads won't work.

Setting a target buffer of 5 percent avoids this repeated memory add and grab because these services allow the OS to keep this amount of memory available for itself.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.