PDA

View Full Version : Swapfile Myth!!!!!!



Prey521
10-09-00, 04:47 PM
Interesting Article that I found:


How Large Should The Swapfile Be?
That's a question that has bugged many users. Since the good old days of DOS and Windows 3.1, many users have staunchly adhered to an old rule of the thumb that the swapfile should be 2.5 X the amount of RAM in the system.

In fact, when I read several posts in Anandtech's BBS and other forums, I noticed that many people are still quoting this old "rule". The question is... is this rule still applicable for today's systems and operating systems? Unfortunately, it's a big NO!



Why Not 2.5 X System RAM?
Back in the days when people were using Windows 3.1, computers only came with 4MB or 8MB of RAM. Even 16MB of RAM was a luxury in those days. I remember running Windows 3.1 on a i386SX-16 machine with 4MB of RAM! Because RAM in those days are horrendously expensive and only a limited amount of it was available in most systems, therefore a relatively large swapfile was needed. 2.5 X the system's RAM isn't actually a lot, considering that most systems came with 8MB of RAM. That would only amount to a swapfile size of 20MB. That already enabled most systems to run Windows 3.1 applications comfortably.

But today, most computers come with at least 64MB of RAM and many have 128MB of RAM! If the 2.5X rule is applied, that means a swapfile size of 160MB to 320MB was needed! That doesn't make sense. The purpose of buying more memory is to prevent the system from needing to use the slower swapfile. The more memory you buy, the less you need to use the swapfile. You shouldn't need to increase the swapfile size every time you increase the amount of RAM in your system! Imagine if you have follow the rule when you upgrade to 512MB of RAM in the future... you could very well end up with a 1.28GB swapfile! That's ridiculous.

The amount of hard disk space you should dedicate to a swapfile should depend on the amount of RAM you need to use, NOT the amount of RAM you have. The 2.5 X system RAM rule was flawed from the beginning and it's certainly not applicable today. You have to gauge how much swapfile is needed by the system when the most memory intensive work is underway.

John
10-09-00, 07:09 PM
you guys may find this interesting- a related topic.

http://www.speedcorp.net/guides/ramdrv.shtml

HongKongPolice
10-09-00, 10:27 PM
I'll agree that 2.5x the ram size is too much but lotz of appz won't let you set the swapfile size too small either. eg NFS5 requires 200MB or so to run, if you set it any lower it'll ask you to set it higher. I would say around 300-400MB is a good size for ppl using at least 128MB of ram.

Another more IMPORTANT thing is that Windowz will suck up all the ram you have as DiskCache, even if you got 2 gigz of ram windowz will use it all up. You got 2 resonable choicez: 1 is to set a limit on the Disk Cache size using a program called CacheMan or like me, use a small program called RAMPage which will reclaim ram used for cache after the amount of available physical ram has dropped beneath a certain point which you can set. Both of these programs can be found at www.download.com (http://www.download.com)

There are drawbacks to them tho, for CacheMan, setting the cache limit too high will eat up your ram, setting it too low will decrease disk preformance, on top of that the cache doesn't seem to be cleared enuff times (windows clears it so its windows' fault).

RAMPage will cause your system to slow down quite a bit while its reclaiming ram. If you're in the middle of a 3D game or somethin it will cause your screen to sputter for up to 10secs or so, but it won't happen unless you've got some active program running in the background doing some heavy stuff with your rame while you play. Also reclaiming ram on an unstable system while your system is busy might cause it to crash, i haven't experienced it yet, but its possible.

Even tho the drawbacks seem bad, its better then what Windows does: Eat up your RAM for cache then use the swapfile for running programs.

I personally use RAMPage only, i've got 288Megs of ram and i've set it to reclaim ram when it drops below 50MB.

Hope this helpz http://www.speedguide.net/ubb/smile.gif

Prey521
10-09-00, 10:55 PM
300-400MB of RAM, are you kidding? Thats insane, I just lowered it to 150 and it is runnin fine so far.

HongKongPolice
10-09-00, 11:59 PM
Whats your big fuss about the swap file size anyways? Everybody has at least a few gigs on their HD, and it doesn't affect preformance unless you let windows decide the file size for you. And like i said, some gamez/appz like NFS5 won't let you run with a smaller size than 200MB or so.

Prey521
10-10-00, 12:11 AM
Well,

Not all people have a few gigs left on there drive, and I just think that a 400MB swap file is ridiculous and a total waste of space, I could use it for Porn http://www.speedguide.net/ubb/biggrin.gif http://www.speedguide.net/ubb/biggrin.gif http://www.speedguide.net/ubb/biggrin.gif http://www.speedguide.net/ubb/biggrin.gif, JK.

***ScrUm***
10-14-00, 01:54 AM
Prey, your not joking bout the porn http://www.speedguide.net/ubb/wink.gif HAHAHA , j/k I have since set my swap file to 40 min and 40 max. I have 256MB ram and after setting swapfile to 40 mt HDD no longer is active. I had it set to 256 http://www.speedguide.net/ubb/smile.gif and everytime I went to access an application my HDD would kick in. ( I even have ConservativeSwapFileUsage=1 in my system.ini and 9it still accessed my HDD when I went and opened an app.... well now that I have been informened and I have since set my SF to 40 I no longer get anything but activity from my applications.. not my HDD THX prey you are the man!! http://www.speedguide.net/ubb/smile.gif

------------------
Installation of Windows is being prepared


Please wait....

smaier69
10-14-00, 02:03 AM
just my own justification for a fixed swapfile size:

it keeps windows from continually resizing the size of the swapfile. in doing this, your hdd becomes fragmented much more slowly, thus preserving hdd performance for a longer period of time.

i currently have 128M of system RAM, and the min and max are both set manually to 256M. i have never run into a problem where i was getting hdd access every time i ran a file (like in scrum's case), but thats just my system (i cant speak for everybody's). 2.5x did seem a little excessive for my application, and 2x seems to work nicely.

------------------
"Those who do not acknowlege the past are condemned to relive it"

- Jim Jones

Prey521
10-14-00, 02:15 AM
My SF used to be set at 256 also, but after reading the article I lowered it too 150 and seem to be running smoother. I kept it above 100 cuz I noticed that a lot of Games require a swap file size over 100 and some even 200, like TUC, posted earlier.

***ScrUm***
10-15-00, 12:42 AM
Well. I play Q1, should I set my swap file to a larger size? perhaps 128? hell I'll just do it and see if my HDD is put to the test again. i'' post what happens http://www.speedguide.net/ubb/smile.gif

Bouncer
10-17-00, 12:45 AM
Remember though. The idea behind swapfile is to create a contiguous area of the hard drive.

The point is that apps will be loaded to that area so they can be accessed faster, rather than parts of them being scattered all over everywhere on a 20gig drive.

The easiest way to test this is by copying an MPG of a decent size, say 50 or 100mb to your hard drive. Set your swap file to 20mb. Now play the vid. Now set your swap file to 200mb. And play the vid.

The difference is very clear since the system doesn't need to go looking all over the harddrive for the next bit of info.

Of course, if you have a gig of RAM it's a mute point. However, windows loves to run tons of apps in the background, and they do hog resources.

Unless you REALLY want to play around with background apps, toolbars etc etc, it's better to have a decent sized swapfile so windows has some place to store all those programs BESIDES active memory.

Regards,
-Bouncer-
PS: I use a swapfile of 200mb. The trick is to disable just about every app running in either fore or background, DISABLE the swap file, defrag, and then REENABLE the new 200meg swap file. You need to be careful, but if done right you end up with a contigous swap file of 200meg, which is more than enough for just about everything short of autocad programs.

------------------
"Yeah Baby, YEAH!!!"