Today's thread is for those who don't want any swap...

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
11,809
Reaction score
10,374
Credits
97,674
Some distros will install with a swapfile. Some folks do not like the swapfile, or any swap at all.

I like swap. I use swap, specifically a swapfile.

Linux runs just fine without any swap, assuming you've got RAM available. Linux does not need swap to run in a stable manner. In fact, I've got installs without any swap at all because I've been too lazy to add it.

Just because I use swap doesn't mean you have to. You have a choice. In fact, you have all sorts of choices. If you want, you can go right ahead and remove that swapfile. It's a little complicated looking, but isn't that complicated if you follow directions well. I like to think I made the directions clear...


So, there you go... If you want to remove your swapfile, have at it!
 


Something to think about here. From chatGPT.

Swap space, whether in the form of a dedicated swap partition or a swap file, serves as virtual memory when your physical RAM is fully used. Both have their advantages and disadvantages, and the choice between them depends on your specific requirements and system setup. Here are some advantages of using a swap partition over a swap file:

  1. Performance: Swap partitions generally offer better performance compared to swap files. This is because swap partitions are separate disk partitions specifically designed for swapping, whereas swap files are located within the existing file system, which can lead to higher latency and slower access times.
  2. Dedicated Space: A swap partition is a fixed, dedicated space on your storage device that is solely used for swapping. This means that the swap partition won't be affected by changes to the file system, fragmentation, or other activities that might impact the performance of a swap file.
  3. Reliability: Since swap partitions are independent of the file system, there is less risk of corruption or issues caused by file system errors. This can lead to a more stable and reliable swapping mechanism.
  4. No Impact on Disk Space: A swap partition doesn't consume space within your root or home partition, which can be especially important if your system is running low on disk space. A swap file, on the other hand, consumes space within the file system.
  5. Easier Configuration: Setting up a swap partition is generally simpler and more straightforward during the initial installation of an operating system. You can also configure a swap partition as part of disk partitioning.
  6. Faster Initialization: Swap partitions are usually mounted at system startup, making them available immediately when needed. Swap files, on the other hand, may require additional steps to be set up and mounted during the boot process.
  7. Better Compatibility: Some operating systems or configurations may work better with swap partitions, especially older or more specialized systems. Using a swap partition can help ensure compatibility.
However, it's important to note that the choice between a swap partition and a swap file depends on your specific use case and requirements. Swap files are more flexible and can be created and resized as needed
 
Something to think about here. From chatGPT.

<snip>

I actually looked for your thread but didn't find it. Otherwise, it'd have had a link in the article to your thread about swap.
 
I like swap too. But I wish Debian weren't so doggone ancient about it. :p

Complicating matters on some systems (such as Spiral Linux) is the "decision" to use "zram" without my permission or control. I guess that's why some people want operating systems without "systemd". Yes I've had problems with this related to "zram" which led to very long shutdown times, and even a whole partition being marked as read-only, belonging to an operating system which I had to boot into if I wanted to make any changes.

I don't install any Linux OS, especially via Calamares which allocates a swap which is 6GiB or greater, much too big for something that might not even be used.
 
Yes I've had problems with this related to "zram" which led to very long shutdown times, and even a whole partition being marked as read-only, belonging to an operating system which I had to boot into if I wanted to make any changes.

Huh... I've had no such issues nor read of many. I suppose it's possible that it causes issues - but don't have enough experience to speak on it.
 
As a concept, I never liked this method. It exists on Windows by default as well, and I think it's quite unnecessary.

That is, if the system has enough memory.

But, and this is the trick: using this kind of memory expansion is technically a solution.

But, is it a good solution ? Is having very slow memory a good thing ?

For me, that is a no-brainer.

If the memory is heavily used, my first question is : OK, who is using high amounts of memory ?
 
