What is the swapfile.sys file for in Windows 10, can it be deleted and how to do it

Command to move the swap file

An increasing number of users are switching to the operating system Windows 10. Somewhere Microsoft representatives are forcing it to do so. In other situations, the user himself deliberately takes such a step, since Windows 7 has lost support, and the next Windows 8 is in many ways inferior to the top ten.

But the fact that the popularity of Windows 10 is growing does not mean that there are no problems, as well as questions for developers.

Swapfile.sys in Windows 10

Sometimes users come across some processes and files, which they cannot figure out the purpose of without outside help and consultation.

Users often ask questions about the purpose of the swapfile.sys file, as well as about its possible deletion. In fact, you should not rush to erase this file from your PC or laptop. First, you need to find answers to several important questions.

Contents

Why is it needed

To begin with, it will be logical to ask the question of what is swapfile.sys and why this file is needed at all on a computer with the Windows 10 operating system.

It is actually one of two swap files. There is a main file, and there is a secondary one. In the case of swapfile.sys, we are talking about an auxiliary swap file.

Serves so that files and data from running programs, games and applications are loaded into it. This happens when there is not enough available RAM to accommodate them.

But then it would be natural to ask why Windows uses 2 paging files at once. The question is logical. Microsoft representatives gave an exhaustive answer to it.

Swap files in Windows 10

It’s all about modern applications and gaming computer developments. They are based on a slightly different algorithm for functioning with memory. In the case of the usual main paging file, which is named Pagefile.sys, everything looks like this. The program or game is launched and loaded into RAM. Everything that did not have enough space in the RAM is loaded into this swap file.

But in the case of the swapfile.sys file, things are different. It works differently. For example, a user turns on a game on a computer. Of course, other programs and applications run in parallel. These are antiviruses, browser, instant messengers, background system services, and so on. Some files related to the running game do not fit into the RAM memory. Then the system does not start loading leftover files into the paging file. Instead, it uploads there background program files that the user is not currently working with. This frees up space in the RAM. And then it is already enough to completely load the game files into the RAM.

This scheme of work provides high-speed performance in games with increased hardware requirements. After all, now they do not use the swap file. And there is a process of freeing up space in RAM.

Delete or not

Also, users are interested in whether this secondary is worth it, let’s call it so, delete the paging file from the computer. In general, in theory, it can be removed. It’s not that hard.

But this is not recommended. Moreover, many are categorical about this idea and strongly advise against getting rid of the file.

There is a logical explanation for this. To begin with, at least the file itself weighs about 250 megabytes, no more, that is, deletion will not have any significant effect. On the other hand, cleaning will significantly reduce the efficiency and performance of your computer. Removal will do more harm than good. After all, there is a direct link between the two swap files. By removing one of them, the performance indicators of the PC will instantly change, and for the worse.

Disconnection

Due to the built-in tools and tools of the operating system, it will be possible to disable the file in question only if the main paging file is also turned off. Since in the overwhelming majority of cases this is not recommended, it is required to act carefully.

If the performance on the computer drops, or the system starts to function unstable, the correct solution would be to enable swap.

If you want or need to turn it off, you need to do the following:

  • press the key combination Win and X on the keyboard, and open the Control Panel;
  • then go to the category with advanced system settings (Advanced System Settings);
  • select the tab “Extensions” (Advanced);
  • then in the line Perfomance click on the button “Settings” (Settings);
    Go to Performance Options
  • in the new window select Advanced again and in the “Virtual memory” section click on “Change”;
    Change button in the Virtual memory section
  • remove the check mark from automatic file resizing;
  • select the drive where you want to disable the swap file;
  • check the box “No paging file”;
  • then click Set;
  • and click OK twice for the changes to take effect.
    Keeping the paging file disconnected Confirmation of keeping the paging file disabled

All that remains is to restart your computer.

Reboot prompt after disabling the paging file

By following these steps, both paging files will no longer appear at the root of the system drive.

In fact, you cannot completely delete a file. But swapfile.sys can be temporarily disabled on Windows 10. Then reactivated, or transferred to another hard drive.

Now to the question of how to remove swapfile.sys (disable) if you are a Windows 10 user.

Besides the presented method, there is an alternative option to disable swapfile.sys on a Windows 10 computer or laptop on board.

To do this, the user will need to do the following:

  • run the registry editor, that is, Regedit.exe;
    Regedit.exe command in Run utility
  • open the registry key HKEY_LOCAL_MACHINE SYSTEM CurrentControlSet;
  • then go to Control, from there to Session Manager, and eventually open the Memory Management directory;
    Path to the Memory Management folder in the registry
  • here you should create a new parameter DWORD 32 bit;
    Create DWORD Parameter in Memory Management Folder
  • give it the name SwapfileControl;
  • set the value to 0;
    The value of the SwapfileControl parameter in the registry
  • all that remains is to reboot the operating system and check if the changes have been made.

In this case, the swap file should disappear, and the pagefile should remain in the system.

The advantage of the alternative shutdown method is that it is more convenient and does not affect the main paging file in any way.

File transfer

Some users may find it necessary to transfer this file called swapfile.sys using another disk for storage.

Moreover, users usually want to transfer swapfile.sys to some other disk for the following reasons:

  • the computer has a faster partition compared to where the system file is currently located;
  • there is a desire or need to free up space on the system disk;
  • the user wants to create a centralized storage of all junk files by allocating an appropriate section for them.

To transfer the file yourself, follow the instructions.

The process looks like this:

  • First, the paging file is disabled. Moreover, this must be done for all sections of the Windows 10 operating system. Detailed instructions for disabling are discussed above.
  • Now start the command line. Required with administrator rights. Otherwise, nothing will work.
    Run command line as administrator
  • Write the command mklink c: \ swapfile.sys x: \ swapfile.sys, where instead of x, write the letter of the drive where you want to transfer. Apply this command and wait for the process to complete.
    Command to move the swap file
  • Now re-enable the swap file. Only it will already be transferred to another disk.

Check the result of the work done.

It’s safe to say that swapfile.sys is a useful and even necessary file.

It is pointless to delete it in order to free up several hundred megabytes of hard disk space. Very little space is freed up. But in parallel, performance drops, as well as the efficiency of the PC. This is especially true when launching powerful modern games and applications.

Have you ever deleted the swapfile.sys file? What was the reason for this need? What installation method did you use? What did such actions lead to?

We are waiting for your answers.

Subscribe, ask questions, leave feedback and tell your friends about the project!

Leave a Reply

Your email address will not be published. Required fields are marked *