Running XP with the pagefile disabled

I’m thinking of making a server (based on windows server 2003) machine with 2Gb RAM for starters wich I will update to 8 Gb soon. Now, knowing that the memory needs of all software (OS included) will never surpass the amount of RAM I have installed would I have any real benefit from forcing the Windows OS to place all and every memory need in RAM only (aka disable pagefie)?

I’ve read some say that it does indeed make programs respond faster by never allowing them to be put on the pagefile (regardless of available RAM) and keeping them all in RAM, but I also noticed some people claiming that Windows will (by it’s own will?) create a “temporary” pagefile.

Can anyone confirm both (or any of) these claims? Thank you!

Anyway I’m thinking of testing both ways (with and without pagefile) and then come here to post some reality tested results.

Regards to all participants!

I just want to put out into the infoverse that I’ve disabled my swap file on an XP machine with 4GB RAM and…

As per all these arguments about how the swap file only gets allocated things you dont need anyway…one of those things is the START menu and subsequent subfolders. Ever get annoyed how slow it all becomes when you have a lot of programs? Well mine’s as snappy as can be now…

Another example is the multi-tiered options in the right-click menu for files. It used to really lag…

Or load up photoshop while running a backup and work with it seriously for a few hours, then go away for lunch and come back and see how windows has decided its GUI belongs in the swap file but the backup is hogging to many resources now so you can’t continue working until the 12 hour process is done… I hate the swap file!

Anyway, i just started this test today so its early yet though I did have photoshop, after effects, outlook, itunes, IE7 and several firefox tabs open at the same time with no noticeable effect…and task manager claims i still have 2GB free! woohoo…

And for the philosophers: Before I had 1GB with a swap file of 1-2GB which leads to a max of 3GB of virtual RAM. So if everything ran fine with this, surely having 4GB of physical RAM and no swap will be fine too?

So I have 8GB of ram… do I still need the Page file? :wink:

Technically windows should not use paging unless its necessary… with 8GB it should not be! But windows treats 8GB as if it were 8MB and so pages any non-essential code/data when the whole kernel could and should be kept in memory along with all smaller data files.

I guess the best of both worlds is to put the page file on flash similar to how vista works?

Hi All,

I just Disabled swap file and on my laptop which has something like… 2GB of RAM. Well as others I noticed Windows simply puts minimized applications to swap file for no obvious reason when there is more than 1.5 GB of RAM left. Especially when my system is kept idle for some time. Windows follows ‘demo+crazy’ :slight_smile: its crazy and does not care for…
your customized settings. … bla bla…bla… to go wikipedia link for commit_charge information about task bar… it will shed some light.

I will continue using the system this way till I encounter some serious error.
I can confirm at least at the first glance that my pagefile.sys which was 2gb was also deleted.
and windows didnt yet create any Temppf.sys anywhere in my system yet.

If i find one I will report it back here.

Cheers!
Mohnkhan
Mohiuddin Khan Inamdar

Hi,
i am using xp tiny with 1GB of RAM and it always allocate me 931MB of swap no matter pagefile is on or off.
I dont get it and cant even locate that swap!

One reason for turning off the pagefile, which hasn#8217;t been mentioned yet, is for security reasons in relation to file encryption.

When creating a file that is later encrypted (for instance a Word document), Windows and its filesystem will create multiple instances of the file on the hard disk, along with temp files. With an active pagefile, multiple instances will end up in the pagefile too, no matter how much physical memory is installed. If you then encrypt the finished Word document, you#8217;re not really achieving much, because all those instances of the file are recoverable from the hard disk, including inside the pagefile.

Switching off virtual memory solves the #8216;plaintext leakage#8217; problem in relation to the pagefile. The other issues can mostly be solved with judicious use of a RAM disk and some Windows tweaking (the goal is: create plaintext in RAM encrypt in RAM copy encrypted file to hard disk). An alternative is to use a full-disk encryption program such as TrueCrypt. Sorry for going a bit off-topic.

