In article <11ej…@dont-email.me>,
Andrey Tarasevich <noo…@noone.net> wrote:
>On Sun 11/29/2026 10:00 PM, Lawrence D’Oliveiro wrote:
>> So you don’t even need to bother to check for memory-allocation
>> failures, because you will never get a failure status.
>
>Well, firstly, overcommit approach simply substitutes "virtual address
>space" in place of "actual memory" as the limited resource. And while
>address space is usually huge, one can still exhaust it if one really
>sets their mind to it. This can still lead to an allocation failure.
>[snip]
And even if we consider virtual memory near-infinite for
practical purposes, systems usually still impose an artifical
cap on it in the form of a configurable resource limit; this
is usually well-below the size of the virtual address space.
I am reminded of some of the programming advice common in the
after the introduction of virtual memory in Unix with the
adoption of the 32-bit VAX: "We've got a whole 4 Gigs! No one
will ever use all of that, but you should still check the return
value of `malloc`."
- Dan C.