Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
there are two related links. The first is the well known www.linuxatemyram.com and the second is about "why do we need swap". Unfortunately I can't find it right now. But it explain why is it still useful. Probably someone can post that link...
Perhaps this? I came across it recently and found it very useful.
"Swap space" becomes necessary anytime the demand for virtual memory exceeds the availability of physical RAM. Which is, of course, "all the time."
However, these days, there's no longer any credible reason to create a disk partition for this purpose. Simply allow the operating system to use a file, and thus to "grow or shrink it" however it likes. The "bad old days" that necessitated the use of "partitions" are gone, and will never return.(see below)
Last edited by sundialsvcs; 04-27-2021 at 07:52 PM.
However, these days, there's no longer any credible reason to create a disk partition for this purpose. Simply allow the operating system to use a file, and thus to "grow or shrink it" however it likes.
Nope. Swap extents need to be a fixed, contiguous region that then needs to be formatted by mkswap.
Swap partitions certainly still have a use.
I typically have swap partitions but as an example I believe that Ubuntu by default uses files now days. There is no performance loss since swap was revamped back in the 2.6 kernel days and total swap space can be a combination of both partitions and files.
I readily and without objection yield to all "differences of opinion." I'm wrong.
Linux is of course deployed in a wide variety of technical situations, and I have therefore readily struck my previous "closing comment." Which I acknowledge to have been "too specific to a particular user-case, and therefore 'in error.'" 'Nuff said.
In "a typical user-Linux situation," a swap-file works just fine and of course is most convenient. However, in other extant situations, a partition would be most appropriate.
Last edited by sundialsvcs; 04-28-2021 at 08:54 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.