In my experience, turning off virtual memory does improve stability and performance. It was the case when I was running Win98 on a 320mb laptop, and it#8217;s still the case now I#8217;m running WinXP on a 4gb laptop with a couple of 1.5gb VMware virtual machines (with their VM turned off too). I#8217;ve even gone so far as to turn off VMware#8217;s own virtual memory too, in an attempt to cajole my system into keeping as much in RAM as possible, with no major ill effects thus far.

However, everyone#8217;s setup is different, and it all hinges on the software you use and your own usage patterns. My advise is it doesn#8217;t hurt Windows to turn off its virtual memory, so try it and see how you get on. If it improves things, great; if not, simply put it back to how it was before.

As this article says (top of this page) to disable the swap file choose the option “No paging file”. Do not set the page file size to zero as it may not have the result you would expect. For me, after setting the page file to zero the windows task manager still reported a total of virtual memory: 4GB = (2GB Physical + 2GB swap file). After choosing “No page file” the task manager reports 2GB = (2GB Physical + no page file).

– 2 Important reasons for disabling the swap file are:

  1. that MS Windows insist in enlarging disk cache to a point that it forces not recently used “Memory Pages” to be swap out to the swap file. This for a web server that serves numerous large files that are accessed rarely is a problem (you are better off using linux). The same effect can been seen on a workstation when you writing a large DVD, or copying gigabytes of data.

  2. ALSO a MAJOR problem is this:
    when a process start heavy IO, e.g. windows explorer copies gigabytes of data, then the swapped out memory pages of programs take too much time to get back in to the physical RAM because the disk is busy performing other heavy IO. To make things worse the windows keep insisting to trying to get the disk cache as large as possible: the result is that if you leave a window unused for 10-15 seconds it is swapped out (to make room for the disk cache), then you need another 10-15 or more seconds to get the window to reappear (needs to get its memory pages back to the physical RAM).

Suggestion: no swap file, you are OK unless you have an incompatible application (very rare) or a bad application with severe memory leak.

Suggestion: if you do heavy IO and want to keep the swap file, use your old 40-120 GB disk to place the swap file or spent a few money to buy the cheapes harddisk and dedicate it for swap file usage only.
So when you main disk performs heavy IO the secondary disk is free to access the swap file. Also remember to space out your hard disks or they will overheat sooner or later.

If you have 4GB of ram you still lose .75 GB for system reserved space. So, knowing the hard limit for useful application memory is 4GB, if you set your pagefile size to .75GB you have covered the 4GB of addressable space, and you should never run into problems except when applications/os is doing retarded stuff like allocating a massive amount of memory for an app before it needs it.

And to respond to that guys comment above about disk space being cheaper than Memory : Get real buddy. 4GB of RAM is now like $100. There is no reason to be penny pinching here. The performance of virtual memory vs. DDR2 RAM is comical at best.

@A chicken passeth by:

I can’t find that file you’re talking about, the temppf.sys file. If I do, I’ll post back.

I know this is late post but hopefully this helps someone make the leap. I just disabled the paging file on my x64 XP box and I got a HUGE boost in performance of all my applications; most especially my virtual machines. I didn’t even realize it but Windows was paging VM memory to the hard disk despite the fact that I told VM I wanted it all kept in RAM. Nice.

So far I’ve opened every application I normally do (Nero, Outlook (let’s talk about a memory hog), VMWare, Directory Opus, OO Defrag, Skype, TrueCrypt, etc.) and haven’t had an issue. Like I said, they’re all running better than I could have expected.

That being said, I also have 8GB of RAM. I guess that much RAM kind of makes a difference. I built this machine to be as future proof as possible (that’s a laugh, it was obsolete the next day when EVGA released the 790i SLI mainboard SIGH) so I went kind of stupid-overboard on everything including the RAM. I’ve never tried running without a page file on anything smaller than 4GB. I have an old laptop with a gigabyte of memory; I think I might try it and see what happens.

