18.07.2020

A paging file - why is it needed on a computer, why does the system "slow down" without it? Complete Windows swap file setup Moving swapfile sys to another disk


If you enable display in Windows 8.1 and 10 hidden files and folders, then in the root of the system disk, in addition to the already familiar pagefile.sys and hiberfil.sys to many users, you can see the swapfile.sys file, which was not in previous versions operating system. What is this strange file and what is it for? Swapfile.sys is somewhat similar to the pagefile.sys swap file, but it is used to temporarily store a different type of data, namely, Universal Application data.

If the data of a Modern application is not currently being used, it is moved to swapfile.sys so that it does not take up extra memory space and is retrieved when it is requested by the user again. There is still very little official information on swapfile.sys, but judging by the scant comments from Microsoft employees, the creation of a separate swap file was required due to the specifics of universal applications. That is, literally two separate paging files make it easier for developers to work.

Having similar tasks, swapfile files and pagefile, however, differ from each other in the minimum requirements for disk space, read / write methods, capabilities dynamic expansion etc.

Many people wonder if swapfile.sys can be removed? In principle, it is possible, but it is not recommended to do this, especially since the mechanisms of its control are closely related to the main paging file. And there is no point in removing it, even on small SSDs. The maximum size for swapfile.sys is usually less than 256 MB, so you won’t gain anything if you delete it.

But if you really want to get rid of it, please, just do it right. Right-click on the Start button and select System -> Extra options system, in the "Performance" block, click the "Parameters" button, switch to the "Advanced" tab and in the " Virtual memory"Click" Change ".

Now change the checkbox "Automatically select the size of the paging file" and, having selected the section with the mouse, enable the radio button "Without paging file". Click the "Set" button, save the settings and restart your computer.

Both swapfile and pagefile will be removed from disk.

Have a great day!

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 certain modern application is not used, 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.

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

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 SSD disk by moving the paging file to a conventional 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

In Windows 8.1 and 10 on system disk the swapfile.sys file is located. 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 by older versions 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".

On all or practically all the resources on which I saw this question asked, the answer was practically unchanged: "impossible". Actually this is not true.

For reference:

the Swapfile.sys file is located in the root of the boot (system) windows partition and has the "hidden" attribute, which makes it invisible to the naked eye. It is 256MB in size. Its appearance is directly related to the so-called metro applications, introduced into use in the windows 8.0 version.

Due to causal techniques, MS could not use one pagefile.sys file for both classic and newborn types of applications and remembered the good old name familiar to all aksakals since the days when windows required megabytes of memory, not gigabytes (yes, yes , there was such a time).

Unlike the paging 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 cousin pagefile.sys:

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

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

Stage I : you need to disable the swap 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 the FP. The "Automatically select paging file size" birdie should be unchecked.

Stage II : as administrator, run 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 bottom line 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. A link will be located on the system drive that does not take up disk space.

For reference:

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

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

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

At one time he did a similar operation himself, for the transfer he used the possibilities plugin Total Commander - ntfslink, from PE environment. Works both ways.

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(and 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 hidden system file, by default it is invisible: 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 Options, 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 is equally often worried Windows users 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 Options, 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 it will start giving errors about the lack of virtual memory, you can turn 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 Options.
  5. Again go to the "Advanced" tab. In the "Virtual Memory" section of the window it will be written which maximum size may be occupying the paging file at the moment.
  6. By default, these Windows versions set pagefile size equal to 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. For regular user there is no point in doing 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 maintain the ability to diagnose the system when critical errors(BSOD) because 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

During shutdown Windows computer erases all data that is 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 Editor group policies you need to 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).


2021
maccase.ru - Android. Brands. Iron. news