You are not logged in.
In these days of 1GB RAM as standard does it really make sense to have a 2GB swap partition?
My current box has 256 and my swap was comparable in size. I was getting poor performance in games so I upped it back to 512 and saw immediate improvements: less RAM usage and less swap space being used. So it seems there is some benefit of having that bigger swap, even if it never gets used.
What does everyone else think?
Offline
I rather want my prosesses to die than to swap them, so I have no swap. My machine have 1GB ram, so if all ram is used up something is wrong and the one process using the most memory is probably the cause and it deserves to die anyway. I just let the kernel do the job for me. I have not noticed any performance hit and no swap also means longer battery life on my laptop.
Offline
I have 1GB ram (soon 2GB) and only 256mb of swap (because I read somewhere that no swap wasn't good for the kernel, don't know if it's true or not). I have to say that the swap is never used unless when opening very big images in gimp, 2mb+.
I guess then that for ordinary desktop usage no or very little swap is ok
To get something done, a committee should consist of no more than three persons, two of them absent.
--
My Github
Offline
I have 2G of ram on my desktop and 4G of swap, going by the swap = 2x ram. However, the swap partition lives on LVM2, so if I run out of space on the disc, I can always resize the swap. But given I have ~40G free just now on the system drive and ~60G free on my music & vids drive, I'm not exactly short of space just now...
Desktop: AMD Athlon64 3800+ Venice Core, 2GB PC3200, 2x160GB Maxtor DiamondMax 10, 2x320GB WD Caviar RE, Nvidia 6600GT 256MB
Laptop: Intel Pentium M, 512MB PC2700, 60GB IBM TravelStar, Nvidia 5200Go 64MB
Offline
I decided to go with 512MB of swap (I have 4GB installed), and it will probably never be used, but whatever...I like saying "swap space."
Offline
I have 2GB RAM and a swap of 486MB and I've never seen the swap being used so far.
PC: Antec P182B | Asus P8Z77-V PRO | Intel i5 3570k | 16GB DDR3 | GeForce 450GTS | 4TB HDD | Pioneer BDR-207D | Asus Xonar DX | Altec Lansing CS21 | Eizo EV2736W-BK | Arch Linux x86_64
HTPC: Antec NSK2480 | ASUS M3A78-EM (AMD 780G) | AMD Athlon X3 425 | 8GB DDR2 | GeForce G210 | 2TB HDD | Arch Linux x86_64
Server: Raspberry Pi (model B) | 512MB RAM | 750GB HDD | Arch Linux ARM
Offline
I've never seen swap used on my server with 1GB RAM and Xfce on it, though I even run few vmware machines on it sometime.
I don't remember how much swap is there, probably 1GB.
to live is to die
Offline
I have 450 MB RAM and I almost never use swap
20-30 MB was max when I was using heavy DE like KDE or gnome
Offline
i have 1G ram and 1G swap, and like onearm says, i never see swap being used unless working with big image files. and even then it's pretty rare. on my server i see swap being used sometimes with a lot of torrents going, not sure why exactly. maybe it has something to do with network latencies and how it's writing to disk, since the target is an nfs partition.
Offline
Like most of you have found, swap space is redundant for your average desktop PC with a half-decent amount of RAM. Of course if you have some app going wildy out of control with a memory leak, then it just takes a bit longer to fill up any swap file before it grinds to a crawl. Gimp will use it's own temp files.
I've run happily with 512MB or more of RAM with no swap.
As a compromise, if you really can't be without swap space then use a swap file (rather than a swap partition) which you can reduce in size over the days down to zero - like letting the air out of your water wings until you can swim
dd if=/dev/zero of=/waterwings bs=1024 count=65536
chmod 600 /waterwings
mkswap /waterwings
swapon /waterwings
then to make it permanent when you next boot add this line to your /etc/fstab
/waterwings swap swap defaults 0 0
Offline
Having some decently sized swap partition has the other advantage of being able to use it for storing a suspend image (ha, I managed to create a one wicked sentence). But in that case using filewriter from suspend2 is also an option.
Offline
echo 1 > /proc/sys/vm/swappiness
for less swappiness. works like a charm for me. (2gb ram, 512mb swap)
Offline
The 'b' partition of your first drive automatically becomes your system swap partition -- we recommend a minimum of 32MB but if you have disk to spare make it at least 64MB. If you have lots of disk space to spare, make this 256MB, or even 512MB. On the other hand, if you are using a flash device for disk, you probably want no swap partition at all. Many people follow an old rule of thumb that your swap partition should be twice the size of your main system RAM. This rule is nonsense. On a modern system, that's a LOT of swap, most people prefer that their systems never swap. Use what is appropriate for your needs.
This is what openbsd devels think of swap. I just use around 256 to 512 MB depending on the pc.
Cheers,
Alphalutra1
Offline
The only time my system goes into swap is when I do something incredibly stupid with my Gimp scripts. Unfortunately that's frequently. In fact, I botched a script earlier today that actually sent my system into swap when I still had 2 GBs of RAM still open. Now that's a memory leak!
Offline
under heavy load (multitasking + windows xp on vmware with many heavy excel files opened) my system does swap (a little).
as my rule of thumb i'd allocate at least 1xRAM as swap space. what about if swap is used for hibernation ?
what goes up must come down
Offline
under heavy load (multitasking + windows xp on vmware with many heavy excel files opened) my system does swap (a little).
This depends on amount of RAM for host and guest system.
On my server with 1GB of RAM I run 3 vmware machines with 256 MB RAM - and no swapping (I have Xfce).
Also, VMware has 3 different policies on swapping virtual machine's memory.
to live is to die
Offline
My current setup is 2GB RAM and 2GB swap. I've got plans to work with some really huge uncompressed datasets and 2GB of RAM may not be enough to get the job done. Unfortunately, my Soltek mainboard only has 2 sockets, so unless I want to build a new box 2GB installed RAM is the limit.
Offline
from my experience 1gb swap space is ok , maybe even too much for any machine no matter the amount of ram.
currently i run arch on a 128 ram machine with 1gb swap and most ive seen used is 100mb
dont know if having eg. 4gb ram with 1gb swap and not 8gb one by the 2xram "rule" , would slow things down, but i seriously doubt it. if anyone has such experience id like to know though
There shouldn't be any reason to learn more editor types than emacs or vi -- mg (1)
[You learn that sarcasm does not often work well in international forums. That is why we avoid it. -- ewaller (arch linux forum moderator)
Offline
Normally I think 300Mb of swap are enough, but what is when I will Suspend to Disk the System? Do I need more Swap space? (If I use the swap partition for this)
btw: what is better Suspend to Disk with a swap partition, or with a File?
Have you tried to turn it off and on again?
Offline
i run my desktop with 1gb ram and a 2gb swap. the only time i've seen it used is video encoding. the size of the partition is irrelevent to me as i have 2 80gb ide drives used for arch x86 and 64 respectivly and a 320gb sata for my home dir
"Alright it's settled. Zorak is the hammer, Moltar you suck."
Offline
Ironically, the more RAM you have, the less swap you need. A much better guideline is to pick a number based on how much memory you think you'll need (frequently 2G on a modern KDE/Gnome desktop, 1-1.5 G on a lightweight box), add a bit (just in case), then subtract your current RAM.
Offline
256 MB ram plus 128 MB swap and I've never run into problems with typical desktop usage (yes, that excludes stuff like video editing).
1000
Offline
i run my desktop with 1gb ram and a 2gb swap. the only time i've seen it used is video encoding. the size of the partition is irrelevent to me as i have 2 80gb ide drives used for arch x86 and 64 respectivly and a 320gb sata for my home dir
I think this makes a very good point about swap. Almost everybody has 20+ GB drives these days and having 2GB as swap isn't really affecting your usage that much.
As stated earlier in this thread, I also use 2GB of swap. It never gets used, but I often manipulate large datasets and I cannot have apps crashing due to lack of memory when an option like swap exists.
Offline
Ironically, the more RAM you have, the less swap you need. A much better guideline is to pick a number based on how much memory you think you'll need (frequently 2G on a modern KDE/Gnome desktop, 1-1.5 G on a lightweight box), add a bit (just in case), then subtract your current RAM.
!!
I don't know what kind of RAM the big DEs want, but I can't imagine what kind of lightweight box would want 1-1.5 GB. My fairly lightweight systems with 512 MB RAM hardly ever touch swap at all.
Offline