swap space
hi,
Is there any hard n fast rule that the swap space should be twice the RAM capacity??? Thanks in advance |
No! That was way back when you had a few MB of RAM. If you have 1GB or 2, your swapspace will probably not be used, but it is nice to have anyways. 512MB would be more then enough, and if you're short on space, 256 would probably work just fine. Personally I have used linux for a while without swap at all, and I diddn't have any trubble. Now I have 512MB and that seems to be a normal choice.
|
Like Windows use more then double virtual memory. If you have 256 mb of RAM then virtual memory is set to use between 768-1536 mb of HDD space.
|
2 x RAM is the MAXIMUM recommended swap space. You usually don't need so much unless you edit large images or movies, in which case you might need it.
|
I know that was the traditional logic, but I can't see why I should waste 4GB of my harddrive to "unused" swap?
|
Hi all,
I've wondered about this too. From the monitors I use, it seems that rarely is more than 90% of my RAM used, and my swap partition has never been used. This is on a Pentium III-800 with 384 MB of RAM running Slackware 11. Granted, I haven't yet edited 70 MB TIFF images, or encoded a DVD-worth of data -- both activities that might use my swap partition. But last night I compiled Scribus, which took almost two hours and used nearly 100% of my processor, and ran Firefox, Pan, Seamonkey, and Emacs at the same time. Things slowed down a little bit, but my swap partition stayed unused. Is Slackware simply that efficient? Regards, -Drew |
Typically my swap is not used. But, it is used actively when I open or edit large images or movies ... it doesn't happen too often, but it does happen.
|
If you have enough RAM you can leave swap small.
Like mine: Mem: 2075008k total, 2016316k used, 58692k free, 82696k buffers Swap: 0k total, 0k used, 0k free, 1296012k cached WTF?! Swap zero ? Oh yes now i remember. HAL has destroyed my /etc/fstab few days ago and all this time i was without swap :) Mem: 2075008k total, 1652772k used, 422236k free, 57884k buffers Swap: 2008104k total, 32880k used, 1975224k free, 1276620k cached Oh, now its fine. |
HAL does not destroy your fstab file, it does not write to it at all.
Eric |
Quote:
|
HAL shouldn't be able to even touch your fstab, even if by some weirdness it wants to screw with it imho,...
Quote:
To the op, swap space is generally not needed if you have >1GB ram (even in 512MB , but ymmv). BUT, 2.6.23 kernel supports suspend to disk (Hibernate in windows speak) and so it would be nice if you keep >500MB space as swap so that you can use that feature painlessly. |
Quote:
Eric |
My laptop uses quite a bit of swap space. I have 512M memory and 1G of swap. Currently, according to free, it is using 504M of memory (of which 250 is buffers and cache) and 291M of swap. I tune swapiness to 15. I _do_ tend to have a lot of programs running at any given time. Top memory contenders are openoffice and firefox, both of which I usually have open all the time, then X+kwin, then thunderbird and the 4 terminals I have open. And I currently don't have any large image files open, but it would not be unusual. I also very rarely re-boot the machine since I use sleep and hibernation.
I plan to get more memory for this machine (although it is not usually sluggish), but even so I think I'll want swap space. Another reason to consider swap space is if you plan to use hibernation to swap. I don't know what the calculation is for that. Brian Anyway, |
swap seldom needed with lots of physical ram
If you have lots of physical RAM already then why even use swap? That's 4 GB of good storage you can still use.
I only have 256MB of ram in my mac mini, and so I created a 512MB swap partition (of which it hasn't used over the first 128MB yet). But if I had 2 GB physical storage, I wouldn't bother with the swap. I'm not sure about this, but it seems like using swap partition can create an imperceptible greater wear-and-tear on drive, as well as greater energy consumption, as the heads have to do more work moving to and fro from the swap partition, and I think head movement is the slowest and noisiest part of a drive's operation. I guess my question to those more advanced concerning this would be: could using a swap partition actually lower the lifespan of a drive? If so, then I think the logic is that it is worth the extra wear-and-tear on the drive, and the shortened lifespan,and the increased little whirring sounds, to use swap, in low physical memory situations, since it delivers a performance boost. But in high physical memory situations, it might not be worth the trade. Of course, in high physical memory situations, the swap is seldom used, so this wear-and-tear is not occurring. I think it just depends on how memory intensive your tasks are: if you are rasterizing a hundred images at once, maybe it could still boost performance, but otherwise what your are really sacrificing is just an unused portion of your drive, as you correctly surmised. |
Quote:
Maybe. But i have installed only opera who are not in Slackware 12.0. Everything else are installed from CD. p.s. i still thinking that HAL is responsible for /etc/fstab and btw i`m allways using root account for X and others programs. So i just made chattr +iu /etc/fstab |
All times are GMT -5. The time now is 09:57 AM. |