Setting up virtual memory. Swap file. Correct setting of the paging file and its optimal size Virtual memory how much to set

Today, it is probably difficult to find a user of modern computer systems running Windows (and Win7 in particular) who would not in one way or another encounter the concept of a page file (it is designated as Pagefile.sys and is a system one). Let's take a look at what it actually is and determine the best size for optimizing system performance. What is the optimal size of Windows 7 that is recommended to be installed will now be clarified.

What is a page file?

First, a little theory. Actually, the paging file itself, present in any Windows operating system, is like an additional means of increasing the size of the computer’s RAM when its own volume is not enough to perform some “heavy” tasks in terms of system resources or process a large amount of data (for example, floating point calculations, which mostly concerns modern games and multimedia applications).

In fact, this file contains all the “junk” that needs to be processed if there is not enough RAM. In other words, the object itself is responsible for reserving space on the hard drive for performing certain operations. In other words, when the RAM is overloaded, the data is dumped onto the hard drive, where processing takes place.

But here it is important to understand one main aspect: the fact is that the system accesses RAM much faster than a hard drive, even if it has an arbitrarily fast spindle speed (which, by the way, determines the speed of data reading). Unfortunately, Windows 7 determines the optimal size of the paging file on its own. And this is not always good.

The fact is that the developers of the system itself tried to set the size of the reserved space, so to speak, in a kind of universal version for all possible configurations. But if you take into account the features of the installed equipment (often even non-standard), many problems can arise. The Windows 7 paging file itself, the optimal size of which is set by the operating system itself, may not cope with the tasks assigned to it. But more on that later.

Access to paging file resizing features and optimization methods

Setting up and changing the size of the file itself is done in the standard “Control Panel”. There, the settings and security section is initially selected, then the “System” menu. On the left side of the window there is a hyperlink to additional options. By clicking on it, you can access the main settings window. Here you use the “Advanced” tab and go to change settings by clicking the “Options” button.

Here, again, there is an “Advanced” tab, in the menu of which there is a line “Virtual memory” and a “Change” button. Click it and go to settings.

You can immediately see that the default size is set to a certain size, since the automatic selection line is enabled. Now we uncheck it and try to change the set size at our discretion. This is where the tricky stuff starts.

The fact is that some users have a strongly held belief that a larger dimension setting will result in faster data processing. Absolute nonsense! If the specified size is too large, the system will simply begin to ignore the RAM and increasingly turn to the reserved area of ​​​​the hard drive. And this, as already mentioned, happens at a speed slower than when accessing the RAM. But the system itself, when using RAM, is capable of reserving about 30% of resources so as not to access the paging file.

Why do you need to change paging file parameters and settings?

Now let's look at the optimal size of the Windows 7 x64 paging file for gaming or for performing some resource-intensive operations. In principle, in this case (32 or 64 bit architecture) generally does not matter. If anyone has not yet understood, it all depends only on the number of installed RAM strips, that is, its volume.

In general, many experts do not recommend setting the size too large, but in most cases it is not worth disabling the page file (unless you have more than 8 GB of RAM). The best solution would be to manually set the size to half the existing standard value. Microsoft experts do not advise doing such things, believing that this will damage the entire system as a whole. As practice shows, nothing like this is observed. You can completely disable the use of the backup area of ​​the hard drive, and this will not in any way affect the functionality or performance of the system. By the way, a game launched from a hard drive (and not from optical media) will not produce errors, and processing of the same 3D graphics will be much faster.

Windows 7: Optimal paging file size (generally accepted standards)

Now let's look at the generally accepted parameters proposed for the size of the paging file in the "seven". To do this, just look at the following table.

As can be seen from the above data, the more RAM sticks are installed, the smaller the disk space reserve is. However, if we talk about some specific tasks or modern games, these parameters can be changed (it all depends on the requirements of the application itself, as well as on the existing configuration).

Standards are standards, but the question naturally arises: should we adhere to generally accepted rules?

