For people who are not familiar with how RAM and virtual memory works, they are confused over a file called pagefile.sys which is found in the “C” drive of your PC. There is a lot of confusion over this file, whether it is a virus or a useful file, should I delete it?, what is this file for?, what will happen if I delete this file? All of these questions will be answered here.
What is pagefile.sys?
Pagefile.sys is actually a Windows file that is used for storing data that is otherwise stored in the physical memory, i.e RAM. Sometimes when there isn’t enough RAM available to hold all the data then the data is moved to pagefile.sys file which is ready to receive the data. The least used files that are on RAM are paged out to pagefile.sys file.
Another role of pagefile.sys file is that is also used for storing information in-case there is a power outage or crash. This is the reason why the data on your PC remains as it is after there is a power cut.
The size of this file is set automatically by Windows but someone who has enough knowledge about these things and knows what he is doing can set the size of this file manually.
The reason why this file is used is that there isn’t enough memory on RAM to store all the files. Generally, PC prioritize using RAM to store data because it is much faster to store and read data from there as compared to your hard drive. However, when the RAM becomes full and there isn’t enough memory available for PC to use then some of the data from RAM is moved or paged to pagefile.sys file on your hard drive.
So come to think of it, this file is actually crucial for optimal Windows operation and if you were to delete this then it would cause issues in the performance!
What happens if I remove pagefile.sys?
As mentioned above, this file is used by your PC to store excess data in case the RAM is full and if you were to delete this file then it would cause performance issues.
If you are trying to delete this file then you should know that when you do so then Windows will have nowhere to put the excess data when the RAM is full and this will result in your PC crashing or the app that you were using because the required data for that app has been removed from the hard drive.
Also, this is a Windows protected file and you can’t delete it normally. You won’t even see this file on your hard drive unless you enable the show hidden operating system files option and on Windows 10, you won’t see it even after you uncheck the Hidden items checkbox because this is a measure to stop you from accidentally deleting this file and causing instability.
If you are trying to clear up space then you can move this file to another drive, not on another partition. If you have both an SSD and HDD then you can move it to HDD to save some space on your SSD. If you have more than enough RAM available and feel like you don’t need virtual memory then you can disable the virtual memory option but there is no point in deleting the pagefile.sys file and causing instability.
The conclusion of all this is that pagefile.sys is a critical file for Windows and deleting it would only cause harm to your PC and no good. After you delete it, you would see your PC acting weird, having difficulty doing the simplest of the tasks. So, treat this as a system file and don’t delete it!