Jump to content

What is PageFile.sys? And how do I delete it?

Go to solution Solved by LogicalDrm,

-> Moved to Windows

***

 

As said, don't delete it completely. You can make it much smaller, like max 8gigs or less. You know if its big enough when you start getting crashes that have no other reason. For example Adobe products use pagefile.

 

Also, Windows doesn't care where its located. If you have HDD, you can move whole pagefile onto that.

So, I am a Windows user and I have 16 GB RAM and a 240 GB (256 GiB) SSD as my boot drive. However, PageFile.sys takes up 20 GB of my storage, which I don't want considering I want to dual boot Linux too (and want that space). 
 

Also, considering it's "Virtual Memory", why does it keep piling up instead of deleting regularly?


image.thumb.png.37701ef8105aa23074fe7e796fb3a1b3.png
 

Link to comment
Share on other sites

Link to post
Share on other sites

If your computer runs out of memory, windows will put some of the data you got in RAM in the page file. So it's like "backup RAM", but since it's on your drive it's way slower. 

How large the page file is depends on how much RAM you got. By default it's around 1.5 times your RAM. 

 

Since your SSD is pretty small I'd recommend you lower the size of your page file a bit. My guess is that you don't need it that much and can safely go down to maybe 10GB.

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, whispous said:

pagefile.sys is...

 

your pagefile.

 

https://www.howtogeek.com/126430/htg-explains-what-is-the-windows-page-file-and-should-you-disable-it/

The size of it is normal and intended.

That said my page file is typically 0

 

I think turning off hibernation will at least reduce it by a lot?

 

20211009_122338.thumb.jpg.bd37f8f1176fe8b256df05686bc89208.jpg

 

"Page file usage 0%"

 

Ps: i think pagefile.sys might be something else... likely for hibernation? Anyways 20GB strikes me as very weird. 

 

Edit: see below, my pagefile.sys pretty much lines up with what windows has set automatically in "virtual memory", around ~2.5GB 🤔

 

 

 

The direction tells you... the direction

-Scott Manley, 2021

 

Softwares used:

Corsair Link (Anime Edition) 

MSI Afterburner 

OpenRGB

Lively Wallpaper 

OBS Studio

Shutter Encoder

Avidemux

FSResizer

Audacity 

VLC

WMP

GIMP

HWiNFO64

Paint

3D Paint

GitHub Desktop 

Superposition 

Prime95

Aida64

GPUZ

CPUZ

Generic Logviewer

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Like the others said, it's page file, swap... if your memory is full or nearly full by some applications and you launch an application or a game that needs more ram than it's free in the actual ram, Windows can take the data of applications that are in background or accessed a longer time ago and dumps that data in the page file, making room for your new application/game.

When you alt-tab / go back to that previous application, the operating system will read the data of that application from the page file and put it back in ram.

 

You can configure if you want a page file on a particular drive, and if so if you want a fixed page file or one that changes size as needed.

In Windows 7 , you can hit winkey + pause/break  (or go control panel  > system ) and there you have Advanced settings. I think there's a similar link in Windows 10, if you hit Windows key + Pause/Break on the right side of that window, but I'm not sure, this laptop I type on now has Windows 7.

So there's gonna be something like this :

image.png.80d24233ecdbf10c298c801b46a2c4b1.png

 

You can select Change... and there you can let windows manage page files or you can manually manage them.

It's not a good idea to disable them completely, at the very least leave at least 512 MB - 1 GB

 

On this laptop I currently have it set on page file on the SSD, minimum 4 GB, allowed to extend up to 12 GB. The laptop has 16 GB of memory.

There's a second page file on the mechanical drive which I left system managed, because it's practically extremely rare it's gonna be used (if something uses more than 30 GB of ram on this old laptop...) so I don't have to worry about it.

 

In your case I would suggest setting the page file to fixed and at 4 or 8 GB on the SSD  (set min and max size to same value , 4096 MB or 8192 MB) and add a second page file on your mechanical drive for around 50-100% of your actual ram amount.

 

