🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #2092

Re: is a wrapper on memory-allocation calls a good idea?

#2092
From: Dan Cross
Date: Wed, 02 Dec 2026 17:04
41 lines
2890 bytes
In article <44jylstwpp.fsf@lowell-ubuntu25.lan>,
Lowell Gilbert  <lgusenet@be-well.ilk.org> wrote:
>Andrey Tarasevich <noone@noone.net> writes:
>
>> On Mon 11/30/2026 10:31 AM, Lawrence D’Oliveiro wrote:
>>> On Sun, 29 Nov 2026 22:44:26 -0800, Andrey Tarasevich wrote:
>>>> Well, firstly, overcommit approach simply substitutes "virtual
>>>> address space" in place of "actual memory" as the limited resource.
>>> No, it is actual memory that is being overcommitted.
>>
>> Yes, but the whole idea of "overcommiting" simply means that the
>> allocator will _reserve_ virtual address space without checking
>> whether there is physical storage to back it up.
>
>and this happens because of the mechanics of (now POSIX) fork(), which
>unfortunately was built into the fundament decades ago (long before
>POSIX)

Not really.  Perhaps you're thinking about copy-on-write address
spaces vis fork?  That doesn't require overcommit; it's
perfectly possible both to require and reserve enough available
memory to fault the entire writable portion of an address space
into existence at `fork`.  Historical Unix systems did exactly
that.

>> Virtual address space of the process still needs to be reserved at the
>> moment of allocation. And virtual address space still gets "used up"
>> by such allocations. It can eventually run out. That is the point I
>> was making.
>
>In theory, yes. But if it became (even foreseeably) a problem, we would
>probably build systems with larger address spaces, in which case
>"properly written" (ahem) C code would automatically use the larger
>space without any problem. This has, obviously, happened before.

Again, I think this is mostly orthogonal; a program may want to
allocate a large tract of virtual address space for any number
of reasons, many of which are unrelated to `malloc` et al.

	- Dan C.
Technical Details
Message-ID: <11epj3c$7k1$1@reader2.panix.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail
References: <11eh538$3fet7$1@dont-email.me> <11ekfeo$mq5n$1@dont-email.me> <11emqek$1rpei$1@dont-email.me> <44jylstwpp.fsf@lowell-ubuntu25.lan>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail
From: cross@spitfire.i.gajendra.net (Dan Cross)
Newsgroups: comp.lang.c
Subject: Re: is a wrapper on memory-allocation calls a good idea?
Date: Wed, 2 Dec 2026 17:04:44 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <11epj3c$7k1$1@reader2.panix.com>
References: <11eh538$3fet7$1@dont-email.me> <11ekfeo$mq5n$1@dont-email.me> <11emqek$1rpei$1@dont-email.me> <44jylstwpp.fsf@lowell-ubuntu25.lan>
Injection-Date: Wed, 2 Dec 2026 17:04:44 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80";
	logging-data="7809"; mail-complaints-to="abuse@panix.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: cross@spitfire.i.gajendra.net (Dan Cross)