Cheers to all posters, thanks for all the tips and information and . . . happy no-paging!

Very interesting post.
I have always known or thought that working XP SP2 with no pagefile would ultimately alter XP and prevent it from booting requiring a new install?
It does not seem to be valid at all.
Can someone confirm that disabling the pagefile is

  1. SAFE
  2. will preserve XP integrity
  3. is not likely to end up having to reinstall XP.

Thanks very much
Ghiom

And some other questions:
(I have 2Gb of RAM)
If I disable the pagefile and encounter a memory leak (using Fligtsim for example, eg it happens sometimes), what will happen?

No if I have a windows crash (normally, I have the blue screen, memory dump, and reboot). What will happen in case of absence of pagefile?

Thanks
Ghiom

@Ghiom:

I’ve been running XP with no paging file almost a month now and have not experienced any issue whatsoever. I run everything I was able to before and every program runs better than I could have wanted. I can confirm that you’re question 2 and 3 above are true: turning off the paging file does not affect the integrity of XP (or Vista for that matter) and you won’t have to reinstall the OS if you do. Its a simple procedure to turn it off and its simple to turn it back on if you do experience behaviour that is less than desirable.

Number 1, however, is a matter of perspective. It’s safe in that turning off the paging file will not affect Windows unless you have a small amount of RAM. I would NOT recommend disabling the page file for systems with less than 2 GB RAM. I’ve disabled the page file on systems with only 1 GB of RAM and my experience was not good in that scenario. The OS itself requires about a GB to function properly. Running programs with no page file on a system with only 1 GB of RAM was virtually impossible (no pun intended). If you have a system with less than 1 GB of RAM: DO NOT DISABLE THE PAGE FILE. If you do, you’re likely to not be able to boot windows normally and will have to go into Safe Mode to restore the paging file operation depending on what’s running on the system. You will not, however, have to reinstall the OS.

All that being said, software behavior is a different story. Memory leaks with no paging file are likely to cause application crashes as your physical RAM would be filled to capacity (but I would note that such crashes may also occur WITH a paging file depending on how bad the leak is and whether or not Windows decides the application is detriment to the system). This usually doesn’t crash the OS, however, only the application with the leak. Since I disabled the paging on my system, I’ve created situations where I had too much open on my machine and filled my physical RAM up (this was to stress my box and see where the limit was). Windows simply would not load any additional programs and the memory hog eventually crashed back to the desktop when there was no more memory for it to eat up. Windows continued to run and I was able to launch the offending application again without problems.

Point is, it’s safe as long as you keep it safe. As a guide I would recommend getting software to monitor your memory usage for a day or so (you can even use task manager if you want). Check to make sure that you’re not using more than what you physically have in your box during a normal day. If you continually see a commit memory usage of more than what you physically have; this would be a good indication that working without a paging file isn’t going to be best for your system based on your current behaviour. For example, if you have 2 GB of RAM installed and continually see a commit usage of 4 GB, chances are turning off your paging file is going to prevent some programs from loading and might even destabilize the system depending on what you have running in the background. If, however, you’re seeing the system use 4 GB of RAM when Outlook, Word, Excel, 3ds, Acrobat, AfterEffects, DreamWeaver, SoundBooth, and Premier are open . . . you might be able to get away with not using the page file if you can modify your use behaviour to only use certain of those programs at a time; i.e., work smarter not harder and all that. This latter would require you to be very conscious of your activities on your machine and be aware of what programs are open and running at any given time.

Hope this helps.

P

How about a page partition instead of a pagefile? It is faster as the OS does not need to translate the read/write to the files into a the acutal read/write to the raw sectors. We are writing to a partition and not a file in a file system on the partition. No abstraction means a faster read/write and better pagefile performance.

what about mounting a 1gb RAMdrive (for 4gb machines) and putting the pagefile there?

