Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Hey I'm about to install fedora 9 and um doin all the partition again.. I have a HP laptop with 2.5 G of ram.. I was wondering do I need a SWAP partition.. ?? I've heard that with that much ram SWAP is not required ... Also tell me does SWAP partition in anyway effect the suspend function..
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369
Rep:
It depends on how much internal memory you,re box has and the use of the system
It will works without a swap file but it can become slow
My personnel opinion have as much swap file as you,re internal memory is , to have a good performance
The "resume=" kernel boot option will point to your swap partition. The memory that needs to be saved is saved to the swap file.
Hard drive space is cheaper than ram space so there shouldn't be so much of a problem. If you can do without hibernation, then you could add a very small swap partition but some software may assume there is at least some.
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
I never heard of a computer becoming slow without because it doesn't have swap space. Why would it? Swap spaces is a kind of 'overflow' memory and behaves exactly like that, but much slower. So if you are out of RAM, the MMU will start to use swapping memory pages to disk, which is compared to RAM access a very slow process. In case you have sufficient memory, no swap space is being used at all, let alone the computer becomes slow.
If the kernel is out of memory (RAM + swap) it will start killing processes using memory in order to be able to keep running itself. Only in that abnormal situation the computer seems to hang for a while.
Linux running KDE uses about 500 MB of RAM. With 2.5 GB you would not need swap space. However when you start running memory hungry processes and virtual machines, this amount increases quickly. Just for the sake of it is common practice I am running 2 GB swap space on my 2 GB RAM laptop.
I don't hibernate as booting is faster than reloading 2 GB RAM from disk. Strange but true.
I never heard of a computer becoming slow without because it doesn't have swap space.
Shortage of swap space can, and often does, significantly slow down a system, even when there is enough RAM+swap to get all the work done without killing processes.
Quote:
Why would it? Swap spaces is a kind of 'overflow' memory and behaves exactly like that, but much slower. So if you are out of RAM, the MMU will start to use swapping memory pages to disk,
That is too simplistic a view of the interaction between available ram space and disk I/O. There are at least three other ways available ram reduces disk I/O (and/or shortage of ram increases disk I/O) and for each of those, a shortage of swap space can increase disk I/O, slowing down the overall performance.
1) File caching. That can make a massive difference in performance. If the system is short of RAM+SWAP, it will cut way back on file caching before it reaches the level of killing processes. Too little file caching can cause a large increase in physical disk I/O.
2) I don't know the name for it, but Linux can page read-only sections of executables and .so's directly from the binary file on disk. When it "pages out" such read-only content, it doesn't need to write to the swap file, instead it just drops the ram copy. To "page in" it just rereads from disk. If the system is short of RAM and RAM is in use both by RW content from some sleeping process likely not to need it again for many minutes and RO content from a running process that will need it again a fraction of a second later, would you prefer the system write the stale RW pages to swap and have enough RAM to continue, or would you prefer it drop some active RO pages and then a fraction of a second later need to drop some different active RO pages to read the first ones back and so on? If you're also short of SWAP, the OS has no choice.
3) Memory mapped file I/O: Same discussion as for (1) but for a different way that some applications do file I/O.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.