If you install Windows Server 2008 R2 with Hyper-V, the pagefile will be automatically managed, which usually has a 1:1 ratio with physical memory. However VM’s use their own pagefile and do not use the host paging mechanism. If you have lots of memory, chances are your pagefile will be way too big.
If we compare two servers with 16GB of memory each, one installed with Hyper-V R2 and the other installed with Windows Server 2012 Hyper-V we clearly see different numbers. Both servers have run for several days.
In the figure to the left you will see that Windows has 16GB allocated but recommends 24GB (1:1,5)
In the figure to the right you see that Windows Server 2012 is much more intelligent and allocates considerably less memory for paging. It is fairly consistent with the best practice in R2 to set a fixed maximum for the pagefile between 4 and 6GB.
Although I haven’t found any best practices yet for the pagefile in Windows Server 2012 Hyper-V, this might suggest that you can use the autopilot for virtual memory in the latest server edition of Windows. Of course we need a little bit more experience in the field to really call this a best practice.
If you are looking for a very thorough blog on pagefile settings in R2, please visit this blog.
Here is another one on technet:
And finally a post about the Hyper-V Dynamic Memory and Host Memory Setting in R2:
Host Memory Reserve
The Host Memory Reserve, which reserves memory for the processes in the parent partition can be found in the following registry key:
Registry Key: HKLMSOFTWAREMicrosoftWindows NTCurrentVersionVirtualization
Value Name: MemoryReserve
Value Type: REG_DWORD
According to this post, the Host Memory in R2 is calculated in MB as follows: 384MB + (Memory in GB * 64)
So a 16GB host in R2 will have a default Host Memory Reserve of 384MB + (16 * 64) = 1.408MB
In two 16GB Windows Server 2012 hosts I looked at, the default Memory Reserve was 2048MB. We have to conclude that the formula used for Hyper-V R2 does not apply to Windows Server 2012.
I also looked at a Windows Server 2012 Hyper-V host with only 4GB which had a currently allocated pagefile size of 704MB and a recommended pagefile size of 3.582MB. This small host did not have a Host MemoryReserve entry at all, probably because a default 2GB Memory Reserve would be disproportional to the physical memory.
I had an interesting discussion about MemoryReserve with Michel Luescher who works for Microsoft Consultancy Services at Microsoft Schweiz. Michel is writing the chapters in Windows Server 2012 Hyper-V Installation and Configuration which deal with this subject.
IMPORTANT NOTE: Do not manually configure the Host MemoryReserve entry and leave this to Windows Server 2012 which will auto-configure this value on an as needed basis
In fact any newly installed Windows Server 2012 server with the Hyper-V role does not have a Host MemoryReserve entry in the registry and we still need to figure out under what circumstances this entry is added to the registry.
Take a look at Michel’s blog (German) on the subject: