Transferring swapfile sys to another disk. A paging file - why is it needed on a computer, why does the system “slow down” without it? What is this file

💖 Do you like it? Share the link with your friends

10 facts about swapfile.sys - What is this file and can it be deleted

Owners of Windows operating systems from 8.1 and higher may have noticed that the list of system files has been supplemented with one more - .

All PC users need to know what this file is responsible for and whether it is needed in the system.

What is swapfile?

In addition to pagefile.sys, there is swapfile.sys in the resource monitor.

These are all swap files and are used exclusively for metro applications.

Typically, such files are stored in the root folder hard drive and do not exceed 256 MB in volume.

If the user wishes, the memory size of the swap file can be increased.

Why did the system have a third swap file?

The need for a third file arose after a new way of managing memory was required due to the emergence of a large number of applications with a Metro interface.

Such applications require a little more memory to operate.

To see the swap file, you first need to enable the display of protected system files.

You can display them as follows: Control Panel - Folder Options.

In the folder options we find the tab "View" and open it, remove the marker from the item and save the settings by pressing the OK button.

If there is insufficient RAM while applications are running, the system automatically writes data to swapfile.sys.

This made it possible to pause inactive applications to unload the “operations”.

Applications are restored automatically after RAM is freed.

How does swapfile work?

The work of a swap file can be analyzed step by step:

1. PLM (Process Lifetime Manager – Lifecycle Manager) calculates the amount of missing virtual memory and sends a request to MM (Memory Manager - Memory Manager) to free the working set of one of the processes that is responsible for processing Metro applications.

2. The memory manager processes the request, then instructs the memory page to be moved to the list last pages with changes operating system.

All page content is automatically copied and saved to disk.

3. The set of pages is written in sequential order to the modified list page as instructed by MM.

Registration is made in background and only triggers when there is not enough virtual memory.

4. After updating the application, the work list is downloaded to hard drive.

Those memory pages that were removed from the process will still remain untouched in the waiting list.

In another way, we can say that they remain in the cache of useful pages, which, if necessary, can be used in other applications.

If memory pages are needed by a native application, the system can quickly return them.

Where is the swapfile located?

You can find it in the root folder of the hard drive on which the operating system is installed.

Most system files are protected and hidden.

Therefore, to find it, you need to display all hidden system files.

You can configure the display of hidden files not only in the way that we described above. There is another option.

To do this, go to the root folder of your hard drive and open the menu in the upper left corner "File", in which you need to select the item "Change folder and search options".

In the window that opens, open the tab "View", uncheck the item "Hide protected system files" and save the changes by clicking the Apply and OK buttons.

After this, not only the swapfile swapfile.sys, but also other important system files will be displayed in the root folder.

Under no circumstances should such files be deleted! This poses a risk of damage to your computer system. Otherwise, you will have to reinstall the operating system completely.

Difference and belonging

In fact, swapfile is similar to pagefile. They are both used to temporarily store application data, offloading RAM.

They are distinguished from other files with the .SYS extension by the high response speed of applications stored in the swap and page files.

Setting options

If necessary, the user is given the opportunity to change the amount of available space, disable or delete the swap file, and also transfer it to another hard drive.

However, you can only change or delete it at the same time as the pagefile.

By default, the system is set to automatically launch files and allocate memory for them on the hard drive.

If the user does not agree with standard settings, he is given the opportunity to change them.

How to change the amount of virtual memory

You can change the amount of virtual memory in several ways:

  • Menu “Start” - “System” - “Advanced system settings”.
  • In the search menu bar “Start” enter “Performance”(without quotes).
  • Menu “My Computer” - “Properties” - “Advanced system settings”.

Opening options using the search bar requires fewer steps than using other methods.

In the window that opens, you need to go to the tab "Additionally", then LMB press the Change button.

If you have not previously made changes to the system virtual memory settings, a marker will appear in the new window.

If you remove this checkbox, you can change the size of the allowed memory yourself at will.

To do this, manually enter the allowed volume, then click the Set button.

Disabling virtual memory

It is impossible to completely remove the swap file from the computer, but you can disable it until the need to expand the OP arises.

In the window for changing virtual memory parameters, place a marker on the item "No swap file", confirm the action by pressing the Set and OK buttons, and then restart the computer system.

It is worth noting that the amount of free memory on your hard drive will increase, and the performance of the operating system may significantly decrease.

To restore the swapfile, you need to go to the same parameters window and put a marker on the item "Automatically select paging file size", or set the virtual memory size, then reboot the system.

After a restart, the page file will be restored.

Transfer swapfile to another hard drive

You can also configure the swap file by transferring it to another hard drive.

In this case, we mean another hard drive, and not a logical partition of the same disk.

When transferring a swap file, space on the system disk is saved, but performance does not change.

To transfer, you need to make a symbolic link.

Mklink c:\\swapfile.sys g:\\swapfile.sys

Instead of the letter g, you can put any other letter that corresponds to the disk you need.

After all the manipulations performed, you need to reboot the operating system.

Determining the optimal amount of virtual memory

Before changing the amount of virtual memory, you should consider why you are increasing the performance of your computer.

If this is an office PC or a laptop for work, you should not increase the memory too much.

For a gaming computer, you should take into account the memory capacity of the hard drive itself.

To determine the optimal amount of memory, run several priority programs, games and/or videos on your computer at once.

By pressing the Ctrl+Alt+Delete keys simultaneously, call up the task manager and go to the tab "Performance".

In this window, you need to find out how loaded the RAM is, then multiply this number by 2 and subtract the actual installed amount of memory.

For example, you have 5 GB downloaded RAM, but actually 6 GB is installed. We calculate: (5+5)-6=4 .

Exactly this amount of additional virtual memory will be optimal for your computer.

Checking swapfile after shutdown

After you have disabled the page file, you can check whether it has disappeared from the computer system.

To do this, you first need to enable the display of all hidden system files.

To display, open File Explorer and navigate to the following path: “File” - “Change folder and search options” - “View” - “Hide protected system files”.

Save the changes by clicking the Apply and OK buttons.

If you disabled the swap file correctly, it will not appear in the system folder.

Check for the presence of a swap file

Advantages and disadvantages of Swapfile

Advantages:

  • Budget savings. Thanks to the swap file, you can do without making a purchase for some time additional fees RAM. If the extension is required for a certain time, you can use swapfile.sys.
  • Performance stability. A lack of RAM greatly slows down the system, which definitely causes crashes. If you have enough memory on your hard drive, you can expand the virtual memory to the optimal amount.
  • Great temporary solution. If you don't have enough RAM to run high-demand programs, the swapfile.sys extension will provide you with the temporary support you need.

Flaws:

  • Slow reading speed. When placing the swap file on a location other than the system hard drive, the response time may increase.
  • Swapfile is just RAM support. A swap cannot replace or supplement it fully.
  • Hard disk memory consumption. If there is not enough free space on your hard drive, swapping will do little to solve RAM shortage problems. You will still have to purchase a new OP.
  • High probability of computer failure. If you constantly use a swap file as an OP extension, a system failure may occur; because of this, your computer may require reinstallation of the operating system or a comprehensive repair.

Conclusions

Allows you to temporarily expand the amount of RAM, but does not properly solve the problem of lack of available space.

Swap can only be used as a temporary solution.

In this case, there is a danger of a BIOS error appearing, since this is software “overclocking” of the computer, which is not initially provided for by operating systems.

For gaming computers such a solution is not only useless, but also dangerous, since these computers use the system resources of their devices to the limit.

Using a swap file can lead to both incorrect operation, and to the failure of your PC hardware.

If you doubt your skills, contact a service center, where specialists will help you understand your problem, and also advise you or configure your computer system themselves.

Contact only licensed service centers that have good reviews or I work at computer stores.

On all or almost all resources on which I saw this question asked, the answer was almost unchanged: “impossible.” In fact, this is not entirely true.

For reference:

the file Swapfile.sys is located in the root of the boot (system) windows partition and has the attribute “hidden”, which is why it is not noticeable to the naked eye. It has a size of 256MB. Its appearance is directly related to the so-called metro applications introduced in version Windows 8.0.

Due to technical reasons, MS was unable to use one pagefile.sys file for both classic and new type of applications and remembered the good old name, familiar to all elders from the times when windows required megabytes of memory, not gigabytes (yes, yes , such a time was).

Unlike the swap file, the Windows interface does not provide tools for managing the location of the reincarnated container.

The reasons for moving the swapfile.sys file are almost the same as for its relative pagefile.sys:

  • the presence of a faster partition than the one where the system is currently installed
  • attempt to maximize free space on system disk
  • centralized storage of all waste material on a separate section

How to do this? Easy, yesinstructions in English . For those who are not strong in angelic, I will try to briefly explain the essence of the actions.

Stage I : You need to disable the paging file on ALL windows partitions.

Do not forget to confirm each action in this window by clicking the Set button for each disk where we disable FP. The checkbox “Automatically select paging file size” should be unchecked.

Stage II : as an administrator, launch the command line and execute the command

mklink c:\\swapfile.sys k:\\swapfile.sys

where k: is the letter of the destination partition where the file will be located. The point is that we replace the original with a link to it - physically it will be located on the specified disk, but the system will be sure that the location of the file is unchanged. The link will be located on the system disk and will not take up disk space.

For reference:

Command line in in the right form The easiest way to find it is by pressing the Win+X key combination and selecting " Command line(administrator)", confirm the action if necessary.

Stage III : enable the swap file, placing it anywhere.

Regardless of the location of the pagefile.sys swap file, the swapfile.sys file will be created where we told it to be - in our case on drive K:

At one time I did a similar operation myself, for the transfer I used the capabilities of the Total Commander plugin - ntfslink, from the PE environment. It works both ways.

It tells you 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(and also swapfile.sys in later versions of Windows): defragmentation, migration, complete shutdown and cleanup. Does it make sense to create several paging files on Windows, on which drives is it better to place them, and what can all this lead to in terms of improving system performance.

Location and visibility of swap files

By default, the pagefile.sys and swapfile.sys files 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 the section Design and personalization.
  3. Select “Folder Options” -> “View” -> “Advanced Options”.
  4. Select "Show hidden files, folders and drives."
  5. Click OK to save changes and exit the menu.

IN Windows 10 You can enable the display of hidden files and folders in Explorer:

  1. In the top menu of Explorer, go to the tab View.
  2. Select section Options, in the window that opens, open the tab again View.
  3. Open “Advanced options” and uncheck the “Hide protected system files” box.
  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:

Completely disabling pagefile.sys and swapfile.sys

A question of necessity complete shutdown paging files are equally often a concern Windows users 7 and 10, when high-speed or sufficient amount of random access memory (RAM) appears. In the article about it, it was already clarified that it makes no sense to completely disable it.

Reasons not to completely disable sfop (paging):

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

If you still want to turn off the paging file, Windows 10 this is done as follows:

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

All changes will take effect after restarting the computer. Just in case, you can check whether pagefile.sys has really been deleted and is missing from the system root. If in the future any game or program requires this file or it starts giving errors about insufficient virtual memory, you can turn pagefile back on in the same menu.

IN 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 your desktop and select Properties.
  2. In the left menu, select “Advanced system settings”.
  3. Go to the “Advanced” tab at the top of the window.
  4. In the section Performance press the button Options.
  5. Go to the “Advanced” tab again. 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 RAM. Click Change to set other values.
  7. Uncheck the “Automatically select paging file size” checkbox.
  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 already stated, Windows 7/8 does not work very well without the pagefile.sys file on the system. It is better to leave the swap size at 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 turn paging on/off. You can select any of the drives connected to the system, including SSD. The changes will take effect after a reboot: Windows will create new file on the specified disk when the system starts.

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

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

  1. Right-click on the My Computer icon on your desktop and go to Properties.
  2. Select “Advanced system settings” on the left, then go to the “Advanced” section.
  3. In the section Virtual memory press the button Change(at the same time you can set the optimal file size, focusing on Windows offers And ).
  4. Uncheck the box “Automatically select paging file size” if it was checked there.
  5. On the list Disk [volume label] select disk, select below Specify size and set the file size in megabytes.
  6. Click Set And OK to save changes. Click OK in the system message window, if one appears.

You can select several disks at once and set a different swap size in each of them. In this case, there will be multiple pagefile.sys documents that Windiws will use as it sees fit. For the average user there is no point in doing the partitioning. Defragmenting the page file into several separate files will not speed up the system and will not provide any performance benefits.

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

The file split over several disks will look like this:

Swap file on a flash drive

Separately, I would like to mention such a practice as transferring the swap file to a flash drive. Firstly, doing this is quite problematic, since Windows will not list removable storage media in the list of drives for the paging file. Secondly, even if you succeed in transferring pagefile.sys to a 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 with HDD:

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

In reality, not every flash drive even works at the maximum speeds of USB 2.0, not to mention 3.0. In such a situation, from a regular flash drive you can get a write/read speed of 30-100 MB/sec or even less. Compared to HDDs, not to mention SSDs, such speeds will not provide any performance gain.

Clearing the contents of the swap file

During shutdown Windows computer erases all data that is in random access memory (RAM). Data from the paging file is not erased by default and remains on the hard drive when the system is turned off. Therefore, in some situations, unauthorized persons may gain access to the information in this file.

For security reasons, you can force Windows to delete the entire contents of pagefile.sys by rewriting all memory locations to 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 that necessary for debugging.

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

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

You shouldn’t go into the Registry Editor unless you really need to, especially if you don’t have experience working with this section of the system. First you should try to enable file cleaning using the instructions for Group Policy Editor.

This method only works for owners of Pro or Enterprise versions of Windows:

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

If something goes 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 on any free space on the right side of the window, context menu choose New -> DWORD Value (32 bits).
  4. The new parameter must be named ClearPageFileAtShutdown.
  5. Double-click on the created parameter and enter in the window that opens 1 in the 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 is shut down. To disable paging file cleaning, you need to set the created ClearPageFileAtShutdown parameter to 0 , or simply delete it from the registry. After uninstallation (RMB -> Uninstall), Windows will restore the default value (no cleanup on shutdown).

Attentive users of the operating system have noticed that a previously unknown swapfile process is hanging in the resource monitor. Swapfile.sys is the swap file. It is physically located on the system disk, next to the files pagefile.sys and hiberfil.sys. It first appeared in Windows 8 and was used for metro applications, and then in the new Windows 10 operating system. As a rule, the swapfile size does not exceed 256 MB.

Swapfile.sys, Pagefile.sys and Hiberfil.sys

Like pagefile.sys and hiberfil.sys, swapfile.sys is stored by default in the root of the system drive c:\. It's hidden. You can see it by turning on the display of protected system files in the control panel. Hiberfil.sys stores the contents of RAM when the computer is in sleep mode. Hibernation mode (low power consumption mode) also uses hiberfil.sys. When entering hibernation mode, everything open documents and programs are saved to the hard drive. Pagefile.sys is used in Windows when RAM space runs out. At this critical moment, so that the computer does not freeze, but at least continues to work slowly, the system turns to this file for support. Windows stores everything that does not fit in the computer's RAM into it.

What is a swap file?

You may ask, “why do we need another virtual page file?” I will answer. With the advent of Metro-enabled applications, there is a need for a new way to manage memory other than traditional virtual memory or page files. This is how the file “%SystemDrive%\swapfile.sys” appeared. To see this file, you must, as we wrote above, enable the display of protected system files. To do this, open the menu “Control Panel” -> “Folder Options”. Next, go to the “View” tab and uncheck the “Hide protected system files” checkbox. Click "OK".

If the system does not have enough RAM while applications are running, it writes some of the information to the swapfile on the hard drive. This process is similar to the hibernation mode we described above. This mode of operation allows you to pause and resume applications, freeing and loading memory. The introduction of a new paging file allows you to achieve a more uniform load on the computer's RAM.

Let's figure out how it works

1. The Process Lifetime Manager (PLM) detects that the system is low on memory and requests the Memory Manager (MM) to free the working set of a particular process that is responsible for processing Metro style applications.

2. The memory manager moves the memory page from the application's working set to the list of recent operating system page changes (contents this list written to disk)


3. The working set of pages are written asynchronously to the modified list page, as prescribed by the memory manager policy (written intelligently in the background, the write is triggered when there is insufficient free memory)

4. Even after the application is stopped, the working set is written to disk. Memory pages removed from the process will remain intact in the operating system's waiting list. Essentially, it is a cache of useful memory pages that can be reassigned to other applications if necessary. If the original application needs these pages, they will be quickly returned.


If the user switches to an application while the working set of pages is located in hard disk memory (to a modified list or waitlist page), the pages will immediately be added to the application process. If pages are no longer available, Windows will load the application's working set from disk in optimized mode.

