4 ms·
> Overcommit is not actually relevant. It is if you ever want to exercise the code paths. Overcommit means you never get an out of memory error. Your process j
by ori_b 11y ago
> Overcommit is not actually relevant.
It is if you ever want to exercise the code paths. Overcommit means you never get an out of memory error. Your process just dies. Kind of like it would if you just aborted.
- caf 11y agoWhen you're running tests in development you can easily set up a test environment with and without overcommit enabled (and in fact there are other ways to limit allocated memory on a per-process basis that work even with overcommit, such as with rlimits). ...but that doesn't even really matter, because in order to fully exercise those code paths you need precise control over exactly which call to malloc() returns NULL, which in practice means you need to interpose malloc() with a debugging framework to force a NULL return.