![](https://programming.dev/pictrs/image/b58839d3-c738-4d27-a97b-f9fcfd5c8bbe.jpeg)
![](https://programming.dev/pictrs/image/028151d2-3692-416d-a8eb-9d3d4cc18b41.png)
I’ve run Arch without swap for many years without issues. The key of course is that you need enough RAM for what you are trying to do with your computer.
There’s no reason why a 32GB RAM + 0GB swap system should have more problems than a 16GB RAM + 16GB swap system with the same workload. If anything, the former is going to run much better.
I run a lot of VMs; I typically run 2 at the same time in addition to running other programs in the background, my usecase is more eccentric than most users in the Linux space which is already pretty niche
What is finicky about a swap file?
It’s just this:
mkswap -U clear --size 4G --file /swapfile swapon /swapfile
Done
I’m using BTRFS with LUKS-based Full Disk Encryption, the last time I used swapfiles with BTRFS with FDE it was in 2019 and it was painful to say the least, I rememeber spending several weeks scouring Stack and the Arch forums in order to get it to work properly.
- usecases and preferences will differ from user to user, so I wouldn’t advise assuming a one-size-fits-all solution
If anything it’s way easier to create a file in your filesystem than having to (re-)partition your drive to have a swap partition. Much more flexible too if you want to change your swap configuration in the future.
swapfiles are great in that you can resize them at will, however after trying all 3 options I found myself questioning when would I even want to resize swap for a single system, so at a certain point I felt that swapfiles were more of a gimmick cause again you don’t really want to depend on swap if can.
- if you’re consistently reaching your physical memory limits, upgrading your ram will most likely be the best bet for both system stability and hardware durability
if so that’s pretty dope!