On mechanical drives, it's best to set the page file to fixed size (by setting min and max the same value) because then you can use a defragmenting tool (like O&O Defrag for example) to move the page file to the start of the drive to have the lowest seek times inside the page file.

 

One more note : On a SSD, you should ALWAYS have at least 5% of free disk space, or in your case around 5-10 GB of free space.  With very low amount of free space, you'll accelerate the wear of the flash memory cells because the SSD controller will have a harder time finding blocks of flash memory that can be erased to write new data in them, so it will make less optimal choices and will wear out some blocks faster.

 

 

 

image.png.13200e27b76ea734628d672dd5dbb586.png

Link to comment
Share on other sites

Link to post
Share on other sites

Hybernation is something different. and it's separate file hyberfil.sys or something like that.

Basically, it's when you press power button once or hit stand-by or close lid on the laptop ... operating system shuts down hard drives, puts video card and other devices in power saving mode, puts cpu to minimal power and only keeps the ram energized to keep data fresh.

Some go further and a few seconds after going to stand-by / sleep or even right away the contents of the ram is dumped to drive so that the ram can also be powered off and save a few watts of power.

Link to comment
Share on other sites

Link to post
Share on other sites

37 minutes ago, mariushm said:

One more note : On a SSD, you should ALWAYS have at least 5% of free disk space, or in your case around 5-10 GB of free space.  With very low amount of free space, you'll accelerate the wear of the flash memory cells because the SSD controller will have a harder time finding blocks of flash memory that can be erased to write new data in them, so it will make less optimal choices and will wear out some blocks faster.

 

I do have 50% of the drive free for now, and always intend to keep atleast 25-35% free.
Thanks for the heads up, tho!

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, mariushm said:

Hybernation is something different. and it's separate file hyberfil.sys or something like that.

Basically, it's when you press power button once or hit stand-by or close lid on the laptop ... operating system shuts down hard drives, puts video card and other devices in power saving mode, puts cpu to minimal power and only keeps the ram energized to keep data fresh.

Some go further and a few seconds after going to stand-by / sleep or even right away the contents of the ram is dumped to drive so that the ram can also be powered off and save a few watts of power.

Yup, I thought its that but seems a different file, however,  why is my page file only ~2900mb "recommended" (see screen shot), hence 20GB seems huge 

The direction tells you... the direction

-Scott Manley, 2021

 

Softwares used:

Corsair Link (Anime Edition) 

MSI Afterburner 

OpenRGB

Lively Wallpaper 

OBS Studio

Shutter Encoder

Avidemux

FSResizer

Audacity 

VLC

WMP

GIMP

HWiNFO64

Paint

3D Paint

GitHub Desktop 

Superposition 

Prime95

Aida64

GPUZ

CPUZ

Generic Logviewer

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

53 minutes ago, mariushm said:

In Windows 7

Ah, in win 10 you have to set it to show protected system files...

 

20211009_132504.thumb.jpg.73c3bd7b2c026575447af2c42b8808c0.jpg

 

2.37GB.. so again 20GB for OP seems a lot?

 

(And my page file is set to "automatic ")

 

The direction tells you... the direction

-Scott Manley, 2021

 

Softwares used:

Corsair Link (Anime Edition) 

MSI Afterburner 

OpenRGB

Lively Wallpaper 

OBS Studio

Shutter Encoder

Avidemux

FSResizer

Audacity 

VLC

WMP

GIMP

HWiNFO64

Paint

3D Paint

GitHub Desktop 

Superposition 

Prime95

Aida64

GPUZ

CPUZ

Generic Logviewer

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

-> Moved to Windows

***

 

As said, don't delete it completely. You can make it much smaller, like max 8gigs or less. You know if its big enough when you start getting crashes that have no other reason. For example Adobe products use pagefile.

 

Also, Windows doesn't care where its located. If you have HDD, you can move whole pagefile onto that.

^^^^ That's my post ^^^^
<-- This is me --- That's your scrollbar -->
vvvv Who's there? vvvv

Link to comment
Share on other sites

Link to post
Share on other sites

23 minutes ago, LogicalDrm said:

