How to set up smartphones and PCs. Informational portal
  • home
  • Iron
  • How to delete the swapfile sys file windows 10. Complete Windows swap file setup

How to delete the swapfile sys file windows 10. Complete Windows swap file setup

Users of Windows operating systems will find it useful to know that the list of hidden system files, starting with Windows 8.1 and higher (windows 10), has been supplemented with another file - swap. Knowing what swapfile is and what it is used for can help you avoid many problems.

How is it different from the rest and what is it used for?

The purpose of swapfile is quite similar to the pagefile.sys swap file. It is used for temporary storage of currently unused metro applications. Its main difference from other sys files is that in case of access to an application stored in it, the system opens it almost immediately. This is due to the fact that the application is stored in the file in a "full" state, which allows the system to start it without additional access to the hard disk.

All swapfile customization options

Since swapfile is similar to a swap file, all changes to one affect the other. They both relate to the virtual memory of a computer, since they perform fairly similar functions. That is, you can increase / decrease or delete swapfile only in conjunction with pagefile.sys. By default, the system automatically starts them and allocates a certain amount of hard disk space for them. In case of disagreement with the system data, the user can make the following changes to them:

  • increase / decrease the volume;
  • disable;
  • transfer to another hard drive.

How do I increase / decrease the amount of virtual memory?

In order to be able to make any changes to the file, you need to run additional system parameters. This can be done in several ways:

  • by starting from the menu panel start - system - additional system parameters;
  • from the start menu bar by typing "performance" in the search box;
  • from the menu bar "My Computer" - properties - additional system parameters.

Please note that when launching parameters through the search box, the number of steps required is slightly lower than when using other methods. After opening the window, you need to go to the "Advanced" tab and click the "Change" button.
If the system has not previously made any changes regarding the virtual memory of the computer, a check mark will appear in the window that opens, allowing the system to determine the file size itself. Having removed it, you can independently change its dimensions by prescribing them manually and pressing the "Set" button.

How do I disable virtual memory?

It is physically impossible to remove swapfile from a computer, but it can be disabled. This will undoubtedly increase hard disk space, but PC performance may noticeably deteriorate. It turns off in the same place where its dimensions change, although the choice of actions will be slightly different. Instead of specifying the amount of virtual memory, you need to select the "No pumping file" item and click the "Set" button.
Important: after the steps taken, you should not try to check if the problem has disappeared, because before the necessary reboot of the PC, the swapfile will be in place.

How do I move swapfile to another hard drive?

You can also configure the paging file by transferring it to another hard drive. Please note: we are talking about a hard or SSD drive, but not about a logical partition on it. Transferring it to a separate hard drive will save space on the system hard drive, while maintaining system performance.

The transfer process is pretty straightforward. It is necessary to delete the swapfile by selecting in the virtual memory of the computer on the C drive, selecting the "Without swap file" item and saving the result by pressing the "Set" button, enable (add) it on another hard drive. When specifying file sizes, it is advisable to set the automatic size selection mode or manually specify the most optimal one for your computer.

How to determine the optimal file size?

Before you take on the resizing yourself, trying to save at least a little space on your hard drive or speed up the performance of your computer, it is worth exploring this issue a little deeper. Since users use a computer for different purposes, then the optimal size for each will be different.

In order to find out what it is for you, run several programs, games and videos that are most important to you at the same time. Next, open the task manager, and go to the "Performance" tab. Here you need to see how much the computer's RAM is loaded, double this number, and then subtract as many GB as is actually installed on the computer. For example, at the moment, 7GB of RAM is used, and only 8 are installed on the computer, then the optimal size will be 7 + 7-8 = 6GB.

How to check if swapfile has disappeared from hard drive?

After shutting down and restarting the computer, you can check if the file has disappeared from the hard disk. To do this, you need to display all hidden system files. This can be done in the explorer window by following the following procedure: file - change the settings for folders and search - view - hide protected system files.


After completing these steps, hidden system data, if not disabled, will appear in the root of the C drive.


Below is a video on the topic. It briefly describes and clearly shows all the possible actions with the swapfile.

