Memory combining in Windows 8 and Windows Server 2012

I’ve spent that last few weeks studying the memory architecture of Windows 8 and Windows Server 2012.

Windows and Windows Server has always had sharable memory where portions of DLLs and EXEs will have a single copy in physical memory (synonymous with RAM) and all of the applications that need them will simply reference the page already in physical memory. This is still counted in their working sets, but overall the operating system saves on physical memory usage.

image

One of the interesting features of Windows 8 and Windows Server 2012 is how process private page-able memory is periodically combined further saving on physical memory usage. This was mentioned in Bill Karagounis’s blog, Reducing runtime memory in Windows 8. The savings on physical memory usage could be dramatic, but possibly have some overhead from the system needing to search for duplicate pages of memory. I can only speculate at best right now.

An important distinction is that Windows 8 has memory [page] combining enabled by default, but Windows Server 2012 does not.

To check if your computer has page combining enabled or not, open an elevated Powershell session and type the following command:

Get-MMAgent

You should see output similar to this:

image

To enable page combining on Windows Server 2012, run the following command:

Enable-MMAgent –PageCombining

Get-MMAgent

You should see output similar to this:

image

I did not get a prompt to reboot, so I assume this is working now.

If you enable this feature, then please let me know what kind of impact it has on your solution. I am particularly interested in the value of the counter \Memory\Available MBytes before and after testing or real world load. Keep in mind that I suspect that the \Process(*)\Working Set sizes will remain the same simply because the physical page in RAM will be counted in the working sets normally, but physically have only one real page in RAM.