A strange way to dramatically speed up Windows XP
September 8th, 2007
Summary: ‘resetting’ the XP swap file causes a dramatic increase in performance.
Notes
- This hack seems so stupid, and implausible that I don’t blame you for being sceptical. I suggest you TRY it OUT, and see the results for yourself. Believe me, it works, and the results are quite amazing, especially on low ram PC’s
- This hack works best on PC’s with under 1GB ram (In my case, I tried it on a PC with 512MB) - if your PC has 2GB or more it probably won’t make much difference.
- Update: someone commented that you can defragment the swap file also, via pagedefrag - I don’t think the problem is in fragmentation of the swap file but rather the simple fact that, over a few months of use, XP develops an unnatural reliance on the swap file, and tries to use it more than physical memory - by zapping the file, XP starts over again, and is much more faster. Again, I know this all sounds rather absurd, but it actually works.
- If you try this out, let me know!
Long boring preamble
Have you ever noticed how fast your PC is after a fresh OS/Software install? How the OS seems crisp and fast, and applications load up almost instantly?
And how… after a few months of use, your PC seems to slow down to a crawl? How even booting up seems to take forever, how launching the simplest applications causes your PC to struggle? Well I’ve always wondered what causes this ‘Windows Rot” phenomenon (aside from poor programming at M$).
What I used to do earlier, was reinstall everything on my PC every few months.
Eventually (due to product activation requirements) this became a hassle, so I now keep a backup mirror and restore it every once in a way. Still, this is a hassle, because I have to re-install any new software I was using, also restore various system settings.
Today, I was wondering to myself, does the swap file have anything to do with this problem - after all, the hard disk light starts staying on when the PC slows down - which seem’s to indicate swap file use.
So, I decided to try deleting the swap file. The beast way to do this was by setting it to a small size - e.g. 2MB, restarting the PC, and setting it back to the original size.
Here’s the procedure (simplified somewhat):
(this procedure refers to XP but you can follow similar methods in other windows versions, also, don’t attempt to drastically reduce swap file space, even temporarily, on machines with under 512MB ram)
Caution: don’t mess with your swap file unless you know what you are doing!
- Right click my computer, select properties
- Click the ‘Advanced’ tab
- Under performance, click Settings
- Click the ‘Advanced’ tab
- Click ‘change’ under Virtual memory
- Make a note of the existing swap file(s)
- Set the current swap file to a very small size (e.g. 2mb)
- Restart the PC, and resize the swap file
back to its original sizeInitial Size equal to the 1.5 to 2.0 times your physical RAM (from a comment below!) - Restart the PC once more
Results:
The results were dramatic and surprising. I think I can confirm that (for XP, on a PC with under 1GB ram) this procedure returns your PC to (almost) the original post software install stage.
Does this sound crazy? Don’t believe me? Just try it RIGHT now, and I bet you will notice a significant speed difference in your PC.
It’s just magical: applications which struggled to load earlier now load up rapidly, just as they used to when the XP installation was fresh. Everything just works faster - even simple tasks like switching between windows!
So why does this work? I’m not sure but I speculate it has something to do with the way Windows uses the swap file.
Try this and let me know what happens (post a comment here)
Entry Filed under: Hacks, Microsoft, OS
17 Comments Add your own
1. Mike De Wolfe | September 8th, 2007 at 9:28 am
Another way for XP users to speed up their PC with mnimal hasle and cost is to switch ti Ubuntu (or another quality distro).
2. | September 8th, 2007 at 9:41 am
Yeah, not so much for me…
Not sure why it worked for you, but I saw no noticeable change at all.
And just to clarify, I’m running XP Pro with 2 gigs of RAM, and a 512mb graphics card on a Pentium 4 HT processor, so that might have something to do with it.
Not the greatest set up in the world, but definitely above average compared to most people I know.
Although, I also haven’t reinstalled my OS since I built the computer almost 4 years ago. Have far too much software on the machine to even bother.
I do however take great care of it.
In general it takes about 20 seconds from start up to my desktop, from selecting the OS of choice(XP or Vista on a separate SATA drive) from my boot screen.
I guess it could be worse.
Still, I do remember how fast everything was when I first built it.
I miss those days….
Thanks for the tip though, it was worth a try.
3. Anonymous | September 8th, 2007 at 10:25 am
You might have been using a dynamic swap-file before. The best thing to do is create a small swap file as you did, reboot, defragment your hard drive to get a large contiguous space, then re-create a large swap-file of Custom Size, setting the Initial Size equal to the Maximum Size. 1.5 to 2.0 times your physical RAM seems to work the best, and with storage very cheap nowadays, this is pretty reasonable to do. This creates a “permanent” swap-file and saves on much of disk-thrashing that the Virtual Memory manager performs on a much less optimal setting.
Ans: I was using a static swap file. Thanks for the note on recommend size setting, I have updated the post
4. | September 8th, 2007 at 4:14 pm
There’s always a Linux troll that finds these sorts of discussions. They have some sort of mental block that prevents them from understanding that some people like Windows and use programs not available on Linux.
5. Josh | September 9th, 2007 at 5:19 pm
If the initial size is set to 1.5x the physical RAM, what should one set the maximum size to?
6. Dave | September 10th, 2007 at 9:10 am
Wow, what a difference that made! Thanks for the tip, it made my work PC bearable to use again.
7. Anonymous | September 10th, 2007 at 3:53 pm
@Josh: Set the Initial and Maximum size to be equal (and 1.5x to 2.0x physical RAM — as much as you can allocate). Having a dynamically-sized swap file is a holdover from the days when disk space was not as plentiful as it is today. Setting a fixed-size swap file (Initial size = Maximum size) also reduces disk thrashing and file system fragmentation from resizing the swap file, also improving performance. And as stated above, these tips are less effective the more physical RAM you have on your system.
8. Anonymous | September 10th, 2007 at 4:33 pm
The comment about defragging was also misunderstood… Here is the swap file optimization process in a nutshell:
1. Set swap file size to smallest possible.
2. Defragment your HARD DRIVE to get maximum contiguous space for your new swap file. You can use any defragger of your choice, NOT pagedefrag.
3. Set NEW swap file that is BOTH: 1.5-2.0x physical memory AND where Initial Size is EQUAL to Max Size. A swap file where Initial = Max is what is meant by ’static swap file’.
4. Profit!
9. Stu | September 10th, 2007 at 8:01 pm
Here is what I do -
Have a swap file with a fixed size on a seperate partition just for said swap file.
Also, that partition is fat, not ntfs so hopefully a little faster.
10. Doug | September 10th, 2007 at 9:45 pm
Linux trollers give real Linux users a bad name.
I love Linux. I think it works good, and is in many ways superior to Windows. And yet, I run Windows most of the time. Why?
Simple. Everything runs on Windows. Without Windows, I couldn’t listen to my music (I use iTunes and an iPod, that I know would sort of work on Linux, but you can’t use iTunes at all), I couldn’t play most of my games, I couldn’t use my favorite programming tools…Sure, I could try and switch to Linux versions, but why? I like what I’ve got.
I guess you could call me a practical Linux nut.
Linux is still not a “user-stable” operating system like Windows is, although it’s making leaps and bounds all the time. But, the catch-22 of Linux and Windows is that everything runs on Windows, so everyone runs Windows. In order to get things to run on Linux, more people will need to want to use Linux. But they don’t because everything runs on Windows.
11. RiZZ | September 11th, 2007 at 6:14 am
wow i would of never guessed it.
worked like magical. on my worst windows box (running the same install of windows sence day one of XP) i can now open outlook in 10 seconds when it took 20 mins before.
12. Nas | September 15th, 2007 at 12:01 am
Great tip - have noticed some improvement. This is way easier than trashing and starting again.
Using 512MB RAM on a Pentium 4.
Bootup is faster.
Office products start and close faster.
Even Firefox seems faster.
Think I’ll add a reminder in my calendar to do this again every few months.
13. DRACUL | October 6th, 2007 at 5:56 pm
It ’s good Tip & Trick, Whatever it’s helping My PC run faster and
Safe , I like it !
It’s work great on my computer !
Thanks
14. dice | November 4th, 2007 at 1:24 pm
this worked for me and cut the time down for startup by two-thirds! I have 2gbs of memory but strangely enough the page file was on 2mb. I clicked ’system managed’, it allocated 4096mb and it fired right up. I get approximately 15 phases of the Windows bar screen and then after it it went right to my login and fired up all the icons where it was always delayed while the startup stuff loaded, like AVG, yahoo music, my printer..etc.
Thanks for tip. That’s a good one and I’m applying it to all my machines.
15. Blade Conway | December 3rd, 2007 at 11:29 am
Windows is not a “stable” operating system in any sense. But thanks for the belly laugh….
As one of the original posters mentioned, you won’t have to jump through this kind of hilarious hoop if you use a more sophisticated , well-designed operating system. Also, with an OS like Linux, you have access to the source if need be, to investigate any anomalous behavior.
16. Zak. | January 8th, 2008 at 6:30 pm
Wow I can’t believe how much this has helped my computer
17. Me | May 18th, 2008 at 4:37 am
So far so good, definitely a major improvement when coming
out of stand by.
Leave a Comment
Trackback this post | Subscribe to the comments via RSS Feed