Poll Do You Use Swap on Linux?

Do You Use Swap on Linux?

  • Yes, I Use Linux Swap Partition

    Votes: 2 33.3%
  • Yes, I Use Linux Swap File

    Votes: 0 0.0%
  • Yes, I Use zRAM Swap

    Votes: 2 33.3%
  • No, I Don't Use Swap

    Votes: 2 33.3%

  • Total voters
    6

Bot

AI-powered Bot
Apr 21, 2016
4,315
Yes, swap is still useful in Linux, especially for systems with limited RAM. It can prevent crashes when RAM is full. I'd recommend using a swap file as it's more flexible and easier to resize than a swap partition.
 

Spiff

Level 1
Jul 20, 2023
32
I do use swap space, as that is still recommended, even with lots of RAM.
I use a swap partition, as performance may be better than with a swap file. Although, I don't know if one would notice any difference on a modern system with fast SSD(s) and lots of RAM.
 
  • Like
Reactions: simmerskool

lokamoka820

Level 21
Thread author
Mar 1, 2024
1,060
I do use swap space, as that is still recommended, even with lots of RAM.
I use a swap partition, as performance may be better than with a swap file. Although, I don't know if one would notice any difference on a modern system with fast SSD(s) and lots of RAM.
Where did you put the swap partition, in the begging or the end of your SSD?
 
  • Like
Reactions: simmerskool

Spiff

Level 1
Jul 20, 2023
32
Where did you put the swap partition, in the begging or the end of your SSD?
Currently, I still use old hardware, HDDs, not yet SSDs.
My desktop system has two identical HDDs, each with a swap partition at the beginning of the disk space.
When I buy new hardware, with SSDs, I would put the swap partition at the beginning of the (fastest) SSD. I can't recall that I read any recommendations stating differently.
 
  • Like
Reactions: simmerskool

lokamoka820

Level 21
Thread author
Mar 1, 2024
1,060
Currently, I still use old hardware, HDDs, not yet SSDs.
My desktop system has two identical HDDs, each with a swap partition at the beginning of the disk space.
When I buy new hardware, with SSDs, I would put the swap partition at the beginning of the (fastest) SSD. I can't recall that I read any recommendations stating differently.
I use old hardware for my Linux with HDD too, it is faster than windows in the same laptop, what is your setup: distro + desktop environment?
 
  • Like
Reactions: simmerskool

SeriousHoax

Level 49
Verified
Top Poster
Well-known
Mar 16, 2019
3,861
In my limited experience, Linux's implementation of swap is far worse than Windows. Swap partition is very old school, swap file is similar to what Windows does, but swap partition and swap file both don't seem to be dynamic. From what I know it has to be a fixed value and cannot use more than that. Windows on the other hand can dynamically use swap file (page file to be exact which is more accurate than the term swap) as it sees fits. It can go over the recommended limit if required. There have been cases where a ram + video ram heavy game exceeded the VRAM I have on my system, and it made use of my swap file as an alternative. The swap file usage was over 6 GB every time I ran the game and became normal after exiting the game.

Not sure if Linux can do that since the value is fixed. It usually can't also hibernate if the swap partition or swap file value is not equal to the system ram while Windows can always hibernate as long as the option is enabled and there's enough empty space in the C drive.

On Linux I'm now using zRam which is a good concept of compressing ram to free up space for more. I guess Windows already and always uses memory compression by default, but the implementation is quite different, I think. I know Fedora and PopOS use zram by default, don't know if anyone else does.
The benefit of zram is less disk writes + faster swapping/paging due to ram being much faster than SSD/HDD.
Correct me if I'm wrong about anything.
 

colin.p

Level 1
Jan 6, 2022
21
When I first started using ubuntu in "08, I religously did the usual separate partitions for /, home, swap, but after a couple of LTS upgrades, I said screw it and let the installer deal with it. Since I have used "Lucky Backup" to back up Home for years, I never lost anything (of too much importance) and got up and running on a new install lickity-split.

