Last I checked the EnOS installer allows you to enable swap in two ways, as a partition or a file. Windows apps, especially the older ones, seem to expect that there’s a swap file present even if it’s not desperately needed, based on reports online. So what would then be the ideal way to setup swap during EnOS install - ‘swap to file’, or leaving the setting disabled so that swap could be configured after install, for example by enabling ZRAM? A swap partition seems to be the worst of the options if you consider swapping speed and disk wear. Do Windows apps care either way as long as they can swap? Could Wine do some kind of swap emulation?
I am not sure what you are referring to but perhaps this is about a Windows swap file which is different than a Linux swap file?
There is no best way. It is entirely a matter of personal preference and what your specific use case demands.
A swap partition is actually faster then a swap file although the performance difference is minimal enough that it shouldn’t be a material difference either way.
As for disk wear, it depends on your disk hardware but many modern SSDs implement wear leveling across partition boundaries.
Applications shouldn’t know or care if you have a swap file or a swap partition.
Windows calls its swap file a ‘pagefile’, but in practice they seem the same.
What about RAM-based swap?
I guess the point was if you are reading articles that are based on Windows that claim that a pagefile is needed for good performance, that doesn’t translate to mean that a swapfile is better for Windows apps running on Linux. It is an apples and oranges comparison.
It is the same, it is still seen as swap. However, the performance characteristics and implications are totally different.
What is your CPU and how much RAM do you have?
I’ve read some comments about encountering app instability when running Windows apps on Wine without swap, but as I’m still primarily running Windows I can’t say yet if there’s generally any truth to them. I’ll just have to find out by trial and error after fully migrating to Linux.
Intel 6700K and 16 Gb of RAM.
That is an older CPU but not ancient. Probably would be OK with zram or zswap. It would be best for you to test it with your own workloads and see what works best.
In general, zram provides for ultra-fast swap at the cost of CPU load and uncompressed RAM availability.
Since many modern AAA games have poor CPU optimization, I suspect it would be best to use a swap partition or a swap file over zram/zswap. Although it will likely depend on how memory demanding the specific game is. Testing with your specific config and games will be the best way to find out.
My advice, for what it’s worth, with 16 GiB of RAM, your swap will only rarely be utilised. Still any Linux system benefits from swap, to optimise the usage of RAM. If you have no intention of hibernating, I would recommend making a 6 GiB swap file on your fastest drive. I wouldn’t worry about NAND degradation, because this will be used very minimally.
I don’t generally play modern games, but I agree that a swap file might be the right compromise for my system if it’s needed. I do some real-time audio tasks so extra CPU load isn’t welcome. It looks as if zswap puts a priority on the RAM cache because of its speed, so that’s also out of the question.
I could probably even go without if it wasn’t for the possibility that Windows apps need to see that swap is available, even if they never actually use it. Some might still want to swap even if RAM isn’t close to running out. This is one of the things I read about. I run a lot of apps that come from an era of limited RAM.
You should never be without swap on Linux. Even if you have 64 GiB of RAM, and only use a text editor.
That’s the general advice for Windows as well, but there seem to be many who recommend that you don’t bother with swap on Linux if you have 16 Gb of RAM or more.