Article View: comp.lang.c
Article #2025Re: is a wrapper on memory-allocation calls a good idea?
From: Lawrence D’Oliveiro
Date: Mon, 30 Nov 2026 18:34
Date: Mon, 30 Nov 2026 18:34
19 lines
2076 bytes
2076 bytes
On Mon, 30 Nov 2026 07:16:45 +0100, Bonita Montero wrote: > Am 30.11.2026 um 07:00 schrieb Lawrence D’Oliveiro: > >> On Linux systems, you can set the memory-allocation policy to >> “overcommit”, which basically means that, when a process asks for >> memory, the kernel never says no >> <https://manpages.debian.org/proc_sys_vm(5)>. > > realloc() may be necessary nevertheless when a memory chunk isn't > large enough. With overcommit you could allocate more memory than > needed to reduce the likehood of realloc()s. Runtime memory allocators normally works in bigger units than individual allocation requests, anyway. This is orthogonal to the overcommit policy (or not) as supported by the kernel. What the Linux policy option allows is you can simply forget to check for out-of-memory errors.
Technical Details
Message-ID:
<11ekfj1$mq5n$2@dont-email.me>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11eh538$3fet7$1@dont-email.me> <11ehine$3kr02$1@dont-email.me> <11ej3eh$5ajn$3@dont-email.me> <11ej4cd$5t50$1@raubtier-asyl.eternal-september.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Lawrence D’Oliveiro <ldo@nz.invalid> Newsgroups: comp.lang.c Subject: Re: is a wrapper on memory-allocation calls a good idea? Date: Mon, 30 Nov 2026 18:34:10 -0000 (UTC) Organization: A noiseless patient Spider Lines: 19 Message-ID: <11ekfj1$mq5n$2@dont-email.me> References: <11eh538$3fet7$1@dont-email.me> <11ehine$3kr02$1@dont-email.me> <11ej3eh$5ajn$3@dont-email.me> <11ej4cd$5t50$1@raubtier-asyl.eternal-september.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 30 Nov 2026 18:34:10 +0000 (UTC) Injection-Info: dont-email.me; logging-data="747703"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/H5J0JZYY80D4m0XQuhjyk"; posting-host="a13339aa161941cd02c77e7c540602f1" User-Agent: Pan/0.165 (Kostiantynivka) Cancel-Lock: sha1:sxOf3zt5oi4IjUAyFVsenL7NMQI= sha256:fSURcdwZm3dPzPrgnu6mXQW/1F9IAaohFfz6Usb5jVc= sha1:KmDCaNN2GrcMWUo7KcS4obpWDuA= sha256:6ikLrfmenAbnsCq0qBWOSoS8sHZ2AEzWFun9FVTx4qU=