3 ms·
The alternative is what Android and iOS do - applications keep running on a best-effort basis and are summarily executed if physical RAM runs out. SSD space is
by jsheard 3y ago
The alternative is what Android and iOS do - applications keep running on a best-effort basis and are summarily executed if physical RAM runs out.
SSD space is dirt cheap (unless you get it from Apple), I'm not losing any sleep over losing a few gigs to a swap file to keep that from ever happening.
- AnotherGoodName 3y agoFun thing I've had to do on Android. When the app does a really memory intensive task (client side video encoding in this case) we forked that process and trapped the sigsegv fault from the oom in the parent process and simply restarted after a sleep. It fixed a huge percentage of app deaths for us. The reason this worked is that Android starts killing processes only after you pretty much run out of ram. So if you have a task that needs a lot of RAM even though the phone has it if it just closed a few apps you can't use that ram until after you've hit the allocation fault and let a bunch of apps die.
- wilkystyle 3y agoWhich is incredibly frustrating if you need to switch between your browser and another app and the browser keeps getting killed and has to reload every time you come back
- MaxBarraclough 3y agoI'd blame bloatware rather than the OS. As globular-toast's comment points out, using an SSD for swap could cause significant wear, i.e. shortening of the device's usable lifetime. If applications made more efficient use of memory, the OS wouldn't need to terminate processes.
- easeout 3y agoThis used to happen back when phones could only keep a few apps backgrounded at a time, but I haven't seen iOS kill the most recently used background app since the first couple years backgrounding was supported at all. But then, apps in that environment were made for no swap. If you take away swap on a desktop system it could be another story.
- surajrmal 3y agoAndroid uses zram, which is a form of swap by compressing memory. That still has limits which leads to oom killing but so does traditional swap.
- globular-toast 3y agoWhy would it never happen? The swap space is still limited. If you run out stuff gets killed by the OOM (out of memory) killer. What's the difference? Also, it's not just about space. SSDs have a very limited number of write cycles before they fail.
- jsheard 3y agoWith swap it practically never happens unless you have a catastrophic memory leak somewhere. Write endurance isn't that much of a concern with modern SSDs, I just retired an SSD which had been used as my main system and swap drive for about 5 years, and it had clocked up about 80TB of writes in that time. Its rated write endurance was 600TB, and now it's not uncommon for drives to be rated for double or quadruple that amount.
- cryptonector 3y ago> SSD space is dirt cheap (unless you get it from Apple), I'm not losing any sleep over losing a few gigs to a swap file to keep that from ever happening. I don't lose sleep over space on my SSD either, but I don't want thrashing either. As a user I get no real feedback on the memory usage of my applications until everything gets slow. Fortunately it's easy to configure Firefox to unload idle tabs, but it might be better if -at least for GUI apps- I could confidently configure no swap.