i have very old pc, 448 RAM, and it says my page file usage was over 640 ! It never happen before, so can everyone plse tell me how to make my com fast again? I have already cleared my IE history, Mozilla history, mu processes doesnt go above 40. I don’t want an opinion ‘you have to buy a big RAM memory’, because i’m pennilless and could’nt afford them like you guys who have 2G, 4G, and 8G of RAM.

Its totally safe to run windows xp without a paging file, i know because, even back in windows 2000 i wasnt using it either. When i install windows on one of my computer, thats one of the 1st mod i do - no paging file - no annoying access to my hard drives ever. never had ANY issues in 4 years +.

GB

oh yeah, i forgot to say i have 2gb of OCZ dual Channel RAM. Ram is way faster than any virtual memory windows might create on an hard drive. Windows cannot crash because you have no paging file. Even if the code of a bad software require access to it, the ram will sort it out. As long as you have MORE Ram than everything that need to be loaded when windows start, you can see that in the task manager - under performance - but with 2gb, my advice to anyone is to turn off the virtual memory.

Even when i do code with C++ i don’t use the page file, even when i play very demanding video games like bf1942 and recent video games. Just try and see for yourself.

[…] because Windows will move pages from RAM to the pagefile only when necessary.

Sorry, that’s 100% pure bullshit. While this was true in the good old times (with NT4, for example), modern operating systems (and this includes XP) use precleaning. Precleaning is a strategy where the OS writes dirty pages to the pagefile even if there is plenty of free RAM. These pages are then kept in RAM and the pagefile simultaneously. If the application needs them, fine, they are still in RAM. If memory usage suddenly increases and the system needs virtual memory (like when a huge application gets started), the precleaned pages are already in the swapfile and the system doesn’t have to wait until they are swapped out. Looks like a win-win situation, right?

Actually, not quite. Since some pages get dirty all the time (for example, by an application which just displays the current time…), precleaning happens all the time as well. The disk with the pagefile is therefore accessed frequently. For a mobile computer (laptop or whatever runs on batteries), this means increased battery drain. For an office PC, this means increased an noise level because the disk never spins down, even when the machine is not in use.

Furthermore, you gain no performance improvement by turning off the pagefile.

Oops, bullshit again! Agreed, the additional I/O load which is caused by precleaning is quite low and usually doesn’t hamper the system performance very much (unless you consider battery power consumption as a part of system performance). However, real life seems not to agree with the bright and happy theory. File caching, for example, uses RAM and may use precleaned pages if they are available. Well, bad luck for any precleaned page which gets claimed for such a purpose but needs to be in memory just a few milliseconds later…and such things happen because the OS can not really guess where the user will click next, and which page will then be needed. Well-meant caching strategies can in these cases kill the system’s performance. With virtual memory disabled, caching will be decreased when free RAM decreases.

Now, what is better: less caching or more virtual memory? Your mileage may vary, but my experience (and that of quite a number of other people as well) shows that DISABLING vortual memory on boyes with 4GB is beneficial. Not only with XP. On a 4GB Server 2003 TS for example, the difference is dramatic: without VM, Eclipse works smootly, with VM, Eclipse often requires several seconds (!) to process a single mouse click!

Best regards, Klaus

Thanks for these inputs.
I remember reading somewhere that someone had to install XP again after disabling the pagefile. Initially, everything was fine, actually even better than WITH the page file. It lasted for some time and eventually, at some point, XP would load and start again. Had to reinstall.
I don’t want this to happen as it would be a nightmare to reinstall everything.
I have 2Gb of RAM and mostly playing Flight Simulator.

Ghiom

I deleted the pagefile lol, my system [amd 3000+ 1gb ram] was burning on gas, football manager 2008 wasnt hanging anymore, great stuff, until I got ‘delayed write fail’ c:$mft, had to buy a new HD. is it a good idea to have a pagefile on each partition, or just the root c:\

all the best