Why size of swap space is 2x of RAM??? Why not 1.5x of RAM or 2.5x of RAM???
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
It was a fairly stupid "rule of thumb" back when ram as a lot more expensive. Actual swap space requirements always depend on what you're doing with the system and don't correlate significantly with the amount of ram you have.
Now that people routinely (but not uniformly) buy much more ram than they really need, that 2X rule has shifted from fairly useless to totally useless.
If you can't figure out how much swap you should have (don't worry, most people are no better at figuring that out) a better blind rule is configure 2GB of swap regardless of ram size. If you have 0.5GB of ram, 2GB of swap. If you have 8GB of ram 2GB of swap.
If you can't figure out how much swap you should have (don't worry, most people are no better at figuring that out) a better blind rule is configure 2GB of swap regardless of ram size. If you have 0.5GB of ram, 2GB of swap. If you have 8GB of ram 2GB of swap.
Unless you plan on hibernating, then the partition must be at least as much as your RAM.
Though, if you're careful, it is entirely possible to get away with no swap at all. I've never had a swap partition on my EeePC with 2gb of RAM. I even keep /tmp/, /var/log/ and my browser cache in tmpfs, which is in RAM.
Last edited by elliott678; 10-31-2011 at 12:41 PM.
it is not a rule, it was just because mostly systems had less physical memory earlier so we had to made swap space just double of ram but now days system have sufficient physical memory around 1 GB or more then 1 GB mostly ,so there is no need to create 2 GB swap partition if you do create only 1 GB swap your system will work fairly without any issue.
for example my server has 8 GB RAM but swap space is only 2 GB and server is working fine since last 3 years.
An alternative is to swap to a file (in a file system) as opposed to dedicated partition(s). AFAIK the file stays at the maximum swap used size so is a good way of measuring it, perhaps to decide what size dedicated partition to use. If the system is using swap then it will probably use more swap later (computing load has a tendency to grow) so best to configure more than the system actually uses to allow room for future growth.
hello,
here are my thoughts.
depending of what you want to do, you dont need swap at all..
my desktop PC has 768 MB RAM. A LOT for the processor and tinycorelinux. And just for the principle of having it, 100 MB of swap (it was used 1 time when I had too much applications opened).
I run my tinycorelinux USB stick on different PCs direct in RAM (no swap, no HDD).
Using SWAP by these days is perhaps because
- you cannot increase the RAM (physical limitation in your HW),
- dont have more money for RAM,
- have the wrong linux (too big too fat)
.. forgot to buy RAM?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.