If the memory is heavily used, my first question is : OK, who is using high amounts of memory ?
Some people who like to run multiple instances of a web browser, or like 15 tabs or more inside one single instance. If using a program like Shotcut to edit a movie which was in compressed form, and the program needs to convert to uncompressed, and there isn't enough memory on the local disk but there is enough RAM, it might surprise the user. But I have never run into that situation. (shrugs) Might be alike using Blender requiring a lot of rendering operations each one with its intensive calculation, otherwise it could be more CPU intensive than memory greedy.

I have actually seen like 20 tabs in a single web browser instance opened by somebody who is "very popular" publishing Youtube videos but I think "he's" ridiculous.

Moreover somebody in another Linux technical forum I used to belong to complained about having 16GB RAM, but I don't remember how much "swap". Complaining like a small child he was running out of memory, and his system was very slow because he never turned his computer off after a few months and he was dragging it down with multiple copies of web browser each one with multiple tabs. We at the other forum didn't buy his defense that he was "web developing". :/
 
I finally had time to edit the article.

Tomorrow's article took way too long to write. It's downright huge!
 
I have actually seen like 20 tabs in a single web browser instance opened by somebody who is "very popular" publishing Youtube videos but I think "he's" ridiculous.

You'd hate to see me...

In this browser instance, I have 106 open tabs. I have more in my other open browser.

They're not all loaded into memory, however. And yes, I use them all often enough to not bother with bookmarks (of which I have many). They're things I refer to often enough to just keep the tab open.

But, I cheat and don't have them all loaded into RAM.
 
brian@brian-desktop:~$ free
total used free shared buff/cache available
Mem: 32528504 2404636 20181816 625348 9942052 29031208
Swap: 0 0 0
brian@brian-desktop:~$
 
Likewise

chris@GeckoCinnamon-HDD:~> free
total used free shared buff/cache available
Mem: 16261260 3466516 11784564 422616 1729832 12794744
Swap: 0 0 0

^^^ Old Mate's got 32 GB I have 16.

IMO and IME swap is for people who have less than 4 GB of RAM, rather 3 or less, or for Extreme Power Users. AND those who feel a need to hibernate (essential, there).

I run about 80 Linux distros on this rig, no swap on any of them.

Had 119 tabs open in a Firefox once, no downgrade in performance.

Cheers

Wiz
 
Some people who like to run multiple instances of a web browser, or like 15 tabs or more inside one single instance. If using a program like Shotcut to edit a movie which was in compressed form, and the program needs to convert to uncompressed, and there isn't enough memory on the local disk but there is enough RAM, it might surprise the user. But I have never run into that situation. (shrugs) Might be alike using Blender requiring a lot of rendering operations each one with its intensive calculation, otherwise it could be more CPU intensive than memory greedy.

I have actually seen like 20 tabs in a single web browser instance opened by somebody who is "very popular" publishing Youtube videos but I think "he's" ridiculous.

Moreover somebody in another Linux technical forum I used to belong to complained about having 16GB RAM, but I don't remember how much "swap". Complaining like a small child he was running out of memory, and his system was very slow because he never turned his computer off after a few months and he was dragging it down with multiple copies of web browser each one with multiple tabs. We at the other forum didn't buy his defense that he was "web developing". :/

There's a lot there, but I;m actually thinking of Linux servers, not Linux client.
For clients, the only thing that I know is sometimes used is "video editing", but then again it's not necessarily a memory hog. It depends on the application as well ..
About multiple tabs; yeah, if browsers are badly designed, that is what happens. With several tabs, I never get passed 8GB, so I don't know how many tabs, what web sites you have to open, and what browser, but sure as hell that browser is not going to be efficient if it is using unnecessary memory.
Client computers (Windows in particular but also Linux clients) benefit from regular bounces, that is my opinion. One of those reasons is a memory clean.
 
The default behavior i have seen @ all servers and pcs i use is that. Linux starts to use swap if your ram usage is > 60 % . On my systems swap will be used then ram usage is 100% .


I didn't know that, I would have thought usage starts at 100% RAM in use

That's really soon already. But the swapfile would already be present anyway. So disk content wise, that's a loss already.
Imagine creating a swapfile, and then never running out of memory (or to 60% at least).

What a waste.
 

Members online


Top