I am trying to do is disable overcommit and set global memory limits for the following outcomes:
1. Processes will get error if they try to allocate more than a set limit
2. OOM does not activate and does not activate to kill processes that did not cause the allocation failure (eg. kill biggest process mode)
3. System is not grounded to a halt because of thrashing.
I am looking for something similar to vm.overcommit_memory=2 vm.overcommit_ratio=99 on linux.
https://forums.freebsd.org/threads/...ocations-fail-in-a-sane-way.83582/post-550016 (whole thread is worth a read) suggests that even with vm.overcommit=7 OOM killer will still activate if used programs memory is passed swap limit (I have no idea why because earlier in the thread (https://forums.freebsd.org/threads/...ocations-fail-in-a-sane-way.83582/post-549905) the user tried malloc with the with large size with sysctl set and it failed (or at least without them noticing anything being killed). So if this is the case, is there another way? vm.overcommit = 7 in combination with protect command is not good enough here unless protect -di 1 (init) stops all existing and new processes from being killed by oom when existing swap space is exhausted (assuming oom isn't triggered by something other than exhausted swap space and/or protect(1) accounts for the other scenarios that may trigger oom). I see limits(1) may help, but does hw.physmem act on physical ram in addition to swap as I want programs to use some swap?
1. Processes will get error if they try to allocate more than a set limit
2. OOM does not activate and does not activate to kill processes that did not cause the allocation failure (eg. kill biggest process mode)
3. System is not grounded to a halt because of thrashing.
I am looking for something similar to vm.overcommit_memory=2 vm.overcommit_ratio=99 on linux.
https://forums.freebsd.org/threads/...ocations-fail-in-a-sane-way.83582/post-550016 (whole thread is worth a read) suggests that even with vm.overcommit=7 OOM killer will still activate if used programs memory is passed swap limit (I have no idea why because earlier in the thread (https://forums.freebsd.org/threads/...ocations-fail-in-a-sane-way.83582/post-549905) the user tried malloc with the with large size with sysctl set and it failed (or at least without them noticing anything being killed). So if this is the case, is there another way? vm.overcommit = 7 in combination with protect command is not good enough here unless protect -di 1 (init) stops all existing and new processes from being killed by oom when existing swap space is exhausted (assuming oom isn't triggered by something other than exhausted swap space and/or protect(1) accounts for the other scenarios that may trigger oom). I see limits(1) may help, but does hw.physmem act on physical ram in addition to swap as I want programs to use some swap?