SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
If you have plenty of RAM you shoudl never need to swap anything out to disk, so you shouldn't need any. At the same time if you have a huge disk a few gig wouldn't be missed. Essentially there is no real rule any more and you are unlikely to suffer whatever you pick. As you covered off already, the only real issue would be suspending to disk which you don't want to do.
What acid_kewpie said, plus a few considerations. Firstly, the twice RAM rule of thumb is a leftover from the days when a typical server had 16MB (that's megabytes) of RAM, so SWAP was heavily used. So, a corollary would be that even today, if you're running a server with a lot of users you either need lots of RAM or maybe just a largish SWAP space. However, if you were in that position you would probably already know what to do.
As you already know, suspend is an issue to consider, as well.
But, the worst thing about SWAP is that it's bog slow; even if there's only one user - you. Memory is just too cheap these days to be trapped using a hard disk for pseudo-RAM. And, imagine the situation where you have several GB of SWAP and you have to actually use it for something besides suspend because you just don't have enough RAM. That would probably be miserably slow. My suggestion is to use about 1GB of SWAP space, and if you ever notice your machine actually swapping do the obvious: add more RAM.
I have 4Gigs installed, I am planning to install 4Gigs more... that's right... : 8Gigs physical RAM...
But, I do run some heavy stuff... Computational Fluid Dynamics, Finite Elements Analysis... and I mean HEAVY...
When the volume of data outbounds the physical RAM limitations, having some spare Gigs to "spill the rest" of the data structures of the running analysis wouldn't seem such a bad Idea...
Think I'll stick w/ 4Gigs RAM...
BRGDS
Alex
EDIT
In a "defaults" Debian Lenny Install on this Box, the installer allocated 12, ( yeah, you read well.. 12 ...) Gigs of swap for 4 Gigs of Ram in an LVM setup...
The previous responses have touched upon the history of swap. I can offer my own observations with respect to my systems.
My primary office system is a dual core running Slackware 12.2 and KDE 3.5.10. I have 4 GB of RAM and the kernel compiled for that. On this system I run virtual machines, Firefox, KMail, Akgregator, Amarok, Kate, KMix, KAlarm, etc. Once in a while swap gets used. Not often but I have seen that happen.
My HTPC is a dual core running Slackware 12.2 and KDE 3.5.10. I have 2 GB of RAM. I only run the system as a home theater PC and web browser. Once again, once in a while swap gets used. Again, not often but I have seen that happen.
I have two clunker machines that I tinker with occasionally. One is a 400 MHz K6-III+ CPU with 256 MB RAM and the other is a 350 MHz PII CPU with 448 MB RAM. On both hard drives I have 1 GB swap partitions.
I have the drive space and with my dual core systems I configured my swap partitions to be larger than the amount of installed RAM in each box (4.4 GB and 3.3 GB respectively). I did this with the idea that perhaps someday I might use suspend-to-disk. I don't use that shutdown option because I have found that boot times from suspend-to-disk are about the same as from a cold start.
You mentioned you might not be interested in any suspend options. Therefore you would not need to create a swap partition large enough to support suspend-to-disk. The only question then for yourself to answer is how much RAM does your daily usage consume? If you have the drive space, creating a 1 GB swap partition seems silly nowadays with 2 to 4 GB of RAM now common, but that partition size won't hurt you in any way. On the other hand, going the other extreme and creating a tiny swap partition could bottleneck your system someday if you start using a lot of RAM.
As mentioned, with the price of RAM relatively inexpensive these days, an extra stick or two basically avoids any concerns with swap.
I never have tried to run any system with swap off. I don't know whether no swap at all has any serious effects on a Linux-based system.
I never have tried to run any system with swap off. I don't know whether no swap at all has any serious effects on a Linux-based system.
Well, I ran my sistem without swap for long time, without knowing (one day I ran the 'free' command and noticed it was showing 0 MB of swap, the partition somehow was not set up on the fstab :-D
I have a laptop with 2GB of RAM and the swap gets touched sometimes (a lot more now that I'm with KDE4 on Slack13, I have to say), but never noticed anything strange when it was disabled.
Running VMs with a lot of memory (on my laptop, a WinXP VM with 700MB out of 2GB allocated) or suspend to disk are good reasons to have a swap partition (in the case of the VM, as a "just in case"). But I believe that unless you are doing something that requires as much memory as you may get (large image processing, audio/video edition), there should be no need for swap on a system that has 4GB of memory.
Don't really know how much swap the suspend-to-disk feature may need. It always loads around 500MB from disk when it wakes up, what seems strange considering my memory usage varies a lot. But to be safe I made my swap partition the same size of my physical RAM (2GB), which is less than 2.5% of the hard disk size (and my hd is small for today's standards, only 120GB)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.