Now, I still let the installer deal with it including whatever it does for swap. Not sure if it's a swap file or partition but I think it was 2GB and have never been bothered by whatever the installer did.
 

lokamoka820

Level 21
Thread author
Mar 1, 2024
1,060
In my limited experience, Linux's implementation of swap is far worse than Windows. Swap partition is very old school, swap file is similar to what Windows does, but swap partition and swap file both don't seem to be dynamic. From what I know it has to be a fixed value and cannot use more than that. Windows on the other hand can dynamically use swap file (page file to be exact which is more accurate than the term swap) as it sees fits. It can go over the recommended limit if required. There have been cases where a ram + video ram heavy game exceeded the VRAM I have on my system, and it made use of my swap file as an alternative. The swap file usage was over 6 GB every time I ran the game and became normal after exiting the game.

Not sure if Linux can do that since the value is fixed. It usually can't also hibernate if the swap partition or swap file value is not equal to the system ram while Windows can always hibernate as long as the option is enabled and there's enough empty space in the C drive.

On Linux I'm now using zRam which is a good concept of compressing ram to free up space for more. I guess Windows already and always uses memory compression by default, but the implementation is quite different, I think. I know Fedora and PopOS use zram by default, don't know if anyone else does.
The benefit of zram is less disk writes + faster swapping/paging due to ram being much faster than SSD/HDD.
Correct me if I'm wrong about anything.
You have extensive knowledge about the topic, which gave me information I don't know about.
 

lokamoka820

Level 21
Thread author
Mar 1, 2024
1,060
When I first started using ubuntu in "08, I religously did the usual separate partitions for /, home, swap, but after a couple of LTS upgrades, I said screw it and let the installer deal with it. Since I have used "Lucky Backup" to back up Home for years, I never lost anything (of too much importance) and got up and running on a new install lickity-split.

Now, I still let the installer deal with it including whatever it does for swap. Not sure if it's a swap file or partition but I think it was 2GB and have never been bothered by whatever the installer did.
You can check your swap using swap command:
Code:
swapon -s
 
  • Like
Reactions: colin.p

SeriousHoax

Level 49
Verified
Top Poster
Well-known
Mar 16, 2019
3,861
You have extensive knowledge about the topic, which gave me information I don't know about.
Not really extensive but some basics I learned from experience and reading here and there. I'm a newbie in Linux. My God the Arch Wiki is probably the most comprehensive wiki I have ever seen. A goldmine for Linux related info. 95% things go over my head but very useful for learning anyway since most info is useful for any Linux distros.
BTW, thanks for mentioning fish shell in another thread. It's my default now and loving it. I know zsh can be configured to make it work like fish but fish just works out of the box 👌
 

lokamoka820

Level 21
Thread author
Mar 1, 2024
1,060
Not really extensive but some basics I learned from experience and reading here and there. I'm a newbie in Linux. My God the Arch Wiki is probably the most comprehensive wiki I have ever seen. A goldmine for Linux related info. 95% things go over my head but very useful for learning anyway since most info is useful for any Linux distros.
BTW, thanks for mentioning fish shell in another thread. It's my default now and loving it. I know zsh can be configured to make it work like fish but fish just works out of the box 👌
I remember many times ending in Arch Wiki for detailed information about problems I faced, one of them was fixing screen tearing on intel GPU, even Debian Wiki mentioning Arch Wiki as a reference in their website.
Fish shell is a must for me on every Linux setup, glad you like it, and Nala too on Debian based distros.
 

About us

  • MalwareTips is a community-driven platform providing the latest information and resources on malware and cyber threats. Our team of experienced professionals and passionate volunteers work to keep the internet safe and secure. We provide accurate, up-to-date information and strive to build a strong and supportive community dedicated to cybersecurity.

User Menu

Follow us

Follow us on Facebook or Twitter to know first about the latest cybersecurity incidents and malware threats.

Top