"Remember that virtual memory is a mapping of all available
memory to a system, no matter the device type. Therefore, if you
anticipate that you will never utilize more than 4GB of virtual
memory and have 2GB of physical memory, 2GB might be a good amount
for you. But better than 2GB of swap would be an additional 2GB of
memory, allowing your heaviest usage to wholly fit inside RAM.
"On my desktop at home (which currently runs Gnome + Compiz on
Ubuntu 8.10 Intrepid Ibex), I started with 2GB of RAM and a 2GB
swap partition. I've since upgraded the memory to 4GB and - as
expected - seen swap usage drop to virtually none. The only
situation in which my swap fills up, is when a process runs amok
and grabs every last piece of memory available. Although I
practically never reach into that extra memory, I was thankful it
was there instead of having OOM Killer wreak havoc or forcing my
system to a screeching halt."