Disabling memory overcommit on per-allocation basis

185 Views Asked by At

Is there a way to try to allocate a memory chunk and get an error if the memory is not instantly available?

calloc() seems like a good candidate as it touches the whole allocated memory immediately, however, I guess it will kill the process instead of returning NULL.

Any other options?

1

There are 1 best solutions below

0
Martin Sustrik On BEST ANSWER

No replies. I assume there is no way to disable application being OOM-killed because of a large allocation.