-> Moved to Windows

***

 

As said, don't delete it completely. You can make it much smaller, like max 8gigs or less. You know if its big enough when you start getting crashes that have no other reason. For example Adobe products use pagefile.

 

Also, Windows doesn't care where its located. If you have HDD, you can move whole pagefile onto that.

WAIT WHAT?! I'm moving it to D: then? How do I?
image.png.3967e39c73a49b076e4f1936cd698346.png
Edit: Is this it? 

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, AvMaverick said:

WAIT WHAT?! I'm moving it to D: then? How do I?
image.png.3967e39c73a49b076e4f1936cd698346.png
Edit: Is this it? 

Yup, just like that. Now only time when things might go wrond is if HDD is not recognized on startup. Has happened to me like once, and now I have 256mb spare on SSD to counter that.

^^^^ That's my post ^^^^
<-- This is me --- That's your scrollbar -->
vvvv Who's there? vvvv

Link to comment
Share on other sites

Link to post
Share on other sites

48 minutes ago, LogicalDrm said:

Yup, just like that. Now only time when things might go wrond is if HDD is not recognized on startup. Has happened to me like once, and now I have 256mb spare on SSD to counter that.

It's a laptop, so that's not an issue. But thanks for the heads up and the help!

Link to comment
Share on other sites

Link to post
Share on other sites

The recommended value is based on some statistics it gathered over time about how much data had to be put in page file.

You have 16 GB of ram.

Some of that will be used by drivers, a very small part.

A lot of it will be used by applications.

Windows will automatically use free ram to cache files and stuff to accelerate things.

For example think of it like when your music player starts playing a song read from your hard drive, Windows will see file being opened and player reading 64-256 KB chunks of it in sequence so it may go ahead and read the whole 5-10 MB in one shot and then serve it to the music player from ram.. so for example, your laptop could put the SSD or mechanical drive to sleep if there's no other applications accessing it, and your music player will keep playing.

But, this ram cached data is treated as "can be thrown away" and if all ram is full and an application needs ram, Windows will delete this cached stuff before trying to move ram data used by actual applications to page file.

 

As for the page file, if it's set to auto Windows tends to go for "fast", not "thorough" ... if something has to be written to page file quickly to make room for some other application, Windows probably won't search for an empty space big enough to store the stuff, in that big page file.. it would take too much time. So it will simply enlarge the page file each time and append the stuff that has to be dumped to the end of the page file. When you restart Windows or once in a while, it will reset the page file to that minimum size.

pagefile that can resize is kinda bad on mechanical drives because the pagefile will not be continuous, every time it has to resize, the file system will give the page file a random block of continuous free space, so your page file could be spread all over the disk platters.

 

If you set the minimum and maximum to same size you make the pagefile fixed so Windows knows exactly what percentage of the page file is empty, what's the longest free space, and so on... if it's fixed Windows also doesn't have to constantly erase and re-create the pagefile, doesn't have to shrink it and so on.

 

I suggest leaving a small page file on your SSD...already suggested 4 GB as a good size, 4096 MB.

Add a second pagefile on your mechanical drive and set a bigger size, if you have free space. Most likely it will rarely be used, you don't seem to use this pagefile often.

 

Link to comment
Share on other sites

Link to post
Share on other sites

Pagefile is also used to perform open space defragmentation of you RAM.

 

Programs/Games in RAM, once there, cannot be moved nor can it be split to fit. Everything is in 1 block. So, if you have many programs open, and through your session you've closed many of them and open more, what may happen is that you have small block of free RAM between processes. This lead you to a situation where while in total you have enough RAM to load a program, the program you want to load might not fit in any available empty slots. So it won't run.

 

Pagefile allows the OS (whatever it is, it all works pretty much the same) to move processes back to disk and return back to RAM but at another location, to act as a defragmentation process on free space, so that your free space is all together and avoid the issue mentioned.

 

So all to say, you can shrink it a bit, if you want, but don't disable it.

 

 

As for hibernation, as stated it is a different thing. Keep in mind disabling it, will also disable Fast Startup feature of Windows.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×