Can I remove Swapfile.sys?

The size of the swapfile.sys file is actually not large and, as a rule, does not exceed 256 MB. We do not recommend that you delete this file. By deleting swapfile, you will automatically delete pagefile. Remember that disabling the page file can greatly affect the performance of your computer.

You still decide to disable the paging file. Open the "Start" menu, select "View" -> "Customize" appearance and Windows performance."


In the Performance Options menu, go to the Advanced tab and click the Change button in the Virtual Memory section.


Uncheck "Automatically select paging file size on all drives." Select the system disk and click “No paging file” -> “Install”. The pagefile.sys and swapfile.sys files will be deleted from the selected drive after the system is rebooted.


In order to re-create paging files, select the disk on which we will create the files and click “Size by system” or “Specify size”.

Let's figure out what swapfile.sys is| 2015-08-28 12:15:21 | Super User | System software | https://site/media/system/images/new.png | Attentive users of the operating system have noticed that | dr.web journal key, windows settings, write protection

In "swapfile.sys" the system moves some types of data that are not currently in use. For now, this file is used for data from so-called universal applications (formerly Metro). Perhaps other data will be recorded there in the future.

Swapfile.sys, Pagefile.sys and Hiberfil.sys

The file "swapfile.sys", along with " " and " ", is stored on the system drive - by default it is "C:\". You can see it only if the option is enabled in the settings and the option “Hide protected system files” is disabled. operating system files).

In the “hiberfil.sys” file, the system saves all the contents of RAM when entering sleep mode. It is also used for new feature"hybrid boot", thanks to which Windows startup 8 and 10 speeded up significantly. And the file “pagefile.sys” is designed to unload data from RAM when space in it runs out.

Why is the "swapfile.sys" file needed?

There is little official information from Microsoft on this matter, but we can compile an answer from publications on the forums and on the company’s blog.

In short, the “swapfile.sys” file is used to upload data from new applications, which in official terminology have changed their name more than once: universal applications, applications from the Store, Metro applications, modern applications, Windows applications 8, style apps Windows interface 8, etc, etc.

These applications are managed differently than Windows desktop programs. The system approaches their memory management more intelligently. Here's how Microsoft employee Black Morrison describes it:

The question may arise: why do we need another virtual swap file? The fact is that with the advent of modern applications, we needed a new way to manage their memory outside of the traditional method of using virtual memory/page file.


Windows 8 can essentially write the entire set of (private) working data of an inactive modern app to disk to free up RAM when the system lacks it. This is the same as putting an individual application to sleep and resuming when the user accesses the application again. In such a situation, Windows 8 uses the modern app suspend/resume mechanism to upload and download the application's working data.


Instead of the standard "pagefile.sys" file, data from inactive universal applications is dumped into the "swapfile.sys" file.

Additional details are provided by Microsoft employee Pavel Lebedinsky:

Pausing/resuming a Metro app is just one use case, and there may be others in the future.


A "swapfile" file and a regular "pagefile" differ in their usage and requirements for disk space, dynamic growth capabilities, read/write policies, etc. Having two separate files makes things easier.


In short, the standard page file is used for normal Windows tasks, and the new frame Microsoft applications provides for the use separate file for intelligent downloading of new application data.

How to delete the file "swapfile.sys"?

This file is not large at all - its maximum size should not exceed 256 MB. Therefore, there is no need to remove it. Even if we are talking about a tablet with a small amount of internal storage, the “swapfile.sys” file most likely improves the performance of the device.

The file "swapfile.sys" is managed in conjunction with "pagefile.sys". When the latter is disabled, “swapfile.sys” is also disabled.

But if you really want to, you can still remove it. To do this, open the Start menu, enter in the search keyword"performance" and select the "Adjust the appearance and performance of Windows" link from the results.

In the Performance Options window, open the Advanced tab and in the Virtual memory section, click the Change button.

Uncheck Automatically manage paging file size for all drives, highlight the drive, select No paging file, and click Set. After the reboot, the files "pagefile.sys" and "swapfile.sys" will be deleted from the selected drive.

After this, it is possible to recreate the page file on another drive, and then Windows will store all virtual memory files there. This allows, for example, to extend the life of a solid-state drive by transferring swap files to a mechanical hard drive.

Tell friends