Who ate my space? Hibernate mode (hiberfil.sys) and virtual memory (Pagefile.Sys)

1 29
Avatar for dansontela
2 years ago

Every time I reinstall the computer, I will encounter various problems. After reinstalling the NUC system this time, I have not installed any software yet. I found that the space on the C drive has taken up almost half of the space. So exaggerated?

Check the properties of the C drive and find that the C drive occupies about 67G of space:

Looking at the properties of the files in the root directory of the C drive, I found that all the folders occupy a total of about 28G of space:

With such a calculation, a full 39G of space was lost, which is not a small amount? Who is eating my 39G space?

find the culprit

In the root directory of the C drive, after selecting the hidden files (Hidden Items) in the view option in the file manager, it is found that there are more in the root directory. $WinREAgentas well as ProgramDataTwo hidden directories, but check them out, but they occupy hundreds of M space, obviously not the culprit.

In the file manager's Options ( View->Options->View) Hide protected operating system files (recommended)

After picking it, a prompt will pop up (select Yesjust fine):

choose ApplyAfter that, go back to the root directory of the C drive, and you will find several hidden files:

In particular, hiberfil.sys and pagefile.sys occupy the 26.6Gas well as 9.9GSpace, this is simply an unforgivable sin! Now let's eliminate them separately.

turn off hibernate

When it comes to hiberfil.sys, it is necessary to mention several modes of Windows shutdown. The most commonly used shutdown (Shut down) and restart (Restart) should not say much.

In addition, there is also a commonly used sleep mode, which will turn off all devices except the memory, so the computer will have extremely low consumption, and when it wakes up, it will instantly return to full blood working state (what does it look like when you sleep, when you wake up? What will happen after that).

In addition, there is a hibernate (Hibernate) mode, if this mode is selected, then the system will transfer all the data in the memory to the hard disk, and then turn off all devices. When starting, the system will restore the data in the hard disk to the memory, and then enter the working state of full blood.

At first glance, it seems that the sleep mode has more advantages, such as no power consumption at all, and for example, it is not afraid of power failure in the middle. But the disadvantage is also obvious, to add a process of dumping the memory to the hard disk and reading data from the hard disk to the memory. Not to mention occupying disk space, SSD always writes dozens of G and dozens of G, which is distressing.

So I think on desktop systems, it's better to disable Hibernate completely! The steps to disable hibernation are as follows:

Type in the search box near the start menu cmd, and then right-click on the resulting command prompt (command Prompt) program and select Run as administrator:

Enter the following command and press Enter:

powercfg -h off

Go back to the root directory of the C drive, and you will be surprised to find that the hiberfil.sys file is gone, and suddenly there is an extra 26.6G of space. (The specific space occupied by hiberfil.sys is related to the installed memory. The larger the memory, the larger the hiberfil.sys file).

Of course, if you have special needs (I don't think there will be such needs), you can also use the same steps to enable Hibernate:

powercfg -h on

close virtual memory

Everyone knows a little bit about virtual memory. To put it bluntly, the memory is not large enough, and then allocate a space on the disk and use it as memory when necessary, so that the memory becomes larger.

However, the problem now is that my memory is large enough (64G), and I can't imagine any program that can eat so much memory for the time being. (My big computer has 128G memory)

So I decided to turn off the virtual memory of Windows completely. The way to turn off is as follows:

exist Setting->AboutSelect Advanced System Setting to enter the following page:

choose Setting->Advanced:

Under the virtual memory (Virtual Memory) column, we can see that the virtual memory now occupies 9728M space, and it is a big space eater.

choose Change..., we found that now Windows itself manages it:

pick out Automatically manage paging file size for all drives:

Now we can manage virtual memory by ourselves, and then set the C drive as No paging file, which results in a warning ⚠:

The general idea is to disable or set a page file smaller than 800M. When a system error occurs, Windows may not be able to record the details that help to find the problem. Hey, let's talk about it when there is a problem, in fact, even if it is recorded, I can't understand it.

However, unlike turning off hibernation, after we complete the virtual memory settings, pagefile.sys will be deleted after restarting, but it doesn't matter.

in conclusion

The hibernation mechanism and virtual memory mechanism of Windows resulted in the generation of two large files (hiberfil.sys & Pagefile.Sys). According to the actual situation of my computer and my personal preference, I chose to turn off the hibernation function and virtual memory, and then searched for Back nearly 40G of disk space.

Friends can set it according to their own situation, but I declare in advance that the above content is for reference only, if you smoke your computer, I will not be responsible.

3
$ 0.03
$ 0.02 from @CoinBitShac
$ 0.01 from @Captainkay
Avatar for dansontela
2 years ago

Comments

Wow this was so educating, I felt you were right beside me performing this task..

$ 0.00
2 years ago