Disable pagefile in Windows

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
User avatar
BMW
Member
Member
Posts: 286
Joined: Mon Nov 05, 2012 8:31 pm
Location: New Zealand

Disable pagefile in Windows

Post by BMW »

I have a laptop with 2GB RAM, running Windows XP.

I disabled the pagefile, and I reckon it runs significantly better. I have on average 1.3GB of spare ram.

I have seen a few articles which suggest that you shouldn't disable the pagefile even if you have heaps of RAM. Is this a valid suggestion? Why?

Should I keep it disabled, provided I don't do any memory hogging activities such as video editing? (I play some games which use max 500MB of ram).
Currently developing Lithium OS (LiOS).

Recursive paging saves lives.
"I want to change the world, but they won't give me the source code."
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: Disable pagefile in Windows

Post by thepowersgang »

Disabling the pagefile on windows is a bad idea, as it reduces the memory management tricks windows can do. According to an article someone linked here a few days ago (might look for it later), Windows will write lesser-used pages to disk but keep them in memory, allowing it to do a quick eviction if that memory is needed for some other task (which might be as extra disk cache, which is quite useful when doing IO).

Removing the pagefile also means that if a process starts chewing memory, you don't have the pagefile buffer before the system runs out of memory, and either BSODs, kills some unlucky process to free up memory, or hard locks (without the task manager being accessible, because there's no memory for it)
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
User avatar
JackScott
Member
Member
Posts: 1031
Joined: Thu Dec 21, 2006 3:03 am
Location: Hobart, Australia
Contact:

Re: Disable pagefile in Windows

Post by JackScott »

I do disable the pagefile on some systems with SSDs. I'm unsure of how relevant this with the new SSDs coming out now, but with older ones it was better to disable swaps and pagefiles so that you didn't burn out the limited writes on SSDs. Somebody with more knowledge in that area might be able to update us on how relevant that is to today's hardware.

Disabling swap is also a great way to free up a few gigs of space on a small SSD... helpful if you've only got a 60GB SSD.
User avatar
iansjack
Member
Member
Posts: 4683
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Disable pagefile in Windows

Post by iansjack »

"Reckon" is not a good way of determining computer performance. You think that diabling the swap file is going to improve performance, so that is what you see; the truth may be far from that. To measure performance you need to measure, not guess.

Personally, I wouldn't disable swap. It means that when Windows reserves in advance memory that it may or may not later use it has to reserve that space in RAM rather than on the swap file. The result is less RAM available for other purposes (such as disk caching), which means poorer performance and increased risk of a system crash.

If you want to improve performance add more RAM and/or a SSD.
User avatar
BMW
Member
Member
Posts: 286
Joined: Mon Nov 05, 2012 8:31 pm
Location: New Zealand

Re: Disable pagefile in Windows

Post by BMW »

iansjack wrote:"Reckon" is not a good way of determining computer performance. You think that diabling the swap file is going to improve performance, so that is what you see; the truth may be far from that. To measure performance you need to measure, not guess.

Personally, I wouldn't disable swap. It means that when Windows reserves in advance memory that it may or may not later use it has to reserve that space in RAM rather than on the swap file. The result is less RAM available for other purposes (such as disk caching), which means poorer performance and increased risk of a system crash.

If you want to improve performance add more RAM and/or a SSD.
Fair comment about measuring performance.

Everyone seems to say this; Less RAM for other purposes because it is reserving memory in the RAM rather than the pagefile. However when on average I have 1.3GB of unused RAM, I don't see this as a problem. I don't think I have ever seen it below 0.8GB

Also it would help to increase hard disk life.

Another thing that confuses me is this:
Some people with lots of RAM create a "Ram disk" (simply a chunk of RAM reserved for file storage), and put the pagefile on the RAM disk. I don't see the point in this, they may as well disable paging!!!!

EDIT: Why doesn't someone make a computer with 2 RAMs... one for swap area and one for the RAM? But then the argument above applies... use it all for RAM.

EDIT#2: Imagine if you had 2 rooms to store stuff in. You put the stuff into a main room, but move some of it to another room (this sounds like swapping...) when it gets full. You might as well get a bigger room and not have to shift stuff!
Currently developing Lithium OS (LiOS).

Recursive paging saves lives.
"I want to change the world, but they won't give me the source code."
User avatar
iansjack
Member
Member
Posts: 4683
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Disable pagefile in Windows

Post by iansjack »

What you are really asking is "can I manually manage memory better than Windows, with all its knowledge of what is happening at any instant, can?". I'm not sure about XP but when it comes to 7 and 8, which have fairly sophisticated memory management, I would say the answer is "No". You are looking for a solution that will apply under all conditions; Windows adjusts its solution constantly to meet current demands and resource availability.
User avatar
BMW
Member
Member
Posts: 286
Joined: Mon Nov 05, 2012 8:31 pm
Location: New Zealand

Re: Disable pagefile in Windows

Post by BMW »

iansjack wrote:What you are really asking is "can I manually manage memory better than Windows, with all its knowledge of what is happening at any instant, can?". I'm not sure about XP but when it comes to 7 and 8, which have fairly sophisticated memory management, I would say the answer is "No". You are looking for a solution that will apply under all conditions; Windows adjusts its solution constantly to meet current demands and resource availability.
Ok, nice way to put it. I think I'll re-enable swapping.
Currently developing Lithium OS (LiOS).

Recursive paging saves lives.
"I want to change the world, but they won't give me the source code."
Post Reply