News for hackers. Stuff that matters.
Re:We do not use foreign keys (2016) by zenhack on Friday November 08, 2019 @11:39PM (#21489658)
You can turn off overcommit, in which case you'll get a null return instead of OOM killing.

But also, you can still get a malloc failure without actually be running out of memory if the allocator can't find a big enough contiguous chunk of address space.

This is highly unlikely on a 64 bit system, but if you try to malloc gigabytes on a 32 bit machine you might see it.

Re:We do not use foreign keys (2016) by Iv on Saturday November 09, 2019 @03:45AM (#21490415)
And also, you never know when this theoretical case actually happens but it did happen to me: at one point someone may use your code on an Arduino and unexpectedly, it works! But memory allocation could fail more than you expect!