You should immediately pay attention to user reviews. For example, many argue that the optimal size of the Windows 7 x32 paging file (4 GB of RAM) can be set below the default value, or even disable the use of the reserve altogether. But that's not all. Even if you have only 1-2 GB of RAM (if you work, say, only with office documents), you should not use the swap file at all. Enabling it will only bring harm, since, as is already clear, the system will access the hard drive more often than the RAM, which, in turn, can cause quite strong “braking”.

Windows 7 (x64) Optimal Page File Size: Real-World Usage

In principle, if you look at it, such applications work quite effectively, allowing you to properly change the settings and set the optimal page file size for the same Windows 7 system, however, provided that it is run as an administrator.

What's the result?

In conclusion, it remains to add that the above actions should be taken only at your own peril and risk. Although in Windows 7 the optimal size of the paging file, by and large, does not play a special role (most often, modern computer systems have a fairly powerful configuration), nevertheless, changing its size, say, in the direction of increasing it is not recommended. The easiest way is to just turn it off, nothing bad will happen, believe me.

In Windows 7, 8, XP and 10 systems, there is a system, hidden file pagefile.sys called the page file. It is used as virtual RAM ( RAM) supplementing the physical when it is not enough. Users are wondering how to set it up correctly and what is its optimal size? This will be discussed in this article.

It also stores unused data from programs and applications ( for example, when they are collapsed and unused). Since the file is located on the hard drive, all access to it is directly related to the disk, which is much slower than RAM. Therefore, the system only uses it in extreme cases ( that is, when there is not enough physical RAM).

There are no universal instructions for correctly setting the size of this file, since everyone’s computer resources are used differently, and the PC characteristics are also different. Therefore, you need to focus on your needs.

If you disable the page file, then if there is insufficient RAM, a corresponding error will appear and the applications you are using will unexpectedly quit. To avoid this, you need to set the optimal size of the paging file. I'll show you how to do this using Windows 7 as an example. These instructions will be relevant for other versions and bit depths ( x32 and x64).

Criteria for optimal paging file size

By default, Windows automatically determines its size using its formula. This is not always effective. In some cases, changing the page file can greatly improve performance.

It is necessary to determine what maximum RAM you consume when working on a PC. Then you need to compare this data with the physical amount of RAM and, if it is insufficient, add the size of the paging file. I'll show you with an example how this can be done.

Launch all possible programs, applications, games and everything that theoretically you would use at the same time. Then launch Task Manager ( ctrl+alt+delete), and see the amount of memory used. This is the amount of RAM that must be provided to the computer.

Based on these data, you can set the optimal size. In the image above, the memory consumption is 1.60 gigabytes. At a maximum of 2. This means that the paging file is not used in this case and can be disabled. But this is just an example!

Disabling the page file is not recommended at all, but you can do this only if you are absolutely sure that you cannot use more memory than the amount of physical memory and if memory dumps are unnecessary. It should also be taken into account that some applications require this file and will not work without it.

If the value was greater than the maximum ( that is, more than 2), then it would be necessary to set the size equal to the amount of memory consumed + reserve ( 50% ). Approximately these numbers will be safe. In most cases, it is not possible to accurately determine this maximum and therefore approximate rules are used to insure against RAM shortage errors.

The less physical RAM, the more virtual memory. Below is a table that shows the values ​​if the computer did not use more than 4 gigabytes of RAM.

It all depends on the needs of the user. For some, 16 gigabytes may not be enough, but for others, even 1 gigabyte will be enough and no errors will occur.

Please note that the maximum and minimum sizes are set to the same. This is done in order to get rid of fragmentation. This is only relevant if you have a HDD.

You can also conduct an experiment using the random method. Reduce the size of the paging file until an error about lack of memory appears and stops at the size when there was none.

After reading various forums, I came to the conclusion that with 8 gigabytes of RAM, most users never had problems with the page file, and if they did, they simply turned it on at the minimum size. In other cases ( when there is less memory) there were frequent mistakes. Draw your own conclusions.

Increasing and disabling the Windows 7 page file

For novice users I will show you how to change it. For the changes to take effect, you must restart your computer.

Go to Start menu >> Control Panel ( large icons) >> Performance counters and tools.


Go to visual effects settings.


In the “Advanced” tab, you can go to the paging file settings window. Its size or complete disabling is indicated here.


I am ready to answer questions in the comments.