Conclusion

Swapfile is, of course, quite similar in purpose to pagefile.sys, but they also have differences in read and write speed. Both files refer to the computer's virtual memory and it is physically impossible to delete swapfile or pagefile. The only manipulations that the system allows are turning them off and resizing.

Attentive Windows 10 and 8.1 users have probably noticed that in the root of the system drive (usually the C: \ drive), in addition to the familiar pagefile.sys and hiberfil.sys files, another file has appeared swapfile.sys which was not present in previous versions of Windows. To see this file in File Explorer, you need.

File swapfile.sys is analogous to paging file pagefile.sys but is used as virtual memory for temporary storage of data for modern applications (Metro Store apps).

In the event that a modern application is not in use, it is suspended by the OS manager and moved to the swap file swapfile.sys so as not to take up space in random access memory (RAM). When the user accesses the application, it is retrieved from the paging file and placed in memory. There is not a lot of official information on the swapfile.sys file on the network, however, judging by the comments of MSFT employees, a separate swap file was needed due to the architecture of modern (universal) applications. Two separate swap files also make development easier for programmers.

While pagefile.sys and swapfile.sys serve the same purpose, they differ in terms of minimum disk space, dynamic expansion capabilities, and I / O.

Some people are wondering if swapfile.sys can be deleted? In general, yes, you can, but it is not recommended to do this, since its functioning is closely tied to the main paging file. In addition, there is little point in removing it, since the size of the Swapfile.sys file does not exceed 256 MB. However, sometimes its removal or relocation is justified.

Disable paging file in Windows 10

Built-in system tools allow you to disable the use of the swapfile.sys file only in conjunction with the main swap file. In most cases, this is not worth doing, and if you have performance or stability issues, it is recommended that you enable the paging file.

To disable the swap file:

After the system boots, the Pagefile.sys and Swapfile.sys files will disappear from the root of the system disk.

Alternative way to disable swapfile.sys

Already in the process of writing this article, I found a much more convenient way to delete the swapfile.sys file, which does not affect the main swap file Pagefile.sys. For this:


How to move swapfile.sys to another drive

There is a little trick that allows you to move the swapfile.sys file to a partition on another disk without completely disconnecting it using a symbolic link. For example, this method can be used to increase the service life of an SSD disk by moving the paging file to a regular mechanical HDD.

  1. Disable the swap file as described above
  2. Run the mklink command with administrator rights c: \\ swapfile.sys f: \\ swapfile.sys - where F: is the drive letter to which you want to transfer the file
  3. Include the swap file

It describes how to determine the optimal paging file size, what to do with SSD drives, and how to set the file size on Windows 7, 8 and 10 (as well as XP and Server - the steps are almost identical).

This article covers the following steps with pagefile.sys(as well as swapfile.sys on later versions of Windows): defragment, migrate, shutdown, and clean up. Does it make sense to create multiple paging files on Windows, which disks are best placed on and what all this can lead to in terms of improving system performance.

Paging file location and visibility

By default, the paging files pagefile.sys and swapfile.sys are located in the root of the disk where Windows itself is located (all system folders). Since pagefile.sys is a hidden system file, it is invisible by default: you need to enable show hidden files and folders... In Windows 7, the display of hidden files and folders can be configured in the Control Panel.

Including invisible (hidden) files and folders in Windows 7:

  1. Press the button Start.
  2. Go to Control Panel, then to section Appearance and personalization.
  3. Select "Folder Options" -> "View" -> "Advanced Options".
  4. Select "Show hidden files, folders and drives".
  5. Press OK to save changes and exit the menu.

V Windows 10 you can enable the display of hidden files and folders in Explorer:

  1. In the top menu of the explorer go to the tab View.
  2. Select a section Parameters, in the window that opens, open the tab again View.
  3. Open "Advanced options" and uncheck "Hide protected system files".
  4. Check the box next to "Show hidden files".
  5. Click "Apply", then "OK" to save the changes.

The folder settings menu should look something like this:

Disabling pagefile.sys and swapfile.sys completely

