Windows pagefile optimization

The memory in your PC is made up of more than just the RAM modules on the motherboard. The page file also plays an important role. This file on the hard disk ensures that the disk memory functions as optimally as possible. In this Expert course we will discuss the operation and settings of the page file and we will show you how to optimize this file for an even faster PC.

This article consists of three pages:

Page 1

- Paging

- Back and forth

- Size of the page file

- Set up

Page 2

- Dynamic page file

- Optimal size

Page 3

- Minimum or maximum?

- Optimal place

- Fragmentation

- Defragmentation


The page file is incorrectly referred to as the swap file. However, a paging file houses entire processes if RAM needs to be freed up for other applications. In Windows 3.1 this method was still used, but since the introduction of Windows 95 this is no longer necessary. Since then, only parts of a process (called "pages" or memory pages) have been moved to disk memory. This process is called 'paging', as opposed to 'swapping', which was the case with swap memory. A difference with swapping is that paging can happen preemptively – even when the operating system or an application is started.

This immediately explains why Windows will always use a page file if it is present: at startup all necessary parts of the operating system and the other programs are loaded in their entirety into RAM, but immediately afterwards memory pages of Windows and other programs will be loaded from the RAM again. move the RAM to the pagefile. The image on the previous page shows this situation: Commit shows here the total memory usage immediately after Windows 7 boot, while under Physical the amount of RAM used at that time is shown. The difference indicates that approximately 105 MB of the pagefile is in use.

Immediately after startup, approximately 105 MB of the pagefile is already in use.

Back and forth

It may seem strange to put data in the much slower pagefile at a time when there is still enough fast RAM available. But data that is not immediately needed would then unnecessarily take up space from data that is immediately needed. By placing memory pages in the pagefile in advance, Windows keeps the RAM used as small as possible. That way, there's a maximum amount of unused RAM left over to store things that are believed to be needed soon, and in that case, right away. This standby data in RAM is the system cache, and Windows always tries to make it as large as possible. This makes the really unused portion of RAM as small as possible or even nil.

The system cache is not a separate part of the RAM, by the way; data can belong to the cache or to the memory used, regardless of their location in RAM.

Based on the usage of the processes running on the PC, pages of memory are periodically moved from the cache to the pagefile to make way for new standby data, pages are retrieved from the pagefile and used by programs, then put back again to the pagefile or to belong to the cache, etcetera. All this to use the virtual memory as efficiently as possible, and to anticipate as well as possible what the user is going to do.

The virtual memory is not the same as the page file, which is apparently often thought. Virtual should be understood here as apparent. Virtual memory refers to the amount of memory that Windows (and programs) appear to be using. It consists of the used RAM and the used part of the pagefile. This may therefore be more than the actual amount of physical memory present. The total available virtual memory consists of the amount of RAM, supplemented by the amount of disk space allocated to the pagefile.

Total available virtual memory (Limit) and RAM (Physical). The difference (here 2 GB) is allocated to the pagefile.

Size of the page file

If you do not change the default settings, Windows determines the size of the pagefile itself. If you have 1 GB of RAM or less, about one and a half times that amount of disk space will be allocated to the pagefile. The maximum usable size of the page file is then approximately three times the amount of RAM. If the allocated size turns out to be insufficient, the page file can be expanded to that size, although in practice it will hardly happen that the spare space is used in its entirety, because most PCs will already run into other limits before that time. A pagefile with a different size is called a dynamic pagefile. This is in contrast to a fixed pagefile, where the initial size and maximum size are the same.

If you have more than 1 GB of RAM, Windows will allocate approximately the same amount of disk space to the pagefile. The recommended size is always one and a half times the amount of RAM.

The allocated and recommended amount of disk space for the pagefile at 2 GB RAM.

Set up

You can also set an initial and maximum size for the pagefile yourself. To do this, first open the System Properties window via Start / Run. type sysdm.cpl and click OK . Next, go to the Advanced tab, where under Performance, click the Settings button. On the Advanced tab, click the Change button and optionally uncheck Automatically manage paging file size for all drives , choose Custom size , then enter the desired information. Finally click on Set and twice on OK . When you reduce the pagefile, you will see the message that you have to restart the PC.

Manually setting the pagefile.

Recent Posts