PDA

View Full Version : defragging and virtual memory


SpeckledJim
01-07-2005, 05:20 PM
right, two questions here:
1. how do i defrag
2.i have 512MB RAM now what should i set that virtual memory thing to?

saphalline
01-07-2005, 05:41 PM
Oh right! I forgot to answer those questions last time! Sorry about that.

1) - WinXP is really good about this. No more booting into safe mode to get defrag to finish! :D It can't hurt, of course, but it's not necessary. To defrag, go to Start => All Programs => Accessories => System Tools => Disk Defragmenter. Once it opens, click on the picture of your main C: drive (or whatever drive letter your OS resides on) and click the Analyze button at the bottom. Your partition will be anayzed and a pretty multi-colored picture will be displayed in the center main section of the window. A pop-up will appear with stats on your hard drive and such. Blah blah blah, close the pop-up (read the pop-up if you want ;) ). Now click the Defragment button at the bottom. Oh by the way, this could take awhile. :p Make sure you have plenty of time for this! Best time is to run it overnight while you go to bed.

2) - This setting is buried deeply within Windows, yet is the single most important factor for speeding up boot times that I've ever seen! For one thing, the slower your hard drive, the more dramatic improvement this will have, especially on your boot-up time. This means that older computers will benefit the most! In WinXP, go to Start => Control Panel. Double-click on System, click on the Advanced tab. Now click on the Setting button under the Performance section (top section, the others are User Profiles and Startup and Recovery). A new pop-up will appear called Performance Options, click on the Advanced tab, then click on the Change button under the Virtual Memory section (bottom one this time). Highlight your C: drive (or whatever drive your OS resides on) and click on the radio button titled Custom Size. Set the Initial size (MB) and the Maximum size (MB) to the same value, and then click on the Set button. Windows will then tell you that it needs to restart before the new settings will take effect. Go ahead and restart and watch your system boot-up really fast! :D

A few notes on these. First of all, do #2 before you do #1. That way, your newly-sized page file will also be defragged, giving you an even smaller boot-up time! :D Second of all, the exact size of your particular page file varies according to your total RAM and your system overall. For your system with 512MB of DDR RAM, I suggest a page file size of about 550MB (to be on the safe side). Set the min and max to 550 and you shouldn't have any problems. Have fun with your new RAM! :cool:

SpeckledJim
01-07-2005, 05:48 PM
thanks man.
i had that memory setting thing set at 766 is that bad?

Paul Komski
01-07-2005, 06:27 PM
766 should be fine. I agree about making the VM of fixed size since this helps to reduce fragmentation on that partition. The absolute amount is probably less critical with Windows XP than earlier Windows since XP will either prompt you to or will itself override the settings and increase VM if it becomes really necessary at some point in time.

In the event of a sysem crash the system can dump all the current contents of the RAM to the VM (or pagefile) and also do a minidump. You need 2MB of VM for a minidump plus at least the same quantitiy as the RAM itself occupies for the bigdump. This saved data can then be used by the technically astute to debug and help diagnose the cause of the crash. That is why a minimum of 550 is a sensible amount. If you are not worried about reading a dump file and you have loads of RAM then you will probably get along just fine with the minimum recommended 2MB or even none at all.

So there is a paradox; if there is very little RAM on a system then you are going to need a lot of VM for applications using a lot of memory for them to be able to operate at all - and be it all slowly; it there is a lot of RAM you also need a lot of VM (in absolute terms) if you want to be able to catch a memory dump. If you really have loads and loads of RAM you actually probably never need or use your VM at all - though there are some badly designed programs that will need a little bit of VM regardless of the total RAM.

There is nowadays so much redundancy with regard to both real and virtual memory (and of HDD space) that these issues are much less critical than they once were.

A couple of other points worth discussion. One is that some would say you should run scandisk/checkdisk prior to defragmentation since if you defragment a corrupted system you will make any data recovery much harder. The other is that, even though it is still worth doing, fragmentation is of much less importance on an NTFS than on a FAT file system. Under NTFS fragmentation of the MFT is of some relevance butthis won't be addressed at all by normal defragmentation.

saphalline
01-07-2005, 06:30 PM
No, it's not bad to have it that high, just that it eats up more hard drive space than you need it to. With the massive amounts of RAM we have these days, and the huge hard drives, we need smaller and smaller page files, and those small page files we do have take up less and less hard drive space compared to what we have. Even a 1GB page file pales in comparison to a 160GB hard drive!

I still remember the old days back when Win95 was really cool. :rolleyes: We were all putting along with 500MB hard drives, and later 2GB was awesome! Put a couple of those in your system, and you were doing pretty well. :p Then Win98 came out and required more hard drive space, and ME required more, and XP is a real hog compared to those! But hard drive size has out-paced the size of Windows by a lot! It used to be that just having Windows on your hard drive took up half your drive! But now, it's pretty insignificant. A full install of XP with a large page file is still less than 2GB, and if you have a new hard drive you probably have at least 80GB, so... It's just amusing how we all struggled way back when, and now it's just a small drop in the 5 gallon bucket...

SpeckledJim
01-07-2005, 08:18 PM
welll..........um..... at least i know its not bad.
By the way i have no clue what any of the other stuff yous guys said meant.
but thanks

Paul Komski
01-07-2005, 08:30 PM
No it's not bad. Its fine really. It's not all that critical because there's a lot of leeway on a modern system - particularly with say 512MB RAM running under WinXP. A lot of us like to tweak things to get the highest performance - but if that's not critical for you just stay with the default settings.

Do you want any aspects explained more simply?

SpeckledJim
01-07-2005, 08:47 PM
i would like to tweak to get the highest performance. id like you to explain how to do this?

saphalline
01-07-2005, 09:38 PM
For your page file, as long as the min and max size are the same, that's as good as you can tweak it. So, if your min size is 766 and your max size is 766, then you've tweaked it! :D I just picked 550 out of the air after looking at how much RAM you have. I like to keep the sizes at intervals of 50MB, so 500, 550, 600, 650, etc - depending on the amount of RAM.

If you want a chart of it, there's no set rule, it's really up to you. However, here's some starting points for WinXP vs RAM:

256MB RAM = 800MB page file
512MB RAM = 550MB page file
768MB RAM = 800MB page file
1GB RAM = 1050MB page file

Of course, that's only if you want to keep the page file above RAM size for the dump feature that Paul Komski mentioned. You'll also notice that for 256MB of RAM and 768MB of RAM, I recommended the same page file size. The reason is that the less RAM you have, the bigger the page file size you need! For anything under 512MB of RAM in WinXP, I recommend a page file size of 800MB (or more if your programs are complaining).

I myself don't care about the RAM dump feature, so for my 1GB of RAM, my page file size is only 400MB. Never had a problem yet, so it seems to be fine. :D But again, if I had less than 512MB of RAM, I would definitely increase it! Even without the need for RAM dump!

In any case, upgrading your RAM to 512MB was probably the best upgrade you could have done to your system, so even if it doesn't always feel faster, WinXP is definitely happier now! :D

SpeckledJim
01-07-2005, 10:23 PM
thanks man