Hacker News new | ask | show | jobs
by ynik 898 days ago
That only works if the system is accessing mostly anonymous pages. If the load on the system is accessing plenty of mmapped code/data pages, it can still trash those even if swap is disabled. I've still seen systems hanging for 10+ minutes without recovering even though swap was already disabled.

The Linux kernel OOM killer only acts if there's nothing left that can be discarded, which often happens way too late to save the system. You need a user-mode OOM-killer like earlyoom if you want to keep the system responsive.

2 comments

Yes, I don't disagree that user-mode OOM-killers are helpful, or that the system can still hang without swap.

I'm just saying turning on swap, or increasing the swap capacity does not fix the problem, and it usually makes it worse.

This is why on production systems important binaries should mlock all of their code pages into ram at startup.