Swap file?

when setting up and installing endeavor os what is the preferred method for selecting a swap file ?

I see in the install process 3 options , no swap, swap to file, and to create a swap partition .

Sorry for the newbie question . I set up mine with a swap partition with ext4 on a cinnamon desktop I have 32 gig of ram

Depending on what you do, you probably didn’t need swap. At present, 32 GB is ample for me with no real swap. Only you would know if you experience memory pressure….
And if you added it, swap file would have been adequate, but partition (if on a separate disk at least) is the best option. so…for swap, you did fine.

A lot of it comes down to what you’re doing, and your preference.

If unsure, swap to file is probably a safe option. It’s flexible and easily adjusted. There are some filesystem considerations to be made, particularly if using Btrfs, but I suspect if you’re using the installer it’ll handle that for you.

With 32GB of RAM, no swap could be fine too, but that has more to do with what you’re doing. If you manage to saturate your RAM, well you might get into some trouble. I’ve opted for no swap on my loungeroom gaming system, which has 32GB RAM.

On my workstation with 64GB RAM, I have swap, but this system gets hammered daily with heavy workloads. I’m using a swap partition there, but I’d probably opt for a file if doing it again.

A swap partition was perhaps more relevant to spinning hard disk drives (HDD), where placement of the swap could strategically be located on the fastest part of the drive, and having its own partition ensured fragmentation was minimised.

SSD’s on the other hand, suffer from neither of those issues. There is no faster part of the drive, nor is fragmentation a factor anymore.

You might benefit performance wise from having the swap partition/file on a separate SSD, but that’s possible in either case.


The TLDR version:

  • No swap if you’re confident nothing you’re doing is going to need more RAM than what you have (Edit: and not needing suspend-to-disk or hibernate features).
  • Swap to file if using an SSD, as it provides flexibility.
  • Swap to partition if using a HDD, as it provides HDD specific performance and fragmentation-reduction benefits.

I agree with Bink.

I’m not creating podcasts, not playing call of duty…but I have a very multitasked/multi-window workflow. To answer your question I use the Endeavour installer to make the SWAP partition was all I ever needed with 16GB Ram.

Like everyone who replied it depends on what you do.

Check out these options, too. Many Linux users are using them:

Actually something I neglected to mention above, was using suspend (to disk) or hibernate, which require swap space. Needing those, would negate the no swap option.

Choosing swap I was guided by this info:

But i know that battles have been fought over this topic. There are several threads in this forum.

I know it is frowned upon but I have a luxurious amount of RAM installed and have never once ran into an OOM by kernel. I did however ran into low disk space warnings because my system SSD is only ~250GB. I would love if more programs would stop caching as much on disk and use RAM more (if available).

But I know, this is a luxury problem to have.

Set up zram. See the post by @drunkenvicar

this was a great read, great find ^

long live FOSS. we are blessed and rich in SWAP-choices, based on needs.