Remix.run Logo
justincormack 5 hours ago

You can work around overcommit by writing a byte to every allocated page at allocation time, so that it has to be actually allocated.

dnautics 4 hours ago | parent [-]

out of curiosity, does that generally mean that (linux) OOM killer can't get you? IIRC the oom killer is only triggered on new page request, and only the requesting process is eligble for the murder?

chris- 4 hours ago | parent [-]

No, it does not. The oom killer acts on (mostly) the oom score and no process is exepmt, regardless of whether or not it allocates new memory. It may help you write correct programs in certain situations though, eg. if your program was running in a defined context, eg. a cgroup, and you would not allocate beyond your cgroup limits, and the system was configured sanely, you can handle allocation problems easier.

dnautics 3 hours ago | parent [-]

aw damn. thanks for clarifying.