By Delia / Last update December 29, 2021

Whenever our computer gets stuck, we often think of cleaning the disk (especially the C drive). And if we analyze the disk with the help of a tool like SpaceSniffer, we may find a pagefile.sys file that takes up a lot of space.

pagefile sys

What is pagefile.sys

The pagefile.sys is a virtual memory, i.e. a system paging file. Virtual memory uses external memory as memory, which means it will use the hard disk to simulate memory usage, which can relieve the pressure of insufficient physical memory and help improve resource usage. If the computer is running low on memory, it will invoke virtual memory to execute programs to prevent the system memory from crashing.

Virtual memory has both advantages and disadvantages, the bad part is that it takes up hard disk space, and the higher the virtual memory setting, the more space the system allows the virtual memory to take up on the hard disk. In addition, when the memory stick capacity is too small, the system will frequently call up the hard disk space for virtual memory use. Frequent reading and writing to the hard disk will accelerate the mechanical damage to the hard disk and will reduce the life of the hard disk.

Can you delete pagefile.sys

The sys files usually contain system settings and variables for Microsoft DOS and Windows operating systems, as well as functions used to run the operating system, common storage device drivers, and other core Windows functions.

Pagefile.sys is also a protected system file, so in most cases Windows hides it, and if we do not manually set it to show hidden files, we can't find it in the system directory, nor delete it in the normal way. To remove this file, we can set virtual memory to 0 and then restart the system, and then the pagefile.sys will disappear.

However, this is not a recommended practice, because the temporary data generated by apps we use usually takes up a lot of memory, and if we don't use the virtual memory, the system will easily show the "insufficient virtual memory" prompt.

If we don't want the pagefile.sys file to take up too much capacity on the c drive, we can try to resize the virtual memory or set it to the D drive.

How to resize pagefile.sys (virtual memory)

1. Right-click the Start menu and select "System" to open.

2. Under "Related Settings", find and click "Advanced system settings".

advanced system settings

3. Once you enter the system properties screen, switch to the "Advanced" tab and click "Settings" in Performance.

performance settings

4. In the pop-up window, switch to the "Advanced" tab and click "Change" in the Virtual memory box.

change virtual memory

5. Uncheck "Automatically manage paging file size for all drives", and then check "Custom size", according to your computer's actual situation. Set the pagefile.sys file according to the actual situation of your computer. The recommended size is 1.5-2 times the physical memory (1GB = 1024MB).

customize paging file size

Click "OK" to confirm, and the settings will take effect after reboot as shown in the pop-up notification.