The question of the need to completely disable paging files equally often worries users of Windows 7 and 10 when a high-speed or sufficient amount of random access memory (RAM) appears. In the article about it has already been found out that it does not make sense to completely disable it.

Reasons not to disable swap (swap) completely:

  1. Some programs and games, and Windows itself, are designed to work with the swap file, without it unexpected errors and glitches may appear.
  2. With a sufficient amount of RAM (8-16 GB and more, depending on the tasks), 300-500 MB of data will be written to pagefile.sys per day. In other words, the user doesn't sacrifice anything.
  3. With enough RAM, you can set the file size limit to 1 GB and not worry about it in the future.

If the desire to turn off the paging file is not lost, in Windows 10 this is done as follows:

  1. Right click on the menu Start, select item System.
  2. In the left menu, click "Advanced system settings" (you need to have administrator rights).
  3. Press Parameters, open tab Additionally.
  4. In the "Virtual memory" window, click on the button Change…
  5. Select a line just below No swap file.
  6. Press Ask, then Yes in the warning window that appears.
  7. Press OK in the Virtual Memory settings window to save the changes.

All changes will take effect after restarting the computer. Just in case, you can check if pagefile.sys was actually deleted and is missing from the system root. If in the future any game or program requires this file or starts to display errors about the lack of virtual memory, you can turn the pagefile back on in the same menu.

V Windows 7 and Windows 8 / 8.1 to change or delete the paging file you need:

  1. Right-click on the My Computer icon on the desktop, select Properties.
  2. Select "Advanced system settings" in the left menu.
  3. Go to the "Advanced" tab at the top of the window.
  4. In chapter Performance push the button Parameters.
  5. Again go to the "Advanced" tab. In the "Virtual memory" section of the window it will be written what the maximum size the paging file can occupy at the moment.
  6. By default, these Windows versions set the pagefile size equal to the RAM. Press Change to set different values.
  7. Uncheck the box "Automatically select paging file size".
  8. Select item No swap file to turn it off completely.
  9. Click OK and restart your computer for the changes to take effect.

As stated, Windows 7/8 does not perform well without the pagefile.sys file on the system. Better to leave the swap size 512-1024 megabytes for system purposes. This rule works regardless of the amount of RAM on the computer.

Transfer and defragmentation (breakdown)

Transferring a paging file from one disk to another is performed on the same page where you select the file size and enable / disable paging. You can select any of the drives attached to the system, including SSDs. Changes will take effect after reboot: Windows will create a new file on the specified drive on system startup.

Interestingly, on the official Microsoft website there is only about transferring the paging file. The article contains instructions for Windows XP, no new information was added on this topic.

The instructions below will help you transfer pagefile.sys to another drive in Windows 7, 8 / 8.1 and 10:

  1. Right-click on the My Computer icon on the desktop, go to Properties.
  2. Select "Advanced system parameters" on the left, then go to the "Advanced" section.
  3. In chapter Virtual memory push the button Change(at the same time, you can set the optimal file size, focusing on the suggestions of Windows and).
  4. Uncheck the box "Automatically select paging file size", if it was set there.
  5. In the list Disk [volume label] select disk, select below Specify size and set the file size in megabytes.
  6. Press Ask and OK to save changes. Press OK in the system message window, if one appears.

You can select several disks at once and set a different size for swap in each of them. In this case, there will be several pagefile.sys documents that Windiws will use as it sees fit. It doesn't make sense for the average user to do the breakdown. Defragmenting the paging file into multiple separate files will not speed up the system or provide any performance gain.

In some cases, the file of the minimum size is still needed on the system disk, and not on a high-speed SSD or flash. This allows you to retain the ability to diagnose the system when critical errors (BSOD) occur, since debug data can be written there.

A file split into several disks will look like this:

Swap file on a USB flash drive

Separately, I would like to mention such a practice as transferring the paging file to a USB flash drive. First, it is quite problematic to do this, since Windows will not list removable media in the list of drives for the paging file. Secondly, even if you succeed in transferring pagefile.sys to a USB flash drive, it may not give any significant result.

