3 ms·
malloc() should fail even with always over commit enabled if you try to malloc more memory than there is virtual address space, although that needs testing to c
by ryao 10y ago
malloc() should fail even with always over commit enabled if you try to malloc more memory than there is virtual address space, although that needs testing to confirm it. The alternative to failing would be hanging inside the kernel, which would be a DoS attack.
- krallin 10y agoYes, you're entirely correct; that's actually what I meant by "provided the Kernel can represent [it]" (albeit perhaps not very clearly!). Cheers,
- ryao 10y agoThere is also the case of the sum of the allocations of several malloc operations exceeding that threshold. The case of just 1 malloc operation being that large is just a special case of that. That is what I meant, but reading what Ibwrore made me realize that I was not clear about that.