5 ms·
Depending on its use, the first thing I generally do on a new server is disable the OOM killer. At runtime: sysctl vm.overcommit_memory=2 To make it persist
by MattJ100 13y ago
Depending on its use, the first thing I generally do on a new server is disable the OOM killer.
At runtime:
sysctl vm.overcommit_memory=2
To make it persist, just add vm.overcommit_memory=2 to /etc/sysctl.conf
- HerrMonnezza 13y agoNote however, that turning off overcommit might yield unexpected results upon fork()/exec(): http://www.quora.com/What-are-the-disadvantages-of-disabling-memory-overcommit-in-Linux# http://www.quora.com/What-are-the-disadvantages-of-disabling... For instance, if you run a Redis server and turn off memory overcommit, you might not be able to background save.
- alextingle 13y agoWarning - that site requires a login.
- 0x006A 13y agoas mentioned in https://news.ycombinator.com/item?id=6300856 https://news.ycombinator.com/item?id=6300856 you can add ?share=1: http://www.quora.com/What-are-the-disadvantages-of-disabling-memory-overcommit-in-Linux?share=1 http://www.quora.com/What-are-the-disadvantages-of-disabling...
- andreasvc 13y agoThat allows me to see the first answer but not the rest.
- calinet6 13y agoWhat are the true consequences of disabling it though? What happens in the OOM situation? Or does it just not allow allocation?
- adobriyan 13y agoAllocation fails with ENOMEM.
- Piskvorrr 13y ago...which is an error that is rarely handled in the code nowadays, therefore highly unexpected behavior may be expected ;)
- dredmorbius 13y agoFile and/or tear your vendor a new one.
- dredmorbius 13y agoEdit: file a bug ...