On the one hand, the speed of USB 3.0 is really high, especially when compared to HDD:

  • USB 2.0 - up to 480 Mbps (60 Mbps)
  • USB 3.0 - up to 5 Gb / s (600 MB / s)
  • SATA Revision 2.0 - up to 3Gb / s
  • SATA Revision 3.0 - up to 6 Gb / s

In reality, not every flash drive works even at maximum USB 2.0 speeds, let alone 3.0. In such a situation, it will be possible to get a write / read speed of 30-100 MB / s or even less from a regular flash drive. Compared to HDDs, not to mention SSDs, such speeds will not give any performance gain.

Clearing the contents of the paging file

When you shut down your computer, Windows erases all data in random access memory (RAM). By default, the data from the paging file is not erased and remains on the hard disk when the system is turned off. Consequently, in some situations, unauthorized persons can gain access to the information in this file.

For security purposes, you can force Windows to delete all contents of pagefile.sys by overwriting all memory locations with zeros. In this case, potential attackers will not be able to get to important documents. At the same time, the owner himself will not be able to access information from the swap, including information necessary for debugging.

There are two ways to force Windows to clear the contents of the paging file:

  • Using settings Group Policy Editor.
  • By changing the value of the entries in Windows Registry Editor.

Without unnecessary need, you should not go into the Registry Editor, especially if you have no experience with this section of the system. First you should try to enable file cleaning using the instruction for Group Policy Editor.

This method works only for owners of the Pro- or Enterprise- version of Windows:

  1. Press Start, enter in the search bar gpedit.msc and open the file.
  2. In the opened Group Policy Editor, go to the section Computer configuration then in Windows configuration.
  3. Open Security> Local Policies> Options on the left side of the window.
  4. On the right side of the panel, double-click on the policy Shutdown: Clear the virtual memory paging file.
  5. In the window that opens, select the item Turn on.
  6. Press OK to save changes. The changes will take effect after the system is rebooted.

If something went wrong, you can use Registry Editor:

  1. Click "Start", then "Run". In the window that appears, enter regedit and press the Enter button.
  2. In the registry editor that opens, you need to find the key (on the left side of the window): HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ Session Manager \ Memory Management.
  3. Right-click in any free space on the right side of the window, select New -> DWORD Parameter (32 bit).
  4. The new parameter needs to be named ClearPageFileAtShutdown.
  5. Double-click on the created parameter, in the window that opens, enter 1 in field Value, click OK to save the changes.

The finished work should look like this:

You must restart your computer for the changes to take effect. Windows will then clear the contents of pagefile.sys every time the system shuts down. To disable cleaning up the paging file, set the created ClearPageFileAtShutdown parameter to 0 , or simply delete it from the registry. After uninstalling (RMB -> Uninstall) Windows will restore the default value (no cleaning on shutdown).

In Windows 8.1 and 10, the swapfile.sys file is located on the system drive. It can be seen only if you enable the function of displaying hidden files and folders, and also disable the option to hide protected system files. Next to it are pagefile.sys and hiberfil.sys. They are familiar from previous versions of operating systems. The system uses the hiberfil.sys file to save RAM data when it hibernates and also to boot the operating system faster. Pagefile.sys dumps data from RAM when it runs out of space, which is a temporary storage file.

What is swapfile.sys?

Now I will explain in more detail about the swapfile.sys file. It is also a data storage file like pagefile.sys, but it dumps data from new Modern applications. The system manages the memory of such applications differently. Swapfile.sys and pagefile.sys differ in usage, storage space, read / write, etc. Microsoft is reluctant to provide scant details about this file. In short, two files make it easier for developers to work and save memory. That is, Windows uses the pagefile.sys file for standard tasks, and swapfile.sys serves as a separate file to unload data from Modern applications.

Why not touch swapfile.sys?

The size of this file does not exceed 256 MB. Removing it will not add much disk space. Boot speed and system performance will slow down, which I would not recommend. After all, the main advantage of new operating systems lies in their speed, and not in a beautiful design. If you really want to remove swapfile.sys from the system?
You can disable the swapfile.sys file. It is managed in tandem with pagefile.sys, so if you disable the standard one, disable swapfile.sys as well.