How did you decide to use the page file?

Poll Options are limited because JavaScript is disabled in your browser.

By querying “windows swap file” in any search engine, you can get a thousand or two copied from each other, or slightly different answers on choosing the optimal size for pagefile.sys.

The most common advice looks something like this: for machines with small RAM, you need to set the paging file size k*RAM, where RAM is the amount of physical memory, k is some coefficient, of which there are many different ones. I met 1.5, and 2, and even 3. If the memory stick is 4GB or more, then “feel free to disable virtual memory in principle.”

The article is about whether you should believe this advice, and if so, then how much.

What is a page file?

pagefile.sys, also known as the paging file, is a file that is virtual memory, which allows a large number of processes to run simultaneously, all of which could not fit in physical memory at once.
By default, after installing Windows, the page file grows automatically when the current volume is full.

If you disable the page file

If you try to disable the paging file in Windows 7, the system will display a warning window in which it will report unpleasant consequences:

It follows that you should not completely abandon the use of virtual memory, otherwise in the event of a crash you will not even be able to analyze the cause of the failure. The minimum size of 1MB indicated in the screenshot is taken from the calculation of the memory dump configuration in the “boot and recovery” settings:

If you choose a full dump to record debugging information, the size increases by several orders of magnitude. For me it was 400MB.

In addition to the inability to record a dump, after disabling the paging file, an annoying message about low memory may appear. Its appearance will be accompanied by terrible brakes on resource-intensive applications.

If you move the swap file to another partition

A bunch of articles on optimizing your OS recommend moving the page file to a separately created and formatted FAT32 hard drive partition. This increases performance and reduces fragmentation of this file.

When performing such manipulations, do not forget that the swap file must be present in the system partition in order to correctly record debugging information. You have to choose between speed and the ability to collect data about troubles that have arisen.

Swap file size

Let's return to our oranges and the question of the optimal size. Having dug through many articles, information publications, and even Microsoft recommendations, I have not found a clear and unambiguous answer to this question. And I wouldn’t have found it, as it became clear to me after reading the translation of Mark Russinovich’s article Breaking Windows Limitations: Virtual Memory . In conclusion, I will provide links to the translation and the original, and now I will try to explain where to get the file size from.

To get started, you will need the Process Explorer utility; it is a free analogue of the default Task Manager, but has many advantages. You can download it from the link.

After launching Process Explorer, select the most memory-intensive applications that you use in everyday life, and launch them all at the same time. In the Process Explorer window, press CTRL+I or select View/System Information from the menu, from the variety of options presented in the data window you need to select the Commit Charge area

Peak value is the peak value of allocated memory for all applications, consisting of physical and virtual memory.

Next, we arm ourselves with a calculator and subtract the size of RAM from this value. If a negative value is obtained, we take the 400MB required by the system (there may be a different value) necessary to create a dump. If a positive value is obtained, we set the minimum and maximum values ​​of the paging file as such. You can play it safe and set the maximum higher “in reserve”, but then file fragmentation will increase if its size increases. Therefore, it is better to fix it in one place.

To operate Windows operating systems, a paging file is used, which is a kind of virtual memory of the computer, which is an extension of its physical RAM. This paging file ensures the functioning of computer programs in cases where there is not enough physical RAM memory.
Windows, by default, detects paging file settings automatically. But sometimes manually changing the paging file can help the user optimize the system. In some cases, it is advisable to completely disable the page file. In some situations, it is best to do nothing and let the system continue to automatically determine the size of the paging file. Below we will figure out how to configure the paging file according to the particular use of the computer, as well as its characteristics.

How to increase or decrease the paging file in Windows 7/8/10

Before we talk about what file size is optimal for different scenarios, we want to explain how you can change this size or disable the use of operating system virtual memory.

