logoalt Hacker News

LoganDarkyesterday at 7:04 PM3 repliesview on HN

This is only a viable answer when overcommit is disabled. The problem comes when overcommit is enabled and you find yourself in a position where many programs think they already have memory and yet there is none to give them. If you simply kill the first piece of code that encounters the end of available memory you might take down anything including the kernel itself.

Nothing like statically allocating memory can work when overcommit is enabled because the kernel is free to compress memory, page it out and etc. and then murder you the next time you try to perform any operation that it doesn't have the space for, no matter how safe and static your initialization was.

Note that overcommit is very useful in many cases including the ones where swap saves the stability of the system under conditions that would otherwise completely lock up or panic, so it's also not viable to just prevent it from being used.


Replies

SoftTalkeryesterday at 8:12 PM

OOM killer always felt like a band-aid on a severed artery to me. I've rarely seen a machine that got into OOM state really recover without a full reboot.

show 1 reply
sedatkyesterday at 7:07 PM

I’m not against taking down the kernel if the situation is that catastrophic. Better than killing the lock screen for sure.

show 2 replies