Right-click on the "Start" button, select "System",

followed by "Additional system parameters",

then in "Performance" select "Parameters",

click "Advanced" and in the item "Virtual memory" click "Change".

Now you need to uncheck "Automatically select paging file size", select the disk, select "No paging file" and click "Set".

This article explains the purpose of the paging file, the benefits of placing it on a different physical disk, and provides step-by-step instructions for moving it to Windows.

A note about links in this article

The first version of the material was written a very long time ago, and during this time the pages of Microsoft's sites have changed or disappeared altogether. You can view their previous contents using the Internet archive, although in the Russian Federation it is Roskomnadzor. Since there are no current pages with this information, I decided to leave the links "as is".

Further in the program

What is a paging file and what makes it possible to move it

According to Windows Vista help, where the paging file is named paging file, it is A hidden file or files on a hard disk used by Windows to store portions of programs and data files that do not fit in RAM. A page file and physical or random access memory (RAM) make up virtual memory. As needed, Windows moves data from the page file to RAM and from RAM to the page file to make room for new data. Also called the swap file.

Placing the paging file on a dedicated partition another physical disk improves the performance of Windows by speeding up the processing of input / output (I / O) requests. In addition, the file placed in this way is not fragmented, which also improves performance.

How many paging files should there be and where to place them

There is an article in the Microsoft Knowledge Base (KB307886) describing how to move the paging file in Windows XP (no newer ones have been published). Specifically, the article states that you you can increase system performance, as well as free up space on the boot partition by moving this file to an alternate partition... Unfortunately, the article does not cover one important point.

It makes sense to move the paging file only to a partition located on another physical disk., which I have already mentioned twice in this article.

However, this is discussed in another article (KB314482), which provides the rationale and benefits of this approach, as well as other tips for setting up the paging file. For example, it says that if there is no paging file on the system partition, Windows will not be able to create memory dumps (memory.dmp), which can be useful for troubleshooting OS problems. I recommend that you read this article for a more complete understanding of the benefits of moving the paging file.

As for placing the paging file on another partition of the physical disk on which the operating system is installed, this approach, although it avoids fragmentation of the paging file, does not lead to faster processing of I / O requests, which is much more important for improving OS performance. than a defragmented paging file. In Windows XP with one physical hard disk, it was enough to organize defragmentation of the paging file using the PageDefrag utility, but in newer operating systems it does not work.

If you have two or more physical disks, in accordance with Microsoft's recommendations, it is optimal to create several paging files - on the system partition (in fact, to preserve the ability to write memory dumps) and on other physical disks (to improve performance by accelerating I / O operations).

With multiple swap files at its disposal, the system chooses the fastest option on its own. Therefore, in a bundle SSD + HDD, two FPs are useful only when the SSD is loaded with work to capacity. But with a pair of SSDs, two FPs may well make sense, and that's how I did it.

How big should the partition be for the paging file?

Since the gain from defragmenting the FP is insignificant, it can be neglected and not create a separate partition for the FP (this is definitely not required when placing the second FP on an SSD). In any case, there can be no specific recommendations on the maximum size of the paging file, since it all depends both on the amount of installed RAM and on how intensively the paging file is used by the system and applications.

Obviously, the more RAM is installed, the less paging file is used. When the size of the paging file is managed by the system, its maximum size does not exceed three sizes of RAM. In most cases, a partition with this size will be sufficient. Increasing the paging file unnecessarily will not increase performance - this will prevent the system from using it more actively.

How to move the paging file

Conclusion

This article provides guidelines for tuning the paging file to improve the performance of Windows Vista and newer. In particular, it discusses the issue of moving the paging file to a separate partition on another physical disk, and provides step-by-step instructions on how to do this.

You can find answers to other questions about the swap file in the thread on the OSZone forum. In particular, it says how big should the paging file be, is it possible to work without a swap file and is it good etc.

Top related articles