Since aeons ago, even my grandma will say "hey, your swap size should be double the amount of RAM you have". WTF, mate. The more RAM you have, the less likely you'll run out of physical RAM, and the less swap you will need. And more importantly, the less RAM you have, the more swap you need! People go and set 512 MB of swap size for a 256 MB RAM machine. Retarded; I'd go for at least 1 GB. Then people go and set 2 GB for a 1 GB RAM machine. Retarded again, that's when I wouldn't mind 512 MB.
This goes especially for Windows NT, which (what's better than Linux) will swap in an unfragmented file and will dynamically allocate more space as necessary, so, if at one point in time you buy more RAM, you might need to claim some swap space, and if you get more bloatware and need more RAM, you might want to expand and defragment it for maximum performance.
Name:
Anonymous2005-06-30 21:49 (sage)
You can use files for swap in linux too, although it won't automatically resize.
As for size, the 2x rule clearly has been outdated for some time now. It depends entirely on the system's program mix.
The 2xRAM rule-of-thumb dates from those days of multiuser systems, where the process schedulers were tuned for best-interactive performance in that situtation by giving nearly all memory to the active processes and reducing their paging. These days, OS have dynamic/large filesystem buffers, lazy schedulers, etc., in memory as well. In my 1GB RAM machine at the moment, there's only ~300MB of memory used by processes, so I can safely get away with only 512MB of swap.
Name:
Anonymous2005-07-04 15:42
If I did set it to one size such as 2X, would it run any less efficiently?
During fdisk when installing linux I know to set a swap size on the hard drive. If I were not to do that and just use swapd would it work better? My computer has 512mb of ram.
Name:
Anonymous2005-07-05 12:36
Not having used swapd, take this with a grain of salt, but I think that'll depend on the filesystem. Apparently some fileystems will corrupt if you create files for swap on them.
Maybe this is old news, and they've fixed it.
Name:
Anonymous2005-07-05 18:35
>>6
Linux works well without any swap, and 512 (even 256MB) will certainly be enough to last through an installation to the point that swapd gets installed.
If you -expect- your machine to hammer its swapspace, of course a dedicated partition is the best option. Everyone else who isn't a matrix maths major will do okay with swapfiles instead.
>>7
Having swapfiles on some types of filesystem can be suboptimal; iirc NFS is the only one with show-stopping problems..
Name:
Anonymous2007-09-27 7:02 ID:Oh08RWW3
I'm sick of this "just get more ram!" bullshit. My 286 did almost as much functionality-wise as my current multi-ghz machine. Yeah, really. Sure, there was no multi-tasking, but I did the mostly the same things as I do today.
Hello, fuckers, just because you can eat ram doesn't mean you should. It costs money and also reduces the number of programs you can run.
I can see it now: in another ten years programs will have minimum footprint of 1GB, but they'll just do more of the same