pagefile.sys How exactly does windows determine what drive to use with automatic management?

I have a 2016 Windows Server that has two drives, C: (system drive) H: storage drive. When I go into the Virtual Memory settings, H: is managed and C: is not.

Note: "Automatically manage paging file size for all drives" is checked.

I would like to understand how exactly does windows determine what drive to automatically manage when there are multiple drives?

Reason: I deploy multiple servers from a VM template weekly and this is the first time Windows has selected a drive other than C: to be "Automatically" managed. I would like these servers to be consistent. Or, at least have a good understanding of what caused this.

I will happily provide more information or clarity if needed.


I am not aware of a detailed description of the underlying algorithms, so I am afraid that nobody can tell you exactly what happens behind the scenes.

However, I found this article to be a good starting point. Despite its title, there are a few hints about the location and size of an automatically managed pagefile.sys as well. From reading it, I got the impression that an automatically managed pagefile.sys is on drive c:, unless drive c: runs out of space or is much slower than other drives.

Furthermore, the article states that there are many factors involved in determining the location and size of that file, and gives some hints about how to determine them (performance counters etc.). I strongly assume that the automatic management adheres to the same principles.

To find the reason for the difference between your VMs, you would have to compare disk sizes (more precisely, disk free space) and disk performance, preferably using the hardware counters mentioned in the article. And of course, the amount of RAM has great influence on the size of pagefile.sys, as the article explains, so the difference might be due to different RAM size as well.