Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
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.
Why not have a swap? In my mind, it's an easy way to reduce memory-related crashes. My 1G computer had a noticeable difference with rather than without, even though it's never reported as being "used" You probably won't need as much as you used to have, though.
anyway, the answer to the original question is: Yes.. you can install linux without a swap partition/file. But.. there are strings attached when doing so.
Why not have a swap? In my mind, it's an easy way to reduce memory-related crashes. My 1G computer had a noticeable difference with rather than without, even though it's never reported as being "used" You probably won't need as much as you used to have, though.
Basically cause I'm an experimenter
After never seeing any swap usage in the lifetime of my last pc(1g ram), i thought why not give it a go not using it on the new setup (2g)
After more that a year with no memory related crashes, even with all night compiles (i run gentoo) I've come to the conclusion that it's not necessary on modern desktop systems.
I need to play around with suspend2, once i have suspend to file working, I'll take swap support back out of my kernel as i notice a not insignificant performance increase without it. I should add I'm a little obsessed with efficient computing, my way of doing things may not work as well with a standard distro.
First thing is that rules of thumb are never valid. Just like measuring things in inches (until someone decided to regulate what exactly a metric "inch" is). That's because the size of the thumb vary from one person to the next one.
Jokes aside, there can be a number of situations where the kernel will be happy to have some swap space, and it in fact increases system performance, it doesn't reduce it.
For example, imagine this case where you have a thousand web sites open in firefox, probably some of them are two days old and you won't ever go back into these sites. You are just too lazy to close them. If you have no swap they are into RAM, such RAM can probably be better used as cache memory for files and data structures, and having these in RAM will actually improve the system responsiveness and performance. But you can't have as much data in RAM unless you actually have a place to page out all the firefox cruft (just an example).
Another detail is that if there's swap and you start running out of RAM the performance degradation can server as an alarm: it's time to save some data and close stuff, or maybe look at top and kill some buggy thing. If you don't have swap space there's no alarm. You will only notice you are out of virtual memory when the OOM killer shutdown any random program (or hopefully the right one) and you lose all the data you've been working on the last hour.
Right, probably 99% of the time you don't need swap. The right question is: does it really do any harm to have an sparse file (yes, you read well, you don't even have to bother with a partition if that angers you) of a couple GB's on an HD nowadays? The answer is "nope".
To execute a program in Windows, it is require to be loaded into memory. Your Windows run multiple programs simultaneously and so many chances are that they won't all fit into memory at a same time. For that window has to swap all files one be one from memory to disk
and disk to memory.Wihout swap file swapping is not possible and without swapping window or linux can not run more than one programs at a same time.So swap file is so much important.
without swapping window or linux can not run more than one programs at a same time.
Definitely not true. I can turn swap off on my systems, and run many programs, as long as they fit int my RAM. And with modern systems RAM sizes you can run many apps, before you run out off RAM, except of course you run really memory-hungry apps, like VMs or something.
your swap and/or /tmp combination needs to be > (larger than) the largest file that
may require deleting without imposing on the system memory. eg, a dvd....
Regards Glenn
<edit> I'm a bit behind on my reading, sorry I missed that, GW</edit>
Can you explain that to me? I understand it so: " I need at least 2 GB of RAM and 2 GB of swap space to delete a file that is 4 GB in size." How would that be so?
First thing is that, there's no difference (for programs like rm) between "swap" and "RAM". They do not ask for "swap", they do not ask for "RAM", they can't even do that. They only see "virtual memory", where that memory will live physically is up to the kernel which will do its best to improve the performance on any given situation.
Second thing is that paged memory has nothing to do with storage space. A program can't use storage space + paged memory for the same purpose. They have nothing to do with each other.
Third, if it was true that you need so much free space+swap to delete a file, then there wouldn't be a way to delete all these TB-sized files that we use nowadays. Because most boxes have at most a few GBs of RAM, and typical setups put /tmp either in / or on a separate 2GB partition or something like that.
Of course, you need 4GB free space if you want to MOVE a 4GB-sized file into your Recycle Bin, but that's another story.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.