3 ms·
No, sadly. This doesn't happen in my experience. The main reason seems to be that executable code is memory mapped from disk anyway. So in a low-memory scenario
by rcxdude 3y ago
No, sadly. This doesn't happen in my experience. The main reason seems to be that executable code is memory mapped from disk anyway. So in a low-memory scenario, that gets evicted, causing the same kind of thrashing but worse because it's essentially forced to be focused on really active areas instead of the least active. The end result is instead of a slow bogging down like you get with swap enabled, you get a sudden freeze which may eventually resolve itself but during which the system is almost completely unresponsive. In general if you are running without swap I would strongly recommend you do use something like earlyoom.
- mnw21cam 3y agoAgreed - most people don't realise, but even if you don't have any swap, all your executable code is effectively treated exactly the same way as swap (except it's read-only and needed more often). I'd love a setting on Linux to tell it to treat executable pages memory-mapped from disc as Really Important and never evict them. It'd have to come with a suitable warning that if you set this then you get exactly what you deserve, but TBH it probably is what most people actually think is happening already and want.
- askl 3y agoHeh, thanks for explaining this. Maybe my general aversion towards swap wasn't fully based on facts.