3

I think I understand the purpose of the page file; if the computer runs out of physical memory, the page file is needed to have additional (virtual) memory - very simply said.

Since Windows 2000 I know that the maximum page file size should be set to 1.5 times the RAM. This is also what Windows shows/recommends on the window, where the page file size can be configured. So, on a computer with 256 MB RAM, I set the maximum page file size to 384 MB and on a computer with 1024 MB RAM to 1536 MB.

But today, when computers have 16 GB, 32 GB or even more RAM, why should the maximum page file size still be set to 1.5 times the RAM? I ask because regardless of whether a new computer has 16 or 32 GB RAM, the same applications will usually be installed. So why do I have to set the page file to 48 GB when I have 32 GB RAM, which results in a total available memory of 80 GB, and why (according to the recommendations) do I only have to set the page file to 24 GB when I only have 16 GB RAM, which results in a total available memory of 40 GB? The applications will run on both computers, but on the computer with 32 GB RAM you "waste" twice as much hard disk space as on the one with only 16 GB RAM.

I know there are countless discussions on the internet about this topic, but I haven't found a clue why the size of the page file has to grow with the size of the RAM.
Is maybe the only reason that in case of a computer crash (blue screen) the entire content of the RAM can be stored in the page file?

PS: The origin of my question is that I bought another 24 GB RAM for my computer, which had 8 GB RAM until now, and I'm now wondering if I really should/have to increase the size of my page file from 12 GB to 36 GB, what's currently shown/recommended on the window, where the page file size can be configured. Unless absolutely necessary, I don't want to "waste" another 24 GB on my hard disk.

0

1 Answer 1

3

The key to understanding this is to have a proper understanding of how the pagefile is used. Unfortunately that kind of understanding isn't very common.

The popular idea of of the pagefile is of a section of the hard disk that Windows starts to use when RAM runs out. There are many Internet articles that state this and it is also implied by Microsoft user level documentation. The idea isn't entirely wrong but it isn't a very accurate description either.

Operating system designers assumed you will have RAM size appropriate for your workload and that varies widely. A small workload might be light web browsing and email. For that 4 GB RAM is quite adequate. But then there are professional workstations doing computer generated graphics where 1 TB of RAM might be too little. You have the amount of RAM that is appropriate for the workload.

The pagefile is designed to make the use of RAM more efficient, whether usage is low or heavy. It isn't just used when RAM runs out. When teh system has been running for awhile RAM will be holding considerable data that hasn't been used recent;y and some of this data may in fact never be used during the session. It is a serious waste of high performance RAM to be used storing static data. Particularly when that RAM could be used for more important purposes such as caching frequently accessed file data. The data can't be discarded because it may be of critical importance later.

The pagefile is the solution to this problem. The system memory manager knows which memory blocks have been accessed recently and those that have not. The CPU has a big part in this. Data that hasn't been accessed recently probably won't be needed anytime soon. If all that old data is offloaded to the pagefile there will be more RAM available for frequently accessed data. If it turns out that a block containing that old data is needed it will be brought back into RAM. It is then recently accessed and no longer qualifies as old data. Thsi allows you to run a larger workload than would otherwise be possible and at a much lower cost than adding more RAM and with almost the same performance level.

This concept has been used in large computer systems since the 1960's. In only came into small systems in the 1990's when they had sufficient resources to support it.

If you have a large workload, along with the larger RAM size needed to support it, you will have more old and stale data. Thus you need a larger pagefile to offload it to. Thus with more RAM you need a larger pagefile to use it to maximum efficiency. Of course if you have large RAM and a light workload you don't need such efficiency.

Not the answer you're looking for? Browse other questions tagged .