To configure the paging file settings, go to “System Properties” (“ My computer» right click - « Properties"), and then select "System protection" from the list that appears.


You can do this faster by pressing “ Win+R" and then entering the command sysdm.cpl (suitable for Windows 7/8/10).


Open the "" tab in the dialog box Additionally", then click on the button " Options", located in the section " Performance" and then select the " tab again Additionally" After this, you should go to the section “ Virtual memory" and press the key " Change».


Here you can configure the necessary virtual memory parameters:

  • Increase or decrease the paging file;
  • Disable virtual memory.
Next, we’ll figure out exactly what size of the paging file is most suitable for Windows.

How to properly configure the paging file?

In some articles devoted to Windows optimization, there are recommendations regarding disabling the page file if the RAM size is 8 or 6 gigabytes. They also recommend using automatic selection of the paging file size. These tips are based on the following. If the paging file is disabled, the computer will not use its hard drive as additional memory. This will increase the speed of the operating system (the computer's RAM is many times faster). By manually specifying the exact size of the paging file (it is recommended that the initial and maximum sizes be the same), we will free up disk space and be able to save the operating system from having to adjust the size of this file.

Note: when using an SSD drive, it is advisable to install the maximum possible amount of RAM and completely disable the page file, which will increase the life of the solid-state drive.

We believe that when regulating the paging file, you should primarily focus not on the size of RAM, but on the peculiarities of using the computer, otherwise there is a high probability that a message about insufficient memory will appear.

If your computing device has 8 gigabytes of RAM, and you use your computer mainly for browsing various sites and also a few games, disabling the page file is likely the right solution (although there is a possibility that you will see an insufficient memory message).

If you use your computer to edit photos using professional programs, work with three-dimensional or vector graphics, design rocket engines and houses, and also use virtual machines, eight gigabytes of RAM will not be enough for you, so during your work you will definitely need a page file . Moreover, by disabling the paging file, you risk unexpectedly losing documents you have not saved, as well as files if a memory shortage occurs.

If you cannot determine how much RAM you need and what the optimal page file size should be, we recommend following these steps:


On the Internet you can find recommendations that differ from the option proposed above. You must decide for yourself which of these recommendations you will follow.

Any user is familiar with the concept of physical memory on a computer; this can be a built-in or removable hard drive on which the processed data is recorded. Modern hard drives are reliable and durable, but they have one significant drawback - low read/write speeds. Therefore, in addition to physical memory, all computers are equipped with a kind of intermediary between the physical disk and the processor - RAM or otherwise RAM, which has a much higher speed than any HDD or SSD drive.

What is a paging file and what is it for?

However, RAM also has its drawbacks, the most significant of which today is its relatively small volume. But in addition to the processes of the system itself, the processes of all user applications, often very demanding of hardware resources, are recorded in it. And when the user runs programs, the total amount of memory he requires may exceed the amount of RAM available on board. In this case, there is a sharp drop in performance, up to the point where individual programs freeze or even the system crashes into BSOD.

To reduce the risk of such an unpleasant scenario developing, the developers created a special file in which the system resets data that does not fit into RAM, and then, when part of the RAM is free, returns it back. It is called the page file; in Windows 7/10 it is also often called virtual memory or page file. To explain in detail the principles of its operation, it would be necessary to read an entire lecture, but we will limit ourselves to this brief explanation: the main task of the paging file is to ensure the best performance of the system and programs under conditions of increased load on RAM.

How to enable the paging file and what its size should be

So, what is a paging file and why is it needed, we hope you understand more or less, now it’s time to move on to a more complex and interesting topic, namely setting it up. In truth, the page file in Windows does not need much configuration except in some special cases. The operating system itself creates it and determines its size based on the physical and software parameters of the computer. By default, this file is located in the root of drive C and has the system name pagefile.sys and, like many system objects, the modification of which is undesirable without special need, is hidden. So if you want to see it, uncheck “Hide protected system files” in the folder options.

If the paging file is in the root of the system disk, most likely you have it enabled. To make sure of this completely, open with the command systempropertiesperformance"Performance Options".

Next, switch to the “Advanced” tab and find the “Virtual Memory” block, where the current size of the paging file will be indicated. If suddenly it turns out to be disabled (size 0), we strongly advise you to enable it. Click the “Change” button in the performance settings window, check the “Automatically select paging file size” checkbox in the next window, turn on the “By system selection” radio button and save the settings.

It’s so easy to put a swap file on Windows 7/10, but this applies to the default settings. You can set your own page file size by disabling automatic volume selection and activating the “Specify size” radio button. Despite the more than sufficient experience of IT specialists, there is no clear opinion about the optimal size of the paging file. Traditionally, it is believed that its volume should be at least equal to the amount of RAM, but this is very approximate, if only for the reason that the swap is dynamic and can increase at the request of the operating system.

So, how much to set the paging file in Windows 7/10, if we are talking about setting it up manually? This depends primarily on the amount of RAM; the system capacity does not play a fundamental role in this case. Taking into account the individuality of a PC, we suggest using the following method to calculate the size of virtual memory. After running as many programs, browser tabs, etc. as possible on your PC, open the Task Manager, go to the Performance tab and note down the amount of RAM used.

Multiply the resulting number by 2 and subtract the actual amount of RAM from the result. The final value will be equal to the recommended page file size.

In general, the less RAM on a PC, the larger the swap should be. So if you are still in doubt about how to properly configure the paging file, use the data in this table, proposed by experienced system administrators:

It should be understood, however, that the figures given here are also averages. There are examples when a paging file is needed even if the PC has 16 or more GB of RAM (this is a requirement of some programs). Also, if you have a habit of leaving a lot of programs running in the background, it is recommended to increase the page file size by 20-30 percent of the above values. On the other hand, if your computer has enough memory, you don’t run “heavy” programs, don’t notice a decrease in performance, and there’s no need to increase it. Three gigabytes of the paging file for 4/8 GB of RAM should be enough to work without “brakes”; an excessive increase will not only not speed up the system, but rather, on the contrary, will slow it down, since Windows will have to access more often not RAM, but to the slower swap file.

In what cases is it necessary to increase the file size?

Let’s assume that we have sorted out the question of what size of the paging file to set; now we will briefly consider the cases when it needs to be increased. In short, because there are only two main reasons - a noticeable decrease in performance when running a large number of programs and the appearance of the error “The computer does not have enough memory.”

It also happens that a program or game requires a swap file of a certain size when launched. How to increase the paging file in Windows 7/10 was theoretically discussed above, in practice it looks like this.

Let's assume that the amount of virtual memory is set according to the system's choice and we need to increase it. Using the systempropertiesperformance command, go to the performance parameters, click change virtual memory, uncheck the option for the system to automatically determine the size of the paging file and specify your own size. You don’t have to bother with the initial and maximum sizes, set the same values ​​in both fields, click “Set”, save the settings and restart the computer. This is how easy it is to change the size of the Windows swap file.

Using a swap file on an SSD

The use of FP on SSD drives should be mentioned separately. There is an opinion that a paging file is not needed on solid-state drives, since, firstly, they are already fast enough, and secondly, repeated data writing shortens the life of the disk. Both of these statements are incorrect. No matter how fast SSDs are, they are still significantly inferior in terms of RAM throughput and, if the latter is not enough at a certain moment, the user will immediately experience a decrease in system performance.

In addition, the volume of data written to the FP on the SSD is not so large as to exhaust the resources of the memory cells (this will take many years). Moreover, the performance characteristics of SSDs and the basic models of using the paging file fit together perfectly, so if your computer has two disks and one of them is an SSD, then it is recommended to place the paging file on it, as it is the fastest! In addition, do not forget that disabling the FP will make it impossible to diagnose critical errors in the system (creating an emergency memory dump).

So, is a page file necessary on an SSD? We can say with a greater degree of confidence that yes, even if the system did not enable it during installation. The exception is PCs with a very large amount of RAM (16 GB and above), but even here everything is not always so simple. As for extending the life of SSDs by disabling/moving the FP, there is some truth here, since the practice of using solid-state drives has clearly shown that their service life directly depends on the load placed on them.

However, there is no need to worry about this. If the PC has sufficient RAM, the page file on the SSD will be used minimally, and there are many other and more significant factors that affect the life of the SDD, including defragmentation, hibernation, TRIM, indexing and other functions.

Well, we hope we have figured out the question of why a paging file is needed. Of course, there are still many subtleties in its use. For example, there are such issues as transferring the file from the system HDD to the user HDD, partitioning, automatic cleaning, and using special configuration utilities, but this is a topic for a separate article.

Publications on the topic