12

Windows has a "system managed size" option for pagefile size, which seems to lack precise documentation.

What exactly does Windows do when you choose this?
Does it simply select default min and max sizes, or does it do something fancier?
Does windows shrink the pagefile and grow it later (with annoying dialogs)?

7 Answers 7

10

It does exactly what it says on the tin: the OS manages the size of the pagefile, which can shrink or grow dynamically. The lower and upper bounds are 1x your RAM size and 3x your RAM size or 4 GB (whichever is larger) as explained more elaborately here. The pro is that you don't have to worry about sizing your pagefile, the con is that your pagefile can become fragmented.

Where it is useful is in exactly the situation it's designed to avoid: sizing your pagefile. You can set it to System Managed and check in every several minutes (via a script), recording the smallest and largest sizes it uses over a typical usage period of a month or so. You should then have a very good idea how large to manually set your pagefile to be.

2
  • 2
    I like this plan, except Windows seems compelled to tell you when it's expanding swap, which spooks users. Any way to avoid or reduce the dialogs?
    – user9887
    Jun 18, 2009 at 15:09
  • This answer didn't cover everything I'd like to know, but I think it's the best answer I'm going to get.
    – user9887
    Jun 22, 2009 at 15:04
9

Near the end of this article, Mark Russinovich briefly discusses system-managed pagefile sizes:

You’ll notice that the default configuration is for Windows to automatically manage the page file size. When that option is set on Windows XP and Server 2003, Windows creates a single paging file that’s minimum size is 1.5 times RAM if RAM is less than 1GB, and RAM if it's greater than 1GB, and that has a maximum size that's three times RAM. On Windows Vista and Server 2008, the minimum is intended to be large enough to hold a kernel-memory crash dump and is RAM plus 300MB or 1GB, whichever is larger.

The rest of the article is well worth reading, and does talk a bit more about what happens when Windows grows the pagefile.

In my own experience, system-managed pagefile is the best option to take in the vast majority of cases.

1
  • finding out on dell workstation with 128GB of RAM, and only a 500GB hard drive {some workstations make use of older 320GB drives} then 3x128gb for an automatic pagefile is a problem my hard disk has pagefile.sys making drive > 90% full. I am observing that C:\pagefile.sys is often > 300GB on numerous high end workstations upgraded to 128gb RAM.
    – ron
    May 2, 2018 at 15:10
3

The general rule for system managed pagefile is: the operating system will create a page file that is one and a half times the amount of RAM that is installed in your computer.

However you rarely need the size of the pagefile be determined by system because nowadays computers RAM is more than adequate. A system managed page file with its shrinking and growing is subject to heavy fragmentation.

This KB article addresses the issue and explains how to calculate the page file size: How to determine the appropriate page file size for 64-bit versions of Windows Server 2003 or Windows XP.

Setting to a fixed size pagefile is worth considering. Additionally, it prevents this problem: The page file size may become alternately too small or too large when you start Windows Server 2008 or Windows Vista if there is no available free disk space, and the page file size is managed by the system

1
  • 1
    "nowadays computers RAM is more than adequate". I know this is an old answer, but especially on 32-bit XP stations, this is definitely not the case. RAM is cheap and on 64-bit systems plentiful, but programs are also using more memory than ever before. On older 32-bit systems, RAM is becoming very limited. Some old mobos can only support 2GB, for example, and such a computer is starving for memory these days. Jun 27, 2017 at 23:47
1

It handles sorting out the size of the pagefile. In the past I've set that when the available drive space is substantial. If you have the room why not let the system have as much as it needs?

1
  • great, how does it "handle" it? Does it just set min/max by some rule, or does it do something more dynamic?
    – user9887
    Jun 17, 2009 at 20:22
1

I ussually set the size of the pagefile manually at about twice the size of the RAM Memory so the system won't take too much I/O time with excessive growing and shrinking of this file.

4
  • When does the system shrink or grow the pagefile? Does "system managed" act different from manually chosen min/max?
    – user9887
    Jun 17, 2009 at 20:27
  • If windows needs some RAM at one given point (let's say you start a demanding application .. like a game) then it's gonna allocate the free RAM it's got, then the free space inside the pagefile on the disk as virtual memory. If the application needs more memory then it's going to start and grow the pagefile so it will have space to allocate. The problem is that growing and shrinking can be quite stressfull for the sysytem sometimes. Imagine you start a game and you start waiting cose the pagefile needs to be increased by 1 GB all of a sudden.
    – Paul
    Jun 18, 2009 at 7:27
  • 1
    This story tells when it would grow, but I'm more curious about the shrinking side. Naively, I would expect Windows to grow the file as needed, but avoid shrinking because of this kind of thrashing.
    – user9887
    Jun 18, 2009 at 14:59
  • And what a fine point you make. Indeed i assumed Microsoft respects the laws of the univers that there must allways be an equilibrium .. what goes up, must come down, what goes in must come out .. etc. I actually don't know if Windows shrinks it's pagefile and I'd be pretty upset if it didn't!
    – Paul
    Jun 18, 2009 at 16:58
1

Here is a video with David Solomon, one of the MS uber-engineers.

This video will answer your questions and also tell you more then you'd ever want to know about Windows memory management.

There is a section about sizing your pagefile:

http://www.microsoft.com/emea/spotlight/sessionh.aspx?videoid=64

1
  • Thanks for the link, but it seems like I cannot watch it without some kind of MS login?? Is there an alternate video source, or a written version somewhere?
    – user9887
    Jun 18, 2009 at 15:25
0

It works on a dynamic basis. It sets a typical upper level for the amount of RAM you have installed, which it extends as needed.

You must log in to answer this question.