3 ms·
I've always wondered, has there never been an effort to add to Linux a dynamic swap file like Windows and macOS ("X") have always had?
by kalleboo 2y ago
I've always wondered, has there never been an effort to add to Linux a dynamic swap file like Windows and macOS ("X") have always had?
- theblazehen 2y agoYes, I've used systemd-swap https://github.com/nefelim4ag/systemd-swap https://github.com/nefelim4ag/systemd-swap
- vbezhenar 2y agoShould be trivial with simple cron script? Just check swap usage once a minute and create/delete /swapfile-N as necessary.
- dspillett 2y agoThe problem with expanding page files is that by the time you really need them (they are expanding a lot) you might be past the point of no return where just hitting the power button is your best option. Once you are using a lot of paging, chances are performance has fallen through the floor to the point where doing anything to fix it (killing run-away processes, closing other processes (killing those that won't go willingly)) takes so long that you are fighting a losing battle. This is less of an issue with fast SD drives than it is with spinning rust (or slow SD cards / eMMC with some smaller devices) but still essentially the case. I just have enough swap defined for some small unusual circumstances and assume that if I need more than that things are falling over anyway so OOM taking things our is not going to make it worse (if they continued to thrash I'd have to kill them anyway).
- deleted 2y ago[deleted]
- lproven 2y ago> has there never been an effort to add to Linux a dynamic swap file Ubuntu does this by default and has done since 18.04 or so, maybe earlier.