Since someone else dredged up this old thread...
The above "formula" for virtual memory/swap space is very old and outmoded. It came into being out of a well-intentioned but ultimately misguided attempt to try and conserve HDD space in the days when you would have a HDD of well under 1GB and so space was at a premium. Along the way, people figured out that this was a "trick" that professional photo and video editors would use to improve performance, but the fact that these people had dedicated secondary drives for this use, which was the real source of any meager performance benefit they might have achieved, tended to get left by the wayside because there are all too many people out there who will regurgitate half-remembered "tips" in an attempt to sound a lot more skilled than they are. If any of those people had any concept of a state known as thrashing, they never would have recommended those settings.
The best method is also the easiest one, which is to let Windows manage it. It will grow/shrink based on need. You're far less likely to encounter a trashing state that way, which is an added bonus since it makes your computer all but unusable. You will frequently find the last few people who desperately try and cling to this bit of outdated advice bring up another bit of technical knowledge that they stole from somewhere without truly understanding, claiming that you need to keep at least 10% of your drive free or it causes some kind of mysterious problems with Windows. If you think about it, if you have a HDD that's 500MB, idling 10% of it is only 50MB and seems fairly reasonable. If you have a 1TB drive, you're talking about idling around 100GB and you can see how the idea doesn't scale very well. Besides, Windows doesn't care how much free space you have. It doesn't matter if every last byte is used on a drive, so long as that is all the more the computer requires at that time. If you need so much as a single byte more, you'll find yourself in a thrashing state, but if you have exactly 1MB of free space and the computer only needs exactly 1MB of additional swap, you're fine. There's no special magic number for how much free space you need. I wouldn't recommend running things close to the wire, but there's not exactly any particular reason you couldn't if you were so inclined.
Also, the best thing you can do to reduce the amount of swap file used is to add more physical RAM. Swap is only used when physical RAM is exhausted, so more physical RAM mean less swap used.
Was